@useairfoil/producer-github 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-DKDUc00e.mjs","names":["make","layer","make","GitHubAuth.GitHubAuth","layer","GitHubAuth.layer","layerConfig","Arr","toRow","toRow","toRow","Arr","toRow","toRow","hasLists","toRow","toRow","toRow","toRow","toRow","toRow","toRow","GitHubClient.GitHubClient","GitHubClient.layer"],"sources":["../src/client/constants.ts","../src/client/auth.ts","../src/client/client.ts","../src/schemas/shared.ts","../src/schemas/check-runs.ts","../src/schemas/issue-comments.ts","../src/schemas/issues.ts","../src/schemas/pull-request-review-comments.ts","../src/schemas/pull-requests.ts","../src/schemas/releases.ts","../src/schemas/repositories.ts","../src/schemas/workflow-runs.ts","../src/schemas/events.ts","../src/schemas/commits.ts","../src/resources/shared.ts","../src/resources/commits.ts","../src/resources/check-runs.ts","../src/schemas/commit-statuses.ts","../src/resources/commit-statuses.ts","../src/resources/issue-comments.ts","../src/resources/issues.ts","../src/schemas/pull-request-commits.ts","../src/resources/pull-requests.ts","../src/resources/pull-request-commits.ts","../src/resources/pull-request-review-comments.ts","../src/schemas/pull-request-reviews.ts","../src/resources/pull-request-reviews.ts","../src/resources/releases.ts","../src/resources/repositories.ts","../src/schemas/workflow-jobs.ts","../src/resources/workflow-runs.ts","../src/resources/workflow-jobs.ts","../src/webhook/signature.ts","../src/webhook/route.ts","../src/connector.ts"],"sourcesContent":["// Keep this version aligned with the resource schemas.\nexport const GITHUB_API_VERSION = \"2026-03-10\";\n\nexport const baseUrl = \"https://api.github.com\";\n","import { Auth, ConnectorError, Telemetry } from \"@useairfoil/connector-kit\";\nimport { Clock, Context, Duration, Effect, Layer, Redacted, Schedule, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\nimport { createPrivateKey, sign } from \"node:crypto\";\n\nimport type { GitHubConfig } from \"../manifest\";\n\nimport { GITHUB_API_VERSION, baseUrl } from \"./constants\";\n\ntype GitHubAuthConfig = Pick<GitHubConfig, \"appClientId\" | \"appPrivateKey\" | \"installationId\">;\n\nexport type GitHubAuthService = Auth.TokenCache<ConnectorError>;\n\nexport class GitHubAuth extends Context.Service<GitHubAuth, GitHubAuthService>()(\n \"@useairfoil/producer-github/GitHubAuth\",\n) {}\n\nconst TokenResponseSchema = Schema.Struct({\n token: Schema.String,\n expires_at: Schema.DateFromString,\n});\n\nconst base64Url = (value: string | Buffer): string => Buffer.from(value).toString(\"base64url\");\n\n/**\n * Signs the app JWT with RS256. GitHub allows at most 10 minutes, and asks for\n * `iat` 60 seconds in the past to allow for clock drift.\n */\nexport const makeAppJwt = (options: {\n readonly clientId: string;\n readonly privateKey: string;\n readonly nowMillis: number;\n}): Effect.Effect<string, ConnectorError> =>\n Effect.try({\n try: () => {\n const now = Math.floor(options.nowMillis / 1000);\n const header = base64Url(JSON.stringify({ alg: \"RS256\", typ: \"JWT\" }));\n const claims = base64Url(\n JSON.stringify({ iat: now - 60, exp: now + 9 * 60, iss: options.clientId }),\n );\n const signingInput = `${header}.${claims}`;\n // Env files often keep the PEM on one line with escaped newlines.\n const key = createPrivateKey(options.privateKey.replace(/\\\\n/g, \"\\n\"));\n return `${signingInput}.${base64Url(sign(\"sha256\", Buffer.from(signingInput), key))}`;\n },\n catch: (cause) => new ConnectorError({ message: \"Invalid GitHub App private key\", cause }),\n });\n\nexport const make = Effect.fnUntraced(function* (config: GitHubAuthConfig) {\n const client = (yield* HttpClient.HttpClient).pipe(\n HttpClient.retryTransient({\n schedule: Schedule.exponential(\"250 millis\").pipe(Schedule.jittered),\n times: 3,\n }),\n );\n const path = `/app/installations/${config.installationId}/access_tokens`;\n\n return yield* Auth.makeTokenCache({\n acquire: Effect.gen(function* () {\n const jwt = yield* makeAppJwt({\n clientId: config.appClientId,\n privateKey: Redacted.value(config.appPrivateKey),\n nowMillis: yield* Clock.currentTimeMillis,\n });\n const request = HttpClientRequest.post(`${baseUrl}${path}`).pipe(\n HttpClientRequest.bearerToken(jwt),\n HttpClientRequest.acceptJson,\n HttpClientRequest.setHeader(\"X-GitHub-Api-Version\", GITHUB_API_VERSION),\n );\n const response = yield* client\n .execute(request)\n .pipe(\n Effect.mapError(\n (cause) =>\n new ConnectorError({ message: \"GitHub installation token request failed\", cause }),\n ),\n );\n const body = yield* HttpClientResponse.matchStatus(response, {\n \"2xx\": (ok) =>\n HttpClientResponse.schemaBodyJson(TokenResponseSchema)(ok).pipe(\n Effect.mapError(\n (cause) =>\n new ConnectorError({\n message: \"Invalid GitHub installation token response\",\n cause,\n }),\n ),\n ),\n orElse: (failed) =>\n Effect.fail(\n new ConnectorError({\n message: `GitHub returned ${failed.status} for the installation token`,\n }),\n ),\n });\n const now = yield* Clock.currentTimeMillis;\n return {\n value: Redacted.make(body.token),\n expiresIn: Duration.millis(Math.max(body.expires_at.getTime() - now, 0)),\n };\n }).pipe(\n Effect.tapError((error) => Telemetry.annotateError(\"api_auth\", error)),\n Effect.withSpan(Telemetry.SpanName.apiFetch, {\n kind: \"client\",\n attributes: { [Telemetry.Attr.apiPath]: path },\n }),\n ),\n });\n});\n\nexport const layer = (\n config: GitHubAuthConfig,\n): Layer.Layer<GitHubAuth, never, HttpClient.HttpClient> => Layer.effect(GitHubAuth)(make(config));\n","import { ConnectorError, Metrics, Telemetry } from \"@useairfoil/connector-kit\";\nimport { Config, Context, Duration, Effect, Layer, Option, Schedule, Schema } from \"effect\";\nimport { HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { type GitHubConfig, manifest } from \"../manifest\";\nimport * as GitHubAuth from \"./auth\";\nimport { GITHUB_API_VERSION, baseUrl } from \"./constants\";\n\nconst maxRetries = 5;\nconst retryBaseDelay = Duration.millis(500);\nconst requestTimeout = Duration.minutes(2);\n\nexport type GitHubPage<A> = {\n readonly body: A;\n readonly next: Option.Option<string>;\n};\n\nexport type GitHubClientService = {\n /** GETs a path such as `/repos/o/r/issues?state=all`, or a `next` URL. */\n readonly get: <A>(\n schema: Schema.Decoder<A>,\n url: string,\n ) => Effect.Effect<GitHubPage<A>, ConnectorError>;\n};\n\nexport class GitHubClient extends Context.Service<GitHubClient, GitHubClientService>()(\n \"@useairfoil/producer-github/GitHubClient\",\n) {}\n\nexport const withParams = (path: string, params: Readonly<Record<string, string>>): string =>\n `${path}?${new URLSearchParams(params).toString()}`;\n\nexport const nextLink = (header: string | undefined): Option.Option<string> =>\n Option.fromNullishOr(/<([^>]+)>;\\s*rel=\"next\"/.exec(header ?? \"\")?.[1]);\n\nconst ErrorBodySchema = Schema.Struct({ message: Schema.optional(Schema.String) });\n\nconst statusError = (response: HttpClientResponse.HttpClientResponse, path: string) =>\n HttpClientResponse.schemaBodyJson(ErrorBodySchema)(response).pipe(\n Effect.map((body) => body.message),\n Effect.orElseSucceed(() => undefined),\n Effect.flatMap((detail) =>\n Effect.fail(\n new ConnectorError({\n message: `GitHub API returned ${response.status} for ${path}${detail ? `: ${detail}` : \"\"}`,\n }),\n ),\n ),\n Effect.tapError((error) => Telemetry.annotateError(\"api_status\", error)),\n );\n\n/**\n * GitHub answers rate limits with `403` or `429`. A `403` is a rate limit when\n * it has `retry-after`, `x-ratelimit-remaining: 0`, or a rate limit message;\n * otherwise it's a permission error.\n */\nconst isRateLimited = (response: HttpClientResponse.HttpClientResponse, body: string) =>\n response.status === 429 ||\n (response.status === 403 &&\n (response.headers[\"retry-after\"] !== undefined ||\n response.headers[\"x-ratelimit-remaining\"] === \"0\" ||\n /rate limit/i.test(body)));\n\n// Rate limits fail with a status error, so `retryTransient` retries a `403` too.\nconst rateLimitedResponse = (input: unknown) =>\n HttpClientError.isHttpClientError(input) && input.reason._tag === \"StatusCodeError\"\n ? input.reason.response\n : undefined;\n\nconst retrySchedule = Metrics.retrySchedule({\n connector: manifest.name,\n baseDelay: retryBaseDelay,\n times: maxRetries,\n}).pipe(\n Schedule.modifyDelay(({ input, duration, now, attempt }) => {\n const response = rateLimitedResponse(input);\n if (response === undefined) return Effect.succeed(duration);\n const retryAfter = response.headers[\"retry-after\"];\n if (retryAfter !== undefined) return Effect.succeed(Duration.seconds(Number(retryAfter)));\n if (response.headers[\"x-ratelimit-remaining\"] === \"0\") {\n // The reset is in whole seconds and our clock can differ, so wait a second more.\n return Effect.succeed(\n Duration.millis(\n Math.max(Number(response.headers[\"x-ratelimit-reset\"]) * 1000 - now, 0) + 1000,\n ),\n );\n }\n // With neither header, GitHub says to wait at least a minute, then longer.\n return Effect.succeed(Duration.minutes(2 ** (attempt - 1)));\n }),\n);\n\nexport const make = Effect.fnUntraced(function* () {\n const auth = yield* GitHubAuth.GitHubAuth;\n const client = (yield* HttpClient.HttpClient).pipe(\n HttpClient.mapRequest((request) =>\n request.pipe(\n HttpClientRequest.acceptJson,\n HttpClientRequest.setHeader(\"X-GitHub-Api-Version\", GITHUB_API_VERSION),\n ),\n ),\n HttpClient.mapRequestEffect((request) =>\n auth.get.pipe(Effect.map((token) => HttpClientRequest.bearerToken(request, token))),\n ),\n HttpClient.transformResponse(\n Effect.flatMap((response) =>\n // Reads the body inside the timeout. The response caches it for decoding.\n Effect.flatMap(response.text, (body) =>\n isRateLimited(response, body)\n ? Effect.fail(\n new HttpClientError.HttpClientError({\n reason: new HttpClientError.StatusCodeError({\n request: response.request,\n response,\n }),\n }),\n )\n : Effect.succeed(response),\n ),\n ),\n ),\n // Rate-limit waits don't count towards the attempt's timeout.\n HttpClient.transform((effect) => Effect.timeout(effect, requestTimeout)),\n HttpClient.retryTransient({\n schedule: retrySchedule,\n while: (error) => rateLimitedResponse(error) !== undefined,\n }),\n );\n\n const get = <A>(\n schema: Schema.Decoder<A>,\n url: string,\n ): Effect.Effect<GitHubPage<A>, ConnectorError> => {\n const fullUrl = url.startsWith(\"/\") ? `${baseUrl}${url}` : url;\n // `next` URLs come from GitHub, but never send the token anywhere else.\n if (!fullUrl.startsWith(`${baseUrl}/`)) {\n return Effect.fail(new ConnectorError({ message: `Not a GitHub API URL: ${url}` }));\n }\n const path = fullUrl.slice(baseUrl.length).split(\"?\")[0] ?? fullUrl;\n\n return client.execute(HttpClientRequest.get(fullUrl)).pipe(\n Effect.catchTag([\"HttpClientError\", \"TimeoutError\"], (error) => {\n // Out of retries: report the rate limit with GitHub's message, like any status.\n const response = rateLimitedResponse(error);\n if (response !== undefined) return Effect.succeed(response);\n return Telemetry.annotateError(\"api_http\", error).pipe(\n Effect.andThen(\n Effect.fail(\n new ConnectorError({\n message: `GitHub API request ${error._tag === \"TimeoutError\" ? \"timed out\" : \"failed\"} for ${path}`,\n cause: error,\n }),\n ),\n ),\n );\n }),\n Effect.flatMap((response) =>\n HttpClientResponse.matchStatus(response, {\n \"2xx\": (ok) =>\n HttpClientResponse.schemaBodyJson(schema)(ok).pipe(\n Effect.tapError((error) => Telemetry.annotateError(\"api_decode\", error)),\n Effect.mapError(\n (cause) =>\n new ConnectorError({ message: `Invalid GitHub API response for ${path}`, cause }),\n ),\n Effect.map((body) => ({ body, next: nextLink(ok.headers.link) })),\n ),\n orElse: (failed) => statusError(failed, path),\n }),\n ),\n Effect.withSpan(Telemetry.SpanName.apiFetch, {\n kind: \"client\",\n attributes: {\n [Telemetry.Attr.apiPath]: path,\n \"github.api.version\": GITHUB_API_VERSION,\n },\n }),\n );\n };\n\n return GitHubClient.of({ get });\n});\n\nexport const layer = (\n config: GitHubConfig,\n): Layer.Layer<GitHubClient, never, HttpClient.HttpClient> =>\n Layer.effect(GitHubClient)(make()).pipe(Layer.provide(GitHubAuth.layer(config)));\n\nexport const layerConfig = (\n config: Config.Wrap<GitHubConfig>,\n): Layer.Layer<GitHubClient, Config.ConfigError, HttpClient.HttpClient> =>\n Layer.unwrap(Config.unwrap(config).pipe(Effect.map(layer)));\n","import { Schema, SchemaTransformation } from \"effect\";\n\n/** IDs and counts. Connector Kit maps whole numbers to Iceberg longs. */\nexport const Long = Schema.Int.pipe(\n Schema.decodeTo(\n Schema.BigInt,\n SchemaTransformation.transform({\n decode: (value) => BigInt(value),\n encode: (value) => Number(value),\n }),\n ),\n);\n\nexport const Timestamp = Schema.DateFromString;\n\n/** Text GitHub can clear, such as a body. */\nexport const Text = Schema.NullOr(Schema.String).pipe(\n Schema.decodeTo(\n Schema.String,\n SchemaTransformation.transform({\n decode: (value) => value ?? \"\",\n encode: (value) => value,\n }),\n ),\n);\n\n/** `null` becomes an empty list. A webhook can leave the list out. */\nexport const optionalList = <S extends Schema.Top>(item: S) =>\n Schema.optionalKey(\n Schema.NullOr(Schema.Array(item)).pipe(\n Schema.decodeTo(\n Schema.Array(Schema.toType(item)),\n SchemaTransformation.transform({\n decode: (value) => value ?? [],\n encode: (value) => value,\n }),\n ),\n ),\n );\n\nexport const user = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"GitHub user ID.\" })),\n login: Schema.String.pipe(Schema.annotateKey({ description: \"GitHub username.\" })),\n type: Schema.String.pipe(\n Schema.annotateKey({ description: \"Account type, such as User, Bot, or Organization.\" }),\n ),\n});\n\nexport const label = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Label ID.\" })),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"Label name.\" })),\n});\n\nexport const milestone = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Milestone ID.\" })),\n number: Long.pipe(Schema.annotateKey({ description: \"Milestone number in the repository.\" })),\n title: Schema.String.pipe(Schema.annotateKey({ description: \"Milestone title.\" })),\n});\n\nexport const version = (object: string) =>\n Schema.Date.pipe(Schema.annotateKey({ description: `Time GitHub last updated the ${object}.` }));\n\n/** For objects without an update time. A newer read wins. */\nexport const readVersion = (object: string) =>\n Schema.Date.pipe(\n Schema.annotateKey({\n description: `Time the connector read the ${object}. GitHub has no update time for it.`,\n }),\n );\n\nexport const deleted = (object: string) =>\n Schema.optional(Schema.Boolean).pipe(\n Schema.annotateKey({ description: `Whether the ${object} was deleted in GitHub.` }),\n );\n\nexport const ObjectRefSchema = Schema.Struct({ id: Long });\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Timestamp, readVersion } from \"./shared\";\n\nexport const CheckRunSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique check run ID.\" })),\n version: readVersion(\"check run\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the check run.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the check run belongs to.\" }),\n ),\n head_sha: Schema.String.pipe(\n Schema.annotateKey({ description: \"SHA of the commit the check ran on.\" }),\n ),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"Check name.\" })),\n status: Schema.String.pipe(\n Schema.annotateKey({ description: \"Status, such as queued, in_progress, or completed.\" }),\n ),\n conclusion: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Result of a completed check, such as success or failure.\" }),\n ),\n started_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the check started.\" }),\n ),\n completed_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the check completed.\" }),\n ),\n app: Schema.NullOr(\n Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"GitHub App ID.\" })),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"GitHub App name.\" })),\n }),\n ).pipe(\n Schema.annotateKey({\n description: \"GitHub App that created the check, such as GitHub Actions.\",\n }),\n ),\n check_suite: Schema.NullOr(\n Schema.Struct({ id: Long.pipe(Schema.annotateKey({ description: \"Check suite ID.\" })) }),\n ).pipe(Schema.annotateKey({ description: \"Check suite the check run belongs to.\" })),\n output: Schema.Struct({\n title: Schema.NullOr(Schema.String).pipe(Schema.annotateKey({ description: \"Output title.\" })),\n summary: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Output summary in Markdown.\" }),\n ),\n }).pipe(Schema.annotateKey({ description: \"Output the check reported.\" })),\n external_id: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"ID the app gave the check.\" }),\n ),\n details_url: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Details page from the app.\" }),\n ),\n html_url: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Check run page on GitHub.\" }),\n ),\n})\n .annotate({\n description:\n \"Check runs, such as GitHub Actions jobs. Polled for default-branch commits; webhooks cover all branches.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type CheckRun = Schema.Schema.Type<typeof CheckRunSchema>;\n\nexport const CheckRunObjectSchema = CheckRunSchema.mapFields((fields) =>\n Struct.omit(fields, [\"version\", \"repository_id\"]),\n);\n\nexport type CheckRunObject = Schema.Schema.Type<typeof CheckRunObjectSchema>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Text, Timestamp, deleted, user, version } from \"./shared\";\n\nexport const IssueCommentSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique comment ID.\" })),\n version: version(\"comment\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the comment.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the comment belongs to.\" }),\n ),\n issue_number: Long.pipe(\n Schema.annotateKey({\n description: \"Number of the issue or pull request the comment is on, in its repository.\",\n }),\n ),\n user: Schema.NullOr(user).pipe(\n Schema.annotateKey({ description: \"Account that wrote the comment.\" }),\n ),\n author_association: Schema.String.pipe(\n Schema.annotateKey({\n description: \"Author's relation to the repository, such as OWNER or CONTRIBUTOR.\",\n }),\n ),\n body: Text.pipe(Schema.annotateKey({ description: \"Comment in Markdown. Empty when not set.\" })),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the comment was written.\" })),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Comment on GitHub.\" })),\n _deleted: deleted(\"comment\"),\n})\n .annotate({\n description:\n \"Comments on issues and pull requests. Pull request review comments are not included.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type IssueComment = Schema.Schema.Type<typeof IssueCommentSchema>;\n\nexport const IssueCommentObjectSchema = IssueCommentSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"issue_number\", \"_deleted\"]),\n updated_at: Timestamp,\n // The list has no issue number, only this URL, which ends in it.\n issue_url: Schema.String.check(Schema.isPattern(/\\/issues\\/\\d+$/)),\n}));\n\nexport type IssueCommentObject = Schema.Schema.Type<typeof IssueCommentObjectSchema>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport {\n Long,\n Text,\n Timestamp,\n deleted,\n label,\n milestone,\n optionalList,\n user,\n version,\n} from \"./shared\";\n\nexport const IssueSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique issue ID.\" })),\n version: version(\"issue\"),\n node_id: Schema.String.pipe(Schema.annotateKey({ description: \"GraphQL node ID of the issue.\" })),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the issue belongs to.\" }),\n ),\n number: Long.pipe(Schema.annotateKey({ description: \"Issue number in the repository.\" })),\n title: Schema.String.pipe(Schema.annotateKey({ description: \"Issue title.\" })),\n body: Text.pipe(\n Schema.annotateKey({ description: \"Issue description in Markdown. Empty when not set.\" }),\n ),\n state: Schema.String.pipe(Schema.annotateKey({ description: \"State: open or closed.\" })),\n state_reason: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({\n description: \"Why the issue was closed or reopened, such as completed or not_planned.\",\n }),\n ),\n locked: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the conversation is locked.\" }),\n ),\n user: Schema.NullOr(user).pipe(\n Schema.annotateKey({ description: \"Account that opened the issue.\" }),\n ),\n author_association: Schema.String.pipe(\n Schema.annotateKey({\n description: \"Author's relation to the repository, such as OWNER or CONTRIBUTOR.\",\n }),\n ),\n labels: Schema.Array(label).pipe(Schema.annotateKey({ description: \"Labels on the issue.\" })),\n assignees: Schema.Array(user).pipe(\n Schema.annotateKey({ description: \"Accounts assigned to the issue.\" }),\n ),\n milestone: Schema.NullOr(milestone).pipe(\n Schema.annotateKey({ description: \"Milestone of the issue.\" }),\n ),\n comments: Long.pipe(Schema.annotateKey({ description: \"Number of comments.\" })),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the issue was opened.\" })),\n closed_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the issue was closed. Null while it is open.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Issue page on GitHub.\" })),\n _deleted: deleted(\"issue\"),\n})\n .annotate({\n description: \"Issues in the installation's repositories. Pull requests are not included.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type Issue = Schema.Schema.Type<typeof IssueSchema>;\n\nexport const IssueObjectSchema = IssueSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"labels\", \"assignees\", \"_deleted\"]),\n updated_at: Timestamp,\n labels: optionalList(label),\n assignees: optionalList(user),\n // Set on pull requests, which the issues list also returns.\n pull_request: Schema.optionalKey(Schema.Unknown),\n}));\n\nexport type IssueObject = Schema.Schema.Type<typeof IssueObjectSchema>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Timestamp, deleted, user, version } from \"./shared\";\n\nexport const PullRequestReviewCommentSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique review comment ID.\" })),\n version: version(\"review comment\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the review comment.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the comment belongs to.\" }),\n ),\n pull_request_number: Long.pipe(\n Schema.annotateKey({\n description: \"Number of the pull request the comment is on, in its repository.\",\n }),\n ),\n pull_request_review_id: Schema.NullOr(Long).pipe(\n Schema.annotateKey({ description: \"ID of the review the comment belongs to.\" }),\n ),\n in_reply_to_id: Schema.optionalKey(Long).pipe(\n Schema.annotateKey({ description: \"ID of the comment this one replies to.\" }),\n ),\n user: Schema.NullOr(user).pipe(\n Schema.annotateKey({ description: \"Account that wrote the comment.\" }),\n ),\n author_association: Schema.String.pipe(\n Schema.annotateKey({\n description: \"Author's relation to the repository, such as OWNER or CONTRIBUTOR.\",\n }),\n ),\n body: Schema.String.pipe(Schema.annotateKey({ description: \"Comment in Markdown.\" })),\n path: Schema.String.pipe(\n Schema.annotateKey({ description: \"Path of the file the comment is on.\" }),\n ),\n commit_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"SHA of the commit the comment is on now.\" }),\n ),\n original_commit_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"SHA of the commit the comment was written on.\" }),\n ),\n diff_hunk: Schema.String.pipe(\n Schema.annotateKey({ description: \"Part of the diff the comment is on.\" }),\n ),\n // GitHub sends null for a comment on a line that is no longer in the diff.\n line: Schema.optionalKey(Schema.NullOr(Long)).pipe(\n Schema.annotateKey({ description: \"Last line of the commented range in the current diff.\" }),\n ),\n original_line: Schema.optionalKey(Schema.NullOr(Long)).pipe(\n Schema.annotateKey({ description: \"Last line of the commented range in the original diff.\" }),\n ),\n start_line: Schema.optionalKey(Schema.NullOr(Long)).pipe(\n Schema.annotateKey({ description: \"First line of a multi-line comment.\" }),\n ),\n side: Schema.optionalKey(Schema.NullOr(Schema.String)).pipe(\n Schema.annotateKey({ description: \"Side of the diff: LEFT or RIGHT.\" }),\n ),\n subject_type: Schema.optionalKey(Schema.String).pipe(\n Schema.annotateKey({ description: \"What the comment is on: line or file.\" }),\n ),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the comment was written.\" })),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Comment on GitHub.\" })),\n _deleted: deleted(\"review comment\"),\n})\n .annotate({\n description: \"Review comments on pull request diffs.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type PullRequestReviewComment = Schema.Schema.Type<typeof PullRequestReviewCommentSchema>;\n\nexport const PullRequestReviewCommentObjectSchema = PullRequestReviewCommentSchema.mapFields(\n (fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"pull_request_number\", \"_deleted\"]),\n updated_at: Timestamp,\n // The list has no pull request number, only this URL, which ends in it.\n pull_request_url: Schema.String.check(Schema.isPattern(/\\/pulls\\/\\d+$/)),\n }),\n);\n\nexport type PullRequestReviewCommentObject = Schema.Schema.Type<\n typeof PullRequestReviewCommentObjectSchema\n>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Text, Timestamp, label, milestone, optionalList, user, version } from \"./shared\";\n\nconst branch = Schema.Struct({\n ref: Schema.String.pipe(Schema.annotateKey({ description: \"Branch name.\" })),\n sha: Schema.String.pipe(Schema.annotateKey({ description: \"Commit SHA.\" })),\n label: Schema.String.pipe(\n Schema.annotateKey({ description: \"Owner and branch, such as octocat:main.\" }),\n ),\n});\n\nexport const PullRequestSchema = Schema.Struct({\n id: Long.pipe(\n Schema.annotateKey({ description: \"Unique pull request ID. Not the ID of its issue.\" }),\n ),\n version: version(\"pull request\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the pull request.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the pull request belongs to.\" }),\n ),\n number: Long.pipe(Schema.annotateKey({ description: \"Pull request number in the repository.\" })),\n title: Schema.String.pipe(Schema.annotateKey({ description: \"Pull request title.\" })),\n body: Text.pipe(\n Schema.annotateKey({\n description: \"Pull request description in Markdown. Empty when not set.\",\n }),\n ),\n state: Schema.String.pipe(\n Schema.annotateKey({ description: \"State: open or closed. Merged pull requests are closed.\" }),\n ),\n draft: Schema.optionalKey(Schema.Boolean).pipe(\n Schema.annotateKey({ description: \"Whether the pull request is a draft.\" }),\n ),\n locked: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the conversation is locked.\" }),\n ),\n user: Schema.NullOr(user).pipe(\n Schema.annotateKey({ description: \"Account that opened the pull request.\" }),\n ),\n author_association: Schema.String.pipe(\n Schema.annotateKey({\n description: \"Author's relation to the repository, such as OWNER or CONTRIBUTOR.\",\n }),\n ),\n labels: Schema.Array(label).pipe(\n Schema.annotateKey({ description: \"Labels on the pull request.\" }),\n ),\n assignees: Schema.Array(user).pipe(\n Schema.annotateKey({ description: \"Accounts assigned to the pull request.\" }),\n ),\n requested_reviewers: Schema.Array(user).pipe(\n Schema.annotateKey({ description: \"Accounts asked to review that have not reviewed yet.\" }),\n ),\n milestone: Schema.NullOr(milestone).pipe(\n Schema.annotateKey({ description: \"Milestone of the pull request.\" }),\n ),\n head: branch.pipe(Schema.annotateKey({ description: \"Branch the changes come from.\" })),\n base: branch.pipe(Schema.annotateKey({ description: \"Branch the changes merge into.\" })),\n created_at: Timestamp.pipe(\n Schema.annotateKey({ description: \"Time the pull request was opened.\" }),\n ),\n closed_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the pull request was closed. Null while it is open.\" }),\n ),\n merged_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the pull request was merged.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Pull request page on GitHub.\" })),\n})\n .annotate({\n description: \"Pull requests in the installation's repositories.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type PullRequest = Schema.Schema.Type<typeof PullRequestSchema>;\n\nexport const PullRequestObjectSchema = PullRequestSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\n \"version\",\n \"repository_id\",\n \"labels\",\n \"assignees\",\n \"requested_reviewers\",\n ]),\n updated_at: Timestamp,\n labels: optionalList(label),\n assignees: optionalList(user),\n requested_reviewers: optionalList(user),\n}));\n\nexport type PullRequestObject = Schema.Schema.Type<typeof PullRequestObjectSchema>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Text, Timestamp, deleted, user, version } from \"./shared\";\n\nconst asset = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Asset ID.\" })),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"File name.\" })),\n label: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Label shown instead of the name.\" }),\n ),\n state: Schema.String.pipe(Schema.annotateKey({ description: \"State: uploaded or open.\" })),\n content_type: Schema.String.pipe(Schema.annotateKey({ description: \"Media type of the file.\" })),\n size: Long.pipe(Schema.annotateKey({ description: \"Size in bytes.\" })),\n download_count: Long.pipe(\n Schema.annotateKey({ description: \"Number of downloads when the release last changed.\" }),\n ),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the asset was uploaded.\" })),\n updated_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the asset last changed.\" })),\n browser_download_url: Schema.String.pipe(Schema.annotateKey({ description: \"Download link.\" })),\n});\n\nexport const ReleaseSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique release ID.\" })),\n version: version(\"release\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the release.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the release belongs to.\" }),\n ),\n tag_name: Schema.String.pipe(Schema.annotateKey({ description: \"Tag of the release.\" })),\n target_commitish: Schema.String.pipe(\n Schema.annotateKey({ description: \"Branch or commit the tag was created from.\" }),\n ),\n name: Text.pipe(Schema.annotateKey({ description: \"Release title. Empty when not set.\" })),\n body: Text.pipe(\n Schema.annotateKey({ description: \"Release notes in Markdown. Empty when not set.\" }),\n ),\n draft: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the release is a draft.\" }),\n ),\n prerelease: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the release is a pre-release.\" }),\n ),\n author: user.pipe(Schema.annotateKey({ description: \"Account that created the release.\" })),\n assets: Schema.Array(asset).pipe(\n Schema.annotateKey({ description: \"Files attached to the release.\" }),\n ),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the release was created.\" })),\n published_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the release was published.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Release page on GitHub.\" })),\n _deleted: deleted(\"release\"),\n})\n .annotate({\n description: \"Releases in the installation's repositories, with their assets.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type Release = Schema.Schema.Type<typeof ReleaseSchema>;\n\nexport const ReleaseObjectSchema = ReleaseSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"_deleted\"]),\n // Not always set, according to the API schema.\n updated_at: Schema.optionalKey(Schema.NullOr(Timestamp)),\n}));\n\nexport type ReleaseObject = Schema.Schema.Type<typeof ReleaseObjectSchema>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema, Struct } from \"effect\";\n\nimport { Long, Text, Timestamp, deleted, optionalList, user, version } from \"./shared\";\n\nexport const RepositorySchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique repository ID.\" })),\n version: version(\"repository\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the repository.\" }),\n ),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"Repository name.\" })),\n full_name: Schema.String.pipe(\n Schema.annotateKey({ description: \"Owner and name, such as octo-org/octo-repo.\" }),\n ),\n owner: user.pipe(Schema.annotateKey({ description: \"Account that owns the repository.\" })),\n private: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the repository is private.\" }),\n ),\n visibility: Schema.optionalKey(Schema.String).pipe(\n Schema.annotateKey({ description: \"Visibility: public, private, or internal.\" }),\n ),\n description: Text.pipe(\n Schema.annotateKey({ description: \"Repository description. Empty when not set.\" }),\n ),\n fork: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the repository is a fork.\" }),\n ),\n archived: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the repository is archived.\" }),\n ),\n disabled: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether the repository is disabled.\" }),\n ),\n default_branch: Schema.String.pipe(Schema.annotateKey({ description: \"Default branch name.\" })),\n language: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Main language GitHub detected.\" }),\n ),\n topics: Schema.Array(Schema.String).pipe(\n Schema.annotateKey({ description: \"Repository topics.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Repository page on GitHub.\" })),\n created_at: Timestamp.pipe(\n Schema.annotateKey({ description: \"Time the repository was created.\" }),\n ),\n _deleted: deleted(\"repository\"),\n})\n .annotate({\n description: \"Repositories the GitHub App installation can read.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type Repository = Schema.Schema.Type<typeof RepositorySchema>;\n\nexport const RepositoryObjectSchema = RepositorySchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"topics\", \"_deleted\"]),\n updated_at: Timestamp,\n topics: optionalList(Schema.String),\n}));\n\nexport type RepositoryObject = Schema.Schema.Type<typeof RepositoryObjectSchema>;\n\nexport const RepositoryRefSchema = Schema.Struct({\n id: Schema.Number,\n full_name: Schema.String,\n has_issues: Schema.Boolean,\n // GitHub documents it as optional, defaulting to true.\n has_pull_requests: Schema.Boolean.pipe(Schema.withDecodingDefaultKey(Effect.succeed(true))),\n // In KB. An empty repository has 0, and its git lists return 409.\n size: Schema.Number,\n});\n\nexport type RepositoryRef = Schema.Schema.Type<typeof RepositoryRefSchema>;\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Timestamp, user, version } from \"./shared\";\n\nexport const WorkflowRunSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique workflow run ID.\" })),\n version: version(\"workflow run\"),\n node_id: Schema.String.pipe(Schema.annotateKey({ description: \"GraphQL node ID of the run.\" })),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the run belongs to.\" }),\n ),\n workflow_id: Long.pipe(Schema.annotateKey({ description: \"ID of the workflow.\" })),\n name: Schema.NullOr(Schema.String).pipe(Schema.annotateKey({ description: \"Workflow name.\" })),\n display_title: Schema.String.pipe(\n Schema.annotateKey({ description: \"Title of the run, such as the commit message.\" }),\n ),\n path: Schema.String.pipe(Schema.annotateKey({ description: \"Path of the workflow file.\" })),\n event: Schema.String.pipe(\n Schema.annotateKey({ description: \"Event that started the run, such as push.\" }),\n ),\n status: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Status, such as queued, in_progress, or completed.\" }),\n ),\n conclusion: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Result of a completed run, such as success or failure.\" }),\n ),\n head_branch: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Branch the run is for.\" }),\n ),\n head_sha: Schema.String.pipe(\n Schema.annotateKey({ description: \"SHA of the commit the run is for.\" }),\n ),\n run_number: Long.pipe(Schema.annotateKey({ description: \"Run number of the workflow.\" })),\n run_attempt: Schema.optionalKey(Long).pipe(\n Schema.annotateKey({ description: \"Attempt number. Re-runs count up.\" }),\n ),\n check_suite_id: Schema.optionalKey(Long).pipe(\n Schema.annotateKey({ description: \"ID of the run's check suite.\" }),\n ),\n actor: Schema.optionalKey(user).pipe(\n Schema.annotateKey({ description: \"Account that started the first attempt.\" }),\n ),\n triggering_actor: Schema.optionalKey(user).pipe(\n Schema.annotateKey({ description: \"Account that started the latest attempt.\" }),\n ),\n pull_requests: Schema.Array(\n Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Pull request ID.\" })),\n number: Long.pipe(Schema.annotateKey({ description: \"Pull request number.\" })),\n }),\n ).pipe(Schema.annotateKey({ description: \"Pull requests the run is for. Empty for forks.\" })),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the run was created.\" })),\n run_started_at: Schema.optionalKey(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the latest attempt started.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Run page on GitHub.\" })),\n})\n .annotate({\n description: \"GitHub Actions workflow runs in the installation's repositories.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type WorkflowRun = Schema.Schema.Type<typeof WorkflowRunSchema>;\n\nexport const WorkflowRunObjectSchema = WorkflowRunSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"pull_requests\"]),\n updated_at: Timestamp,\n pull_requests: Schema.NullOr(fields.pull_requests),\n}));\n\nexport type WorkflowRunObject = Schema.Schema.Type<typeof WorkflowRunObjectSchema>;\n","import { Schema, Struct } from \"effect\";\n\nimport { IssueCommentObjectSchema } from \"./issue-comments\";\nimport { IssueObjectSchema } from \"./issues\";\nimport { PullRequestReviewCommentObjectSchema } from \"./pull-request-review-comments\";\nimport { PullRequestObjectSchema } from \"./pull-requests\";\nimport { ReleaseObjectSchema } from \"./releases\";\nimport { RepositoryObjectSchema } from \"./repositories\";\nimport { Long, ObjectRefSchema, Timestamp } from \"./shared\";\nimport { WorkflowRunObjectSchema } from \"./workflow-runs\";\n\n/**\n * The webhook route passes the payload on as it is. GitHub puts the event name\n * in a header, so each resource decodes its own event.\n */\nexport const WebhookPayloadSchema = Schema.Record(Schema.String, Schema.Unknown);\n\nexport type WebhookPayload = Schema.Schema.Type<typeof WebhookPayloadSchema>;\n\nexport const InstallationEventSchema = Schema.Struct({\n installation: Schema.optional(Schema.Struct({ id: Schema.Number })),\n});\n\n/** For handlers that read the API again. */\nconst RepositoryNameSchema = Schema.Struct({ id: Long, full_name: Schema.String });\n\n/** A transferred issue no longer exists in its old repository. */\nexport const IssueRemovedEventSchema = Schema.Struct({\n action: Schema.Literals([\"deleted\", \"transferred\"]),\n issue: ObjectRefSchema,\n});\n\nexport const IssuesEventSchema = Schema.Union([\n IssueRemovedEventSchema,\n Schema.Struct({\n action: Schema.String,\n repository: RepositoryNameSchema,\n issue: IssueObjectSchema,\n }),\n]);\n\nexport const IssueCommentDeletedEventSchema = Schema.Struct({\n action: Schema.Literal(\"deleted\"),\n comment: ObjectRefSchema,\n});\n\nexport const IssueCommentEventSchema = Schema.Union([\n IssueCommentDeletedEventSchema,\n Schema.Struct({\n action: Schema.String,\n repository: ObjectRefSchema,\n comment: IssueCommentObjectSchema,\n }),\n]);\n\nexport const PullRequestReviewCommentDeletedEventSchema = Schema.Struct({\n action: Schema.Literal(\"deleted\"),\n comment: ObjectRefSchema,\n});\n\nexport const PullRequestReviewCommentEventSchema = Schema.Union([\n PullRequestReviewCommentDeletedEventSchema,\n Schema.Struct({\n action: Schema.String,\n repository: ObjectRefSchema,\n comment: PullRequestReviewCommentObjectSchema,\n }),\n]);\n\nexport const PullRequestEventSchema = Schema.Struct({\n repository: RepositoryNameSchema,\n pull_request: PullRequestObjectSchema,\n});\n\nexport const RepositoryDeletedEventSchema = Schema.Struct({\n action: Schema.Literal(\"deleted\"),\n repository: ObjectRefSchema,\n});\n\nexport const RepositoryEventSchema = Schema.Union([\n RepositoryDeletedEventSchema,\n Schema.Struct({ action: Schema.String, repository: RepositoryObjectSchema }),\n]);\n\nexport const ReleaseDeletedEventSchema = Schema.Struct({\n action: Schema.Literal(\"deleted\"),\n release: ObjectRefSchema,\n});\n\nexport const ReleaseEventSchema = Schema.Union([\n ReleaseDeletedEventSchema,\n Schema.Struct({\n action: Schema.String,\n repository: ObjectRefSchema,\n release: ReleaseObjectSchema,\n }),\n]);\n\nexport const WorkflowRunEventSchema = Schema.Struct({\n repository: ObjectRefSchema,\n workflow_run: WorkflowRunObjectSchema,\n});\n\nexport const PushEventSchema = Schema.Struct({\n ref: Schema.String,\n before: Schema.String,\n after: Schema.String,\n repository: RepositoryNameSchema.mapFields(Struct.assign({ default_branch: Schema.String })),\n});\n\nexport const PullRequestReviewEventSchema = Schema.Struct({\n repository: RepositoryNameSchema,\n pull_request: Schema.Struct({ number: Long }),\n review: ObjectRefSchema,\n});\n\nexport const PullRequestCommitsEventSchema = Schema.Struct({\n action: Schema.String,\n changes: Schema.optionalKey(Schema.Struct({ base: Schema.optionalKey(Schema.Unknown) })),\n repository: RepositoryNameSchema,\n pull_request: Schema.Struct({ number: Long, updated_at: Timestamp }),\n});\n\nexport const CheckRunEventSchema = Schema.Struct({\n repository: RepositoryNameSchema,\n check_run: ObjectRefSchema,\n});\n\nexport const WorkflowJobEventSchema = Schema.Struct({\n repository: RepositoryNameSchema,\n workflow_job: ObjectRefSchema,\n});\n\n/** The status payload is flat. */\nexport const StatusEventSchema = Schema.Struct({\n id: Long,\n sha: Schema.String,\n repository: RepositoryNameSchema,\n});\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, SchemaTransformation } from \"effect\";\n\nimport { Long, Timestamp, user } from \"./shared\";\n\nexport const gitActor = Schema.Struct({\n name: Schema.String.pipe(Schema.annotateKey({ description: \"Name in the commit.\" })),\n date: Timestamp.pipe(Schema.annotateKey({ description: \"Time in the commit.\" })),\n});\n\n/**\n * The GitHub account of a commit's author or committer. GitHub sends `null` or\n * `{}` when the email matches no account, and both become `null`.\n */\nexport const account = Schema.NullOr(Schema.Union([user, Schema.Struct({})])).pipe(\n Schema.decodeTo(\n Schema.NullOr(Schema.toType(user)),\n SchemaTransformation.transform({\n decode: (value) => (value !== null && \"id\" in value ? value : null),\n encode: (value) => value,\n }),\n ),\n);\n\nexport const CommitSchema = Schema.Struct({\n key: Schema.String.pipe(\n Schema.annotateKey({ description: \"Repository ID and SHA, such as `1406396726:9eb3a7d`.\" }),\n ),\n version: Schema.Date.pipe(\n Schema.annotateKey({ description: \"Commit time. A commit never changes.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the commit is in.\" }),\n ),\n sha: Schema.String.pipe(Schema.annotateKey({ description: \"Commit SHA.\" })),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the commit.\" }),\n ),\n message: Schema.String.pipe(Schema.annotateKey({ description: \"Commit message.\" })),\n author: gitActor.pipe(\n Schema.annotateKey({ description: \"Author name and time from the commit.\" }),\n ),\n committer: gitActor.pipe(\n Schema.annotateKey({ description: \"Committer name and time from the commit.\" }),\n ),\n author_user: account.pipe(Schema.annotateKey({ description: \"GitHub account of the author.\" })),\n committer_user: account.pipe(\n Schema.annotateKey({ description: \"GitHub account of the committer.\" }),\n ),\n parents: Schema.Array(Schema.String).pipe(\n Schema.annotateKey({ description: \"SHAs of the parent commits.\" }),\n ),\n verified: Schema.Boolean.pipe(\n Schema.annotateKey({ description: \"Whether GitHub verified the commit signature.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Commit page on GitHub.\" })),\n})\n .annotate({\n description: \"Commits on the default branch of the installation's repositories.\",\n })\n .pipe(Iceberg.identifier(\"key\"));\n\nexport type Commit = Schema.Schema.Type<typeof CommitSchema>;\n\nexport const CommitObjectSchema = Schema.Struct({\n sha: Schema.String,\n node_id: Schema.String,\n commit: Schema.Struct({\n author: gitActor,\n committer: gitActor,\n message: Schema.String,\n verification: Schema.optionalKey(Schema.Struct({ verified: Schema.Boolean })),\n }),\n author: account,\n committer: account,\n parents: Schema.Array(Schema.Struct({ sha: Schema.String })),\n html_url: Schema.String,\n});\n\nexport type CommitObject = Schema.Schema.Type<typeof CommitObjectSchema>;\n","import { ConnectorError, Cursor, Fetch } from \"@useairfoil/connector-kit\";\nimport {\n Array as Arr,\n DateTime,\n Duration,\n Effect,\n Exit,\n Option,\n Order,\n Schema,\n SchemaTransformation,\n Stream,\n} from \"effect\";\n\nimport { type GitHubClientService, withParams } from \"../client/client\";\nimport { type RepositoryRef, RepositoryRefSchema } from \"../schemas/repositories\";\n\ntype Timestamps = { readonly created_at: Date; readonly updated_at: Date };\n\nexport const timestamps = {\n createdAt: (item: Timestamps) => item.created_at,\n updatedAt: (item: Timestamps) => item.updated_at,\n};\n\nexport type DeleteRow = {\n readonly id: bigint;\n readonly version: Date;\n readonly _deleted: true;\n};\n\nexport const pageSize = \"100\";\nexport const changesInterval = Duration.minutes(15);\n// A run stops after this many pages and the next one starts right away.\nconst maxChangesPagesPerRun = 20;\n// Updates can show up in a list late, so each changes read starts a bit early.\nconst changesOverlap = Duration.minutes(5);\nconst repositoryListTtl = Duration.minutes(5);\n\nexport const installationRepositoriesPath = \"/installation/repositories\";\n\nexport const repositoryPage = <A>(item: Schema.Decoder<A>) =>\n Schema.Struct({ repositories: Schema.Array(item) });\n\n/** Some lists wrap their items, such as `{ total_count, workflow_runs: [...] }`. */\nexport const wrappedList = <A>(\n key: string,\n item: Schema.Decoder<A>,\n): Schema.Decoder<ReadonlyArray<A>> =>\n Schema.Struct({ [key]: Schema.Array(item) }).pipe(\n Schema.decodeTo(\n Schema.Array(Schema.toType(item)),\n SchemaTransformation.transform({\n decode: (page) => page[key],\n encode: (items) => ({ [key]: items }),\n }),\n ),\n );\n\nexport const readPages = <A>(\n client: GitHubClientService,\n pageSchema: Schema.Decoder<ReadonlyArray<A>>,\n url: string,\n keepGoing: (items: ReadonlyArray<A>) => boolean = () => true,\n): Effect.Effect<ReadonlyArray<A>, ConnectorError> =>\n Stream.paginate(url, (current) =>\n client\n .get(pageSchema, current)\n .pipe(\n Effect.map(\n (page) => [page.body, keepGoing(page.body) ? page.next : Option.none()] as const,\n ),\n ),\n ).pipe(Stream.runCollect);\n\n/** Every repository the installation can read, ordered by ID. */\nexport const listRepositories = <A extends { readonly id: number | bigint }>(\n client: GitHubClientService,\n schema: Schema.Decoder<A>,\n): Effect.Effect<ReadonlyArray<A>, ConnectorError> =>\n readPages(\n client,\n wrappedList(\"repositories\", schema),\n withParams(installationRepositoriesPath, { per_page: pageSize }),\n ).pipe(\n Effect.map(Arr.sort(Order.mapInput(Order.Number, (repository: A) => Number(repository.id)))),\n );\n\nexport const cachedRepositoryRefs = (client: GitHubClientService) =>\n listRepositories(client, RepositoryRefSchema).pipe(\n Effect.cachedWithTTL((exit) => (Exit.isSuccess(exit) ? repositoryListTtl : 0)),\n );\n\n/**\n * `since` is when the last run started, and `repositoryIds` are the\n * repositories it read. Any other repository is new and is read from the start.\n * `pending` is set while a run is split.\n */\nconst ChangesCursorSchema = Schema.Struct({\n since: Schema.DateTimeUtcFromString,\n repositoryIds: Schema.optional(Schema.Array(Schema.Number)),\n pending: Schema.optional(\n Schema.Struct({\n until: Schema.DateTimeUtcFromString,\n repositoryIds: Schema.Array(Schema.Number),\n repositoryId: Schema.Number,\n url: Schema.optional(Schema.String),\n }),\n ),\n});\n\ntype ChangesCursor = Schema.Schema.Type<typeof ChangesCursorSchema>;\n\nconst ChangesCursorCodec = Schema.Union([\n Schema.fromJsonString(ChangesCursorSchema),\n // The first cursor is the backfill cutoff, a plain ISO time. Every repository\n // the installation has then counts as read.\n Schema.DateTimeUtcFromString.pipe(\n Schema.decodeTo(\n Schema.toType(ChangesCursorSchema),\n SchemaTransformation.transform({\n decode: (since): ChangesCursor => ({ since }),\n encode: (cursor) => cursor.since,\n }),\n ),\n ),\n]);\n\nconst cursorError = (cause: Schema.SchemaError) =>\n new ConnectorError({ message: \"Invalid GitHub cursor\", cause });\n\nconst decodeChangesCursor = (value: string) =>\n Schema.decodeUnknownEffect(ChangesCursorCodec)(value).pipe(Effect.mapError(cursorError));\n\nconst encodeChangesCursor = (cursor: ChangesCursor) =>\n Schema.encodeEffect(Schema.fromJsonString(ChangesCursorSchema))(cursor).pipe(\n Effect.mapError(cursorError),\n );\n\n/** When to read a repository's changes from. None means from the start. */\nconst readFrom = (state: ChangesCursor, repositoryId: number): Option.Option<Date> =>\n state.repositoryIds === undefined || state.repositoryIds.includes(repositoryId)\n ? Option.some(DateTime.toDateUtc(DateTime.subtractDuration(state.since, changesOverlap)))\n : Option.none();\n\nexport const isSince = (time: Option.Option<Date>, date: Date) =>\n Option.match(time, { onNone: () => true, onSome: (since) => date.getTime() >= since.getTime() });\n\nexport const readChanges = <A extends { readonly id: number | bigint }, Row>(\n cursor: string,\n repositories: Effect.Effect<ReadonlyArray<A>, ConnectorError>,\n toRows: (\n repositories: ReadonlyArray<{ readonly repository: A; readonly since: Option.Option<Date> }>,\n ) => ReadonlyArray<Row>,\n) =>\n Effect.gen(function* () {\n const state = yield* decodeChangesCursor(cursor);\n const runStart = yield* DateTime.now;\n const listed = yield* repositories;\n return {\n rows: toRows(\n listed.map((repository) => ({\n repository,\n since: readFrom(state, Number(repository.id)),\n })),\n ),\n cursor: yield* encodeChangesCursor({\n since: runStart,\n repositoryIds: listed.map((repository) => Number(repository.id)),\n }),\n };\n });\n\nexport type RepoResourceSpec<Item, Row extends object> = {\n readonly path: string;\n readonly pageSchema: Schema.Decoder<ReadonlyArray<Item>>;\n readonly params: Readonly<Record<string, string>>;\n /** Whether the list takes `since`. */\n readonly since: boolean;\n /**\n * `sorted` lists take `sort` and `direction`, so changes stop at the first\n * older item. `newest` lists come newest first, so backfill reads every page.\n */\n readonly order: \"sorted\" | \"newest\";\n /**\n * On a `newest` list, changes stop at the first page created this long\n * before `since`. Without it, they read every page.\n */\n readonly recentFor?: Duration.Duration;\n readonly createdAt: (item: Item) => Date;\n readonly updatedAt: (item: Item) => Date;\n /** Items the resource keeps. The issues list also returns pull requests. */\n readonly keep: (item: Item) => boolean;\n /** GitHub returns 404 for pull requests and comments when the feature is off. */\n readonly enabled: (repository: RepositoryRef) => boolean;\n /** Rows for one page. A child resource reads its children here. */\n readonly rows: (\n items: ReadonlyArray<Item>,\n repository: RepositoryRef,\n ) => Effect.Effect<ReadonlyArray<Row>, ConnectorError>;\n};\n\nexport const rowsOf =\n <Item, Row>(toRow: (item: Item, repositoryId: bigint) => Row) =>\n (items: ReadonlyArray<Item>, repository: RepositoryRef) =>\n Effect.succeed(items.map((item) => toRow(item, BigInt(repository.id))));\n\nexport const repoPath = (repository: RepositoryRef, path: string) =>\n `/repos/${repository.full_name}/${path}`;\n\n/**\n * `rows` for a child resource, such as reviews of pull requests. Parents are\n * read one at a time, as GitHub asks. `readAt` is the version for children\n * without an update time.\n */\nexport const childRows =\n <Parent, Child, Row>(\n client: GitHubClientService,\n child: {\n readonly path: (parent: Parent) => string;\n readonly pageSchema: Schema.Decoder<ReadonlyArray<Child>>;\n readonly params?: Readonly<Record<string, string>>;\n readonly toRow: (child: Child, parent: Parent, repositoryId: bigint, readAt: Date) => Row;\n },\n ) =>\n (parents: ReadonlyArray<Parent>, repository: RepositoryRef) =>\n Effect.gen(function* () {\n const readAt = yield* DateTime.nowAsDate;\n const rows = yield* Effect.forEach(parents, (parent) =>\n readPages(\n client,\n child.pageSchema,\n withParams(repoPath(repository, child.path(parent)), {\n ...child.params,\n per_page: pageSize,\n }),\n ).pipe(\n Effect.map((children) =>\n children.map((item) => child.toRow(item, parent, BigInt(repository.id), readAt)),\n ),\n ),\n );\n return rows.flat();\n });\n\n/** Lists one item, then reads its rows, so a child resource checks its own call too. */\nexport const checkRepoResource = <Item, Row extends object>(\n client: GitHubClientService,\n spec: RepoResourceSpec<Item, Row>,\n): Effect.Effect<void, ConnectorError> =>\n Effect.gen(function* () {\n const page = yield* client.get(\n repositoryPage(RepositoryRefSchema),\n withParams(installationRepositoriesPath, { per_page: pageSize }),\n );\n // An installation without such a repository has nothing to check yet.\n const repository = Arr.findFirst(page.body.repositories, spec.enabled);\n if (Option.isSome(repository)) {\n const items = yield* client.get(\n spec.pageSchema,\n withParams(repoPath(repository.value, spec.path), { ...spec.params, per_page: \"1\" }),\n );\n yield* spec.rows(items.body.filter(spec.keep), repository.value);\n }\n });\n\nconst BackfillCursorSchema = Schema.fromJsonString(\n Schema.Struct({\n repositoryId: Schema.Number,\n next: Schema.optional(Schema.String),\n }),\n);\n\ntype BackfillCursor = Schema.Schema.Type<typeof BackfillCursorSchema>;\n\nconst decodeBackfillCursor = (value: string) =>\n Schema.decodeUnknownEffect(BackfillCursorSchema)(value).pipe(Effect.mapError(cursorError));\n\nconst encodeBackfillCursor = (cursor: BackfillCursor) =>\n Schema.encodeEffect(BackfillCursorSchema)(cursor).pipe(Effect.mapError(cursorError));\n\nexport const parseCutoff = (value: string): Date => DateTime.toDateUtc(DateTime.makeUnsafe(value));\n\n/**\n * Reads one repository at a time up to the cutoff, oldest first when the list\n * can sort. The cursor keeps the `next` URL, because the issues list pages\n * with a cursor.\n */\nexport const backfillRepoResource = <Item, Row extends object>(\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n spec: RepoResourceSpec<Item, Row>,\n) =>\n Fetch.page({\n pageCursor: Cursor.string(),\n cutoff: Cursor.isoDateTime(),\n fetch: ({ pageCursor, cutoff }) =>\n Effect.gen(function* () {\n const cutoffDate = parseCutoff(String(cutoff));\n const listed = (yield* repositories).filter(spec.enabled);\n const position =\n typeof pageCursor === \"string\"\n ? Option.some(yield* decodeBackfillCursor(pageCursor))\n : Option.none();\n // A repository removed from the installation is skipped.\n const repository = Option.match(position, {\n onNone: () => listed[0],\n onSome: ({ repositoryId }) => listed.find((item) => item.id >= repositoryId),\n });\n if (repository === undefined) return { rows: [], hasMore: false };\n\n const url = Option.flatMap(position, ({ repositoryId, next }) =>\n repositoryId === repository.id ? Option.fromNullishOr(next) : Option.none(),\n ).pipe(\n Option.getOrElse(() =>\n withParams(repoPath(repository, spec.path), {\n ...spec.params,\n ...(spec.order === \"sorted\" ? { sort: \"created\", direction: \"asc\" } : {}),\n per_page: pageSize,\n }),\n ),\n );\n const page = yield* client.get(spec.pageSchema, url);\n const beforeCutoff = page.body.filter(\n (item) => spec.createdAt(item).getTime() <= cutoffDate.getTime(),\n );\n const rows = yield* spec.rows(beforeCutoff.filter(spec.keep), repository);\n // A sorted list is past the cutoff at the first newer item.\n const pastCutoff = spec.order === \"sorted\" && beforeCutoff.length < page.body.length;\n\n if (!pastCutoff && Option.isSome(page.next)) {\n return {\n rows,\n nextPageCursor: yield* encodeBackfillCursor({\n repositoryId: repository.id,\n next: page.next.value,\n }),\n hasMore: true,\n };\n }\n const following = listed.find((item) => item.id > repository.id);\n if (following === undefined) return { rows, hasMore: false };\n return {\n rows,\n nextPageCursor: yield* encodeBackfillCursor({ repositoryId: following.id }),\n hasMore: true,\n };\n }),\n });\n\ntype ChangesPage<Row> = {\n readonly repository: RepositoryRef;\n readonly rows: ReadonlyArray<Row>;\n readonly next: Option.Option<string>;\n};\n\n/**\n * One repository's changes, newest first, so an edit during the read repeats a\n * row instead of skipping one.\n */\nconst changesPages = <Item, Row extends object>(\n client: GitHubClientService,\n spec: RepoResourceSpec<Item, Row>,\n repository: RepositoryRef,\n since: Option.Option<Date>,\n url: Option.Option<string>,\n): Stream.Stream<ChangesPage<Row>, ConnectorError> => {\n const first = withParams(repoPath(repository, spec.path), {\n ...spec.params,\n ...(spec.order === \"sorted\" ? { sort: \"updated\", direction: \"desc\" } : {}),\n per_page: pageSize,\n // Never send an old `since` to mean everything: GitHub then returns nothing.\n ...(spec.since && Option.isSome(since) ? { since: since.value.toISOString() } : {}),\n });\n const isRecent = (item: Item) => isSince(since, spec.updatedAt(item));\n const { order, recentFor } = spec;\n const createdFrom = Option.map(since, (date) =>\n DateTime.toDateUtc(\n DateTime.subtractDuration(DateTime.fromDateUnsafe(date), recentFor ?? Duration.zero),\n ),\n );\n const goOn = (items: ReadonlyArray<Item>) => {\n if (order === \"sorted\") return items.every(isRecent);\n if (recentFor === undefined) return true;\n return items.every((item) => isSince(createdFrom, spec.createdAt(item)));\n };\n return Stream.paginate(\n Option.getOrElse(url, () => first),\n (current) =>\n Effect.gen(function* () {\n const page = yield* client.get(spec.pageSchema, current);\n const next = goOn(page.body) ? page.next : Option.none();\n const rows = yield* spec.rows(\n page.body.filter((item) => isRecent(item) && spec.keep(item)),\n repository,\n );\n return [[{ repository, rows, next }], next] as const;\n }),\n );\n};\n\nexport const changesRepoResource = <Item, Row extends object>(\n client: GitHubClientService,\n spec: RepoResourceSpec<Item, Row>,\n) =>\n Fetch.changes({\n cursor: Cursor.string(),\n interval: changesInterval,\n fetch: ({ cursor }) =>\n Effect.gen(function* () {\n const state = yield* decodeChangesCursor(String(cursor));\n const listed = yield* listRepositories(client, RepositoryRefSchema);\n const pending = state.pending;\n const until = pending?.until ?? (yield* DateTime.now);\n // Only repositories with the feature on count as read. One that turns it on\n // later is read in full, because GitHub keeps the hidden items.\n const repositoryIds =\n pending?.repositoryIds ?? listed.filter(spec.enabled).map((repository) => repository.id);\n const repositories = listed.filter(\n (repository) =>\n spec.enabled(repository) &&\n repositoryIds.includes(repository.id) &&\n repository.id >= (pending?.repositoryId ?? 0),\n );\n\n const pages = yield* Stream.fromIterable(repositories).pipe(\n Stream.flatMap((repository) =>\n changesPages(\n client,\n spec,\n repository,\n readFrom(state, repository.id),\n Option.fromNullishOr(\n pending?.repositoryId === repository.id ? pending.url : undefined,\n ),\n ),\n ),\n Stream.take(maxChangesPagesPerRun),\n Stream.runCollect,\n );\n const rows = pages.flatMap((page) => page.rows);\n\n const position = Option.flatMap(Arr.last(pages), ({ repository, next }) =>\n Option.match(next, {\n onSome: (url) => Option.some({ repositoryId: repository.id, url }),\n onNone: () =>\n Arr.findFirst(repositories, (item) => item.id > repository.id).pipe(\n Option.map((item) => ({ repositoryId: item.id })),\n ),\n }),\n );\n if (pages.length === maxChangesPagesPerRun && Option.isSome(position)) {\n return {\n rows,\n cursor: yield* encodeChangesCursor({\n ...state,\n pending: { until, repositoryIds, ...position.value },\n }),\n hasMore: true,\n };\n }\n return {\n rows,\n cursor: yield* encodeChangesCursor({ since: until, repositoryIds }),\n hasMore: false,\n };\n }),\n });\n\n/** Schemas check that the URL ends in a number. */\nexport const numberAtEnd = (url: string): bigint => BigInt(url.slice(url.lastIndexOf(\"/\") + 1));\n\nexport const deleteRow = (id: bigint): Effect.Effect<DeleteRow> =>\n DateTime.nowAsDate.pipe(Effect.map((version): DeleteRow => ({ id, version, _deleted: true })));\n\nexport const decodeEvent = <A>(schema: Schema.Decoder<A>, payload: unknown) =>\n Schema.decodeUnknownEffect(schema)(payload).pipe(\n Effect.mapError(\n (cause) => new ConnectorError({ message: \"GitHub webhook payload does not decode\", cause }),\n ),\n );\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema } from \"effect\";\n\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport { type GitHubClientService, withParams } from \"../client/client\";\nimport {\n type Commit,\n type CommitObject,\n CommitObjectSchema,\n CommitSchema,\n} from \"../schemas/commits\";\nimport { PushEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n pageSize,\n readPages,\n rowsOf,\n wrappedList,\n} from \"./shared\";\n\nconst toRow = (\n { sha, node_id, commit, author, committer, parents, html_url }: CommitObject,\n repository_id: bigint,\n): Commit => ({\n key: `${repository_id}:${sha}`,\n version: commit.committer.date,\n repository_id,\n sha,\n node_id,\n message: commit.message,\n author: commit.author,\n committer: commit.committer,\n author_user: author,\n committer_user: committer,\n parents: parents.map((parent) => parent.sha),\n verified: commit.verification?.verified ?? false,\n html_url,\n});\n\nconst committedAt = (item: CommitObject) => item.commit.committer.date;\n\n/** The list only has the default branch. */\nexport const commitSpec: RepoResourceSpec<CommitObject, Commit> = {\n path: \"commits\",\n pageSchema: Schema.Array(CommitObjectSchema),\n params: {},\n // `since` filters on the commit time, not the push time. Pushes of older\n // commits come by webhook.\n since: true,\n order: \"newest\",\n createdAt: committedAt,\n updatedAt: committedAt,\n keep: () => true,\n enabled: (repository) => repository.size > 0,\n rows: rowsOf(toRow),\n};\n\nconst noCommit = /^0+$/;\n\nexport const makeCommits = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"commits\",\n rowSchema: CommitSchema,\n version: \"version\",\n\n check: checkRepoResource(client, commitSpec),\n backfill: backfillRepoResource(client, repositories, commitSpec),\n changes: changesRepoResource(client, commitSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n // The push payload is not the API's commit, so the commits are read from\n // the compare API. A new or deleted branch has nothing to compare.\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { ref, before, after, repository } = yield* decodeEvent(PushEventSchema, payload);\n if (\n ref !== `refs/heads/${repository.default_branch}` ||\n noCommit.test(before) ||\n noCommit.test(after)\n ) {\n return [];\n }\n const commits = yield* readPages(\n client,\n wrappedList(\"commits\", CommitObjectSchema),\n withParams(`/repos/${repository.full_name}/compare/${before}...${after}`, {\n per_page: pageSize,\n }),\n );\n return commits.map((commit) => toRow(commit, repository.id));\n }),\n },\n });\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { DateTime, Effect } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { CommitObject } from \"../schemas/commits\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport {\n type CheckRun,\n type CheckRunObject,\n CheckRunObjectSchema,\n CheckRunSchema,\n} from \"../schemas/check-runs\";\nimport { CheckRunEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport { commitSpec } from \"./commits\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n childRows,\n decodeEvent,\n wrappedList,\n} from \"./shared\";\n\nconst toRow = (checkRun: CheckRunObject, repository_id: bigint, version: Date): CheckRun => ({\n ...checkRun,\n version,\n repository_id,\n});\n\n/** Check runs of default-branch commits. Webhooks also bring other branches. */\nconst checkRunSpec = (client: GitHubClientService): RepoResourceSpec<CommitObject, CheckRun> => ({\n ...commitSpec,\n rows: childRows(client, {\n path: (commit) => `commits/${commit.sha}/check-runs`,\n pageSchema: wrappedList(\"check_runs\", CheckRunObjectSchema),\n // Without it, a re-run hides the earlier runs.\n params: { filter: \"all\" },\n toRow: (checkRun, _commit, repositoryId, readAt) => toRow(checkRun, repositoryId, readAt),\n }),\n});\n\nexport const makeCheckRuns = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) => {\n const spec = checkRunSpec(client);\n return Resource.entity({\n name: \"check_runs\",\n rowSchema: CheckRunSchema,\n version: \"version\",\n\n check: checkRepoResource(client, spec),\n backfill: backfillRepoResource(client, repositories, spec),\n changes: changesRepoResource(client, spec),\n webhook: {\n schema: WebhookPayloadSchema,\n // No update time, so read the latest state instead of trusting the payload.\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { repository, check_run } = yield* decodeEvent(CheckRunEventSchema, payload);\n const readAt = yield* DateTime.nowAsDate;\n const page = yield* client.get(\n CheckRunObjectSchema,\n `/repos/${repository.full_name}/check-runs/${check_run.id}`,\n );\n return [toRow(page.body, repository.id, readAt)];\n }),\n },\n });\n};\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Text, Timestamp, user, version } from \"./shared\";\n\nexport const CommitStatusSchema = Schema.Struct({\n id: Long.pipe(\n Schema.annotateKey({\n description: \"Unique status ID. Each new status of a context gets a new ID.\",\n }),\n ),\n version: version(\"status\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the status.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the status belongs to.\" }),\n ),\n sha: Schema.String.pipe(\n Schema.annotateKey({ description: \"SHA of the commit the status is on.\" }),\n ),\n state: Schema.String.pipe(\n Schema.annotateKey({ description: \"State: error, failure, pending, or success.\" }),\n ),\n context: Schema.String.pipe(\n Schema.annotateKey({ description: \"Label that tells the status apart, such as ci/build.\" }),\n ),\n description: Text.pipe(\n Schema.annotateKey({ description: \"Short description. Empty when not set.\" }),\n ),\n target_url: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Link the status points to.\" }),\n ),\n creator: Schema.NullOr(user).pipe(\n Schema.annotateKey({ description: \"Account that created the status.\" }),\n ),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the status was created.\" })),\n})\n .annotate({\n description: \"Commit statuses. Polled for default-branch commits; webhooks cover all branches.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type CommitStatus = Schema.Schema.Type<typeof CommitStatusSchema>;\n\nexport const CommitStatusObjectSchema = CommitStatusSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"sha\"]),\n updated_at: Timestamp,\n}));\n\nexport type CommitStatusObject = Schema.Schema.Type<typeof CommitStatusObjectSchema>;\n","import { ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Array as Arr, Effect, Schema } from \"effect\";\n\nimport type { CommitObject } from \"../schemas/commits\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport { type GitHubClientService, withParams } from \"../client/client\";\nimport {\n type CommitStatus,\n type CommitStatusObject,\n CommitStatusObjectSchema,\n CommitStatusSchema,\n} from \"../schemas/commit-statuses\";\nimport { StatusEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport { commitSpec } from \"./commits\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n childRows,\n decodeEvent,\n pageSize,\n readPages,\n} from \"./shared\";\n\nconst toRow = (\n { updated_at, ...rest }: CommitStatusObject,\n sha: string,\n repository_id: bigint,\n): CommitStatus => ({ ...rest, version: updated_at, repository_id, sha });\n\n/** Statuses of default-branch commits. Webhooks also bring other branches. */\nconst commitStatusSpec = (\n client: GitHubClientService,\n): RepoResourceSpec<CommitObject, CommitStatus> => ({\n ...commitSpec,\n rows: childRows(client, {\n path: (commit) => `commits/${commit.sha}/statuses`,\n pageSchema: Schema.Array(CommitStatusObjectSchema),\n toRow: (status, commit, repositoryId) => toRow(status, commit.sha, repositoryId),\n }),\n});\n\nexport const makeCommitStatuses = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) => {\n const spec = commitStatusSpec(client);\n return Resource.entity({\n name: \"commit_statuses\",\n rowSchema: CommitStatusSchema,\n version: \"version\",\n\n check: checkRepoResource(client, spec),\n backfill: backfillRepoResource(client, repositories, spec),\n changes: changesRepoResource(client, spec),\n webhook: {\n schema: WebhookPayloadSchema,\n // The payload has no node ID or creator, so read the status from the list.\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { id, sha, repository } = yield* decodeEvent(StatusEventSchema, payload);\n const isStatus = (status: CommitStatusObject) => status.id === id;\n const status = yield* readPages(\n client,\n Schema.Array(CommitStatusObjectSchema),\n withParams(`/repos/${repository.full_name}/commits/${sha}/statuses`, {\n per_page: pageSize,\n }),\n (page) => !page.some(isStatus),\n ).pipe(\n Effect.flatMap((statuses) =>\n Effect.fromOption(\n Arr.findFirst(statuses, isStatus),\n () => new ConnectorError({ message: `Commit status ${id} is not in the list` }),\n ),\n ),\n );\n return [toRow(status, sha, repository.id)];\n }),\n },\n });\n};\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport {\n IssueCommentDeletedEventSchema,\n IssueCommentEventSchema,\n WebhookPayloadSchema,\n} from \"../schemas/events\";\nimport {\n type IssueComment,\n type IssueCommentObject,\n IssueCommentObjectSchema,\n IssueCommentSchema,\n} from \"../schemas/issue-comments\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n deleteRow,\n numberAtEnd,\n rowsOf,\n timestamps,\n} from \"./shared\";\n\nconst toRow = (\n { updated_at, issue_url, ...rest }: IssueCommentObject,\n repository_id: bigint,\n): IssueComment => ({\n ...rest,\n version: updated_at,\n repository_id,\n issue_number: numberAtEnd(issue_url),\n});\n\nexport const issueCommentSpec: RepoResourceSpec<IssueCommentObject, IssueComment> = {\n path: \"issues/comments\",\n pageSchema: Schema.Array(IssueCommentObjectSchema),\n params: {},\n since: true,\n order: \"sorted\",\n ...timestamps,\n keep: () => true,\n enabled: (repository) => repository.has_issues || repository.has_pull_requests,\n rows: rowsOf(toRow),\n};\n\nexport const makeIssueComments = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"issue_comments\",\n rowSchema: IssueCommentSchema,\n version: \"version\",\n\n check: checkRepoResource(client, issueCommentSpec),\n backfill: backfillRepoResource(client, repositories, issueCommentSpec),\n changes: changesRepoResource(client, issueCommentSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const event = yield* decodeEvent(IssueCommentEventSchema, payload);\n if (Schema.is(IssueCommentDeletedEventSchema)(event)) {\n return [yield* deleteRow(event.comment.id)];\n }\n return [toRow(event.comment, event.repository.id)];\n }),\n },\n });\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport {\n IssueRemovedEventSchema,\n IssuesEventSchema,\n WebhookPayloadSchema,\n} from \"../schemas/events\";\nimport { type Issue, type IssueObject, IssueObjectSchema, IssueSchema } from \"../schemas/issues\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n deleteRow,\n rowsOf,\n timestamps,\n} from \"./shared\";\n\nconst toRow = (\n { updated_at, labels, assignees, pull_request: _pullRequest, ...rest }: IssueObject,\n repository_id: bigint,\n): Issue => ({\n ...rest,\n version: updated_at,\n repository_id,\n labels: labels ?? [],\n assignees: assignees ?? [],\n});\n\n// A webhook can leave a list out, so read the issue again.\nconst hasLists = ({ labels }: IssueObject) => labels !== undefined;\n\nexport const issueSpec: RepoResourceSpec<IssueObject, Issue> = {\n path: \"issues\",\n pageSchema: Schema.Array(IssueObjectSchema),\n params: { state: \"all\" },\n since: true,\n order: \"sorted\",\n ...timestamps,\n keep: (item) => item.pull_request === undefined,\n enabled: (repository) => repository.has_issues,\n rows: rowsOf(toRow),\n};\n\nexport const makeIssues = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"issues\",\n rowSchema: IssueSchema,\n version: \"version\",\n\n check: checkRepoResource(client, issueSpec),\n backfill: backfillRepoResource(client, repositories, issueSpec),\n changes: changesRepoResource(client, issueSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const event = yield* decodeEvent(IssuesEventSchema, payload);\n if (Schema.is(IssueRemovedEventSchema)(event)) return [yield* deleteRow(event.issue.id)];\n const { issue, repository } = event;\n const full = hasLists(issue)\n ? issue\n : (yield* client.get(\n IssueObjectSchema,\n `/repos/${repository.full_name}/issues/${issue.number}`,\n )).body;\n return [toRow(full, repository.id)];\n }),\n },\n });\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema } from \"effect\";\n\nimport { account, gitActor } from \"./commits\";\nimport { Long } from \"./shared\";\n\nexport const PullRequestCommitSchema = Schema.Struct({\n key: Schema.String.pipe(\n Schema.annotateKey({\n description: \"Repository ID, pull request number, and SHA, such as `1406396726:3:9eb3a7d`.\",\n }),\n ),\n version: Schema.Date.pipe(\n Schema.annotateKey({ description: \"Time GitHub last updated the pull request.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the pull request belongs to.\" }),\n ),\n pull_request_number: Long.pipe(\n Schema.annotateKey({ description: \"Pull request number in the repository.\" }),\n ),\n sha: Schema.String.pipe(Schema.annotateKey({ description: \"Commit SHA.\" })),\n message: Schema.String.pipe(Schema.annotateKey({ description: \"Commit message.\" })),\n author: gitActor.pipe(\n Schema.annotateKey({ description: \"Author name and time from the commit.\" }),\n ),\n committer: gitActor.pipe(\n Schema.annotateKey({ description: \"Committer name and time from the commit.\" }),\n ),\n author_user: account.pipe(Schema.annotateKey({ description: \"GitHub account of the author.\" })),\n committer_user: account.pipe(\n Schema.annotateKey({ description: \"GitHub account of the committer.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Commit page on GitHub.\" })),\n})\n .annotate({\n description:\n \"Commits in pull requests, up to 250 per pull request. Commits removed by a force push stay.\",\n })\n .pipe(Iceberg.identifier(\"key\"));\n\nexport type PullRequestCommit = Schema.Schema.Type<typeof PullRequestCommitSchema>;\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport { PullRequestEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport {\n type PullRequest,\n type PullRequestObject,\n PullRequestObjectSchema,\n PullRequestSchema,\n} from \"../schemas/pull-requests\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n rowsOf,\n timestamps,\n} from \"./shared\";\n\nconst toRow = (\n { updated_at, labels, assignees, requested_reviewers, ...rest }: PullRequestObject,\n repository_id: bigint,\n): PullRequest => ({\n ...rest,\n version: updated_at,\n repository_id,\n labels: labels ?? [],\n assignees: assignees ?? [],\n requested_reviewers: requested_reviewers ?? [],\n});\n\n// A webhook can leave a list out, so read the pull request again.\nconst hasLists = ({ assignees, requested_reviewers }: PullRequestObject) =>\n assignees !== undefined && requested_reviewers !== undefined;\n\nexport const pullRequestSpec: RepoResourceSpec<PullRequestObject, PullRequest> = {\n path: \"pulls\",\n pageSchema: Schema.Array(PullRequestObjectSchema),\n params: { state: \"all\" },\n // The pulls list has no `since`.\n since: false,\n order: \"sorted\",\n ...timestamps,\n keep: () => true,\n enabled: (repository) => repository.has_pull_requests,\n rows: rowsOf(toRow),\n};\n\nexport const makePullRequests = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"pull_requests\",\n rowSchema: PullRequestSchema,\n version: \"version\",\n\n check: checkRepoResource(client, pullRequestSpec),\n backfill: backfillRepoResource(client, repositories, pullRequestSpec),\n changes: changesRepoResource(client, pullRequestSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { pull_request, repository } = yield* decodeEvent(PullRequestEventSchema, payload);\n const full = hasLists(pull_request)\n ? pull_request\n : (yield* client.get(\n PullRequestObjectSchema,\n `/repos/${repository.full_name}/pulls/${pull_request.number}`,\n )).body;\n return [toRow(full, repository.id)];\n }),\n },\n });\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema } from \"effect\";\n\nimport type { PullRequestObject } from \"../schemas/pull-requests\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport { type GitHubClientService, withParams } from \"../client/client\";\nimport { type CommitObject, CommitObjectSchema } from \"../schemas/commits\";\nimport { PullRequestCommitsEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport { type PullRequestCommit, PullRequestCommitSchema } from \"../schemas/pull-request-commits\";\nimport { pullRequestSpec } from \"./pull-requests\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n childRows,\n decodeEvent,\n pageSize,\n readPages,\n} from \"./shared\";\n\nconst toRow = (\n { sha, commit, author, committer, html_url }: CommitObject,\n pullRequest: { readonly number: bigint; readonly updated_at: Date },\n repository_id: bigint,\n): PullRequestCommit => ({\n key: `${repository_id}:${pullRequest.number}:${sha}`,\n version: pullRequest.updated_at,\n repository_id,\n pull_request_number: pullRequest.number,\n sha,\n message: commit.message,\n author: commit.author,\n committer: commit.committer,\n author_user: author,\n committer_user: committer,\n html_url,\n});\n\nconst commitsPath = (pullRequest: { readonly number: bigint }) =>\n `pulls/${pullRequest.number}/commits`;\n\nconst pullRequestCommitSpec = (\n client: GitHubClientService,\n): RepoResourceSpec<PullRequestObject, PullRequestCommit> => ({\n ...pullRequestSpec,\n rows: childRows(client, {\n path: (pullRequest) => commitsPath(pullRequest),\n pageSchema: Schema.Array(CommitObjectSchema),\n toRow,\n }),\n});\n\n// Other actions don't change the commits. An edit does only when it changes the base.\nconst commitActions = new Set([\"opened\", \"reopened\", \"synchronize\"]);\n\nexport const makePullRequestCommits = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) => {\n const spec = pullRequestCommitSpec(client);\n return Resource.entity({\n name: \"pull_request_commits\",\n rowSchema: PullRequestCommitSchema,\n version: \"version\",\n\n check: checkRepoResource(client, spec),\n backfill: backfillRepoResource(client, repositories, spec),\n changes: changesRepoResource(client, spec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { action, changes, repository, pull_request } = yield* decodeEvent(\n PullRequestCommitsEventSchema,\n payload,\n );\n if (!commitActions.has(action) && changes?.base === undefined) return [];\n const commits = yield* readPages(\n client,\n Schema.Array(CommitObjectSchema),\n withParams(`/repos/${repository.full_name}/${commitsPath(pull_request)}`, {\n per_page: pageSize,\n }),\n );\n return commits.map((commit) => toRow(commit, pull_request, repository.id));\n }),\n },\n });\n};\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport {\n PullRequestReviewCommentDeletedEventSchema,\n PullRequestReviewCommentEventSchema,\n WebhookPayloadSchema,\n} from \"../schemas/events\";\nimport {\n type PullRequestReviewComment,\n type PullRequestReviewCommentObject,\n PullRequestReviewCommentObjectSchema,\n PullRequestReviewCommentSchema,\n} from \"../schemas/pull-request-review-comments\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n deleteRow,\n numberAtEnd,\n rowsOf,\n timestamps,\n} from \"./shared\";\n\nconst toRow = (\n { updated_at, pull_request_url, ...rest }: PullRequestReviewCommentObject,\n repository_id: bigint,\n): PullRequestReviewComment => ({\n ...rest,\n version: updated_at,\n repository_id,\n pull_request_number: numberAtEnd(pull_request_url),\n});\n\nexport const pullRequestReviewCommentSpec: RepoResourceSpec<\n PullRequestReviewCommentObject,\n PullRequestReviewComment\n> = {\n path: \"pulls/comments\",\n pageSchema: Schema.Array(PullRequestReviewCommentObjectSchema),\n params: {},\n since: true,\n order: \"sorted\",\n ...timestamps,\n keep: () => true,\n enabled: (repository) => repository.has_pull_requests,\n rows: rowsOf(toRow),\n};\n\nexport const makePullRequestReviewComments = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"pull_request_review_comments\",\n rowSchema: PullRequestReviewCommentSchema,\n version: \"version\",\n\n check: checkRepoResource(client, pullRequestReviewCommentSpec),\n backfill: backfillRepoResource(client, repositories, pullRequestReviewCommentSpec),\n changes: changesRepoResource(client, pullRequestReviewCommentSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const event = yield* decodeEvent(PullRequestReviewCommentEventSchema, payload);\n if (Schema.is(PullRequestReviewCommentDeletedEventSchema)(event)) {\n return [yield* deleteRow(event.comment.id)];\n }\n return [toRow(event.comment, event.repository.id)];\n }),\n },\n });\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Timestamp, readVersion, user } from \"./shared\";\n\nexport const PullRequestReviewSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique review ID.\" })),\n version: readVersion(\"review\"),\n node_id: Schema.String.pipe(\n Schema.annotateKey({ description: \"GraphQL node ID of the review.\" }),\n ),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the review belongs to.\" }),\n ),\n pull_request_number: Long.pipe(\n Schema.annotateKey({\n description: \"Number of the pull request the review is on, in its repository.\",\n }),\n ),\n user: Schema.NullOr(user).pipe(\n Schema.annotateKey({ description: \"Account that wrote the review.\" }),\n ),\n author_association: Schema.String.pipe(\n Schema.annotateKey({\n description: \"Author's relation to the repository, such as OWNER or CONTRIBUTOR.\",\n }),\n ),\n state: Schema.String.pipe(\n Schema.annotateKey({\n description: \"State, such as APPROVED, CHANGES_REQUESTED, COMMENTED, or DISMISSED.\",\n }),\n ),\n body: Schema.String.pipe(Schema.annotateKey({ description: \"Review summary in Markdown.\" })),\n commit_id: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"SHA of the commit the review is on.\" }),\n ),\n submitted_at: Schema.optionalKey(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the review was submitted.\" }),\n ),\n html_url: Schema.String.pipe(Schema.annotateKey({ description: \"Review on GitHub.\" })),\n})\n .annotate({\n description: \"Reviews on pull requests. Pending reviews are only visible to their author.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type PullRequestReview = Schema.Schema.Type<typeof PullRequestReviewSchema>;\n\nexport const PullRequestReviewObjectSchema = PullRequestReviewSchema.mapFields((fields) =>\n Struct.omit(fields, [\"version\", \"repository_id\", \"pull_request_number\"]),\n);\n\nexport type PullRequestReviewObject = Schema.Schema.Type<typeof PullRequestReviewObjectSchema>;\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { DateTime, Effect, Schema } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { PullRequestObject } from \"../schemas/pull-requests\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport { PullRequestReviewEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport {\n type PullRequestReview,\n type PullRequestReviewObject,\n PullRequestReviewObjectSchema,\n PullRequestReviewSchema,\n} from \"../schemas/pull-request-reviews\";\nimport { pullRequestSpec } from \"./pull-requests\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n childRows,\n decodeEvent,\n} from \"./shared\";\n\nconst toRow = (\n review: PullRequestReviewObject,\n pull_request_number: bigint,\n repository_id: bigint,\n version: Date,\n): PullRequestReview => ({ ...review, version, repository_id, pull_request_number });\n\n/** A review bumps its pull request's update time, so changes follow pull requests. */\nconst reviewSpec = (\n client: GitHubClientService,\n): RepoResourceSpec<PullRequestObject, PullRequestReview> => ({\n ...pullRequestSpec,\n rows: childRows(client, {\n path: (pullRequest) => `pulls/${pullRequest.number}/reviews`,\n pageSchema: Schema.Array(PullRequestReviewObjectSchema),\n toRow: (review, pullRequest, repositoryId, readAt) =>\n toRow(review, pullRequest.number, repositoryId, readAt),\n }),\n});\n\nexport const makePullRequestReviews = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) => {\n const spec = reviewSpec(client);\n return Resource.entity({\n name: \"pull_request_reviews\",\n rowSchema: PullRequestReviewSchema,\n version: \"version\",\n\n check: checkRepoResource(client, spec),\n backfill: backfillRepoResource(client, repositories, spec),\n changes: changesRepoResource(client, spec),\n webhook: {\n schema: WebhookPayloadSchema,\n // No update time, so read the latest state instead of trusting the payload.\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { repository, pull_request, review } = yield* decodeEvent(\n PullRequestReviewEventSchema,\n payload,\n );\n const readAt = yield* DateTime.nowAsDate;\n const page = yield* client.get(\n PullRequestReviewObjectSchema,\n `/repos/${repository.full_name}/pulls/${pull_request.number}/reviews/${review.id}`,\n );\n return [toRow(page.body, pull_request.number, repository.id, readAt)];\n }),\n },\n });\n};\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Schema, Struct } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport {\n ReleaseDeletedEventSchema,\n ReleaseEventSchema,\n WebhookPayloadSchema,\n} from \"../schemas/events\";\nimport {\n type Release,\n type ReleaseObject,\n ReleaseObjectSchema,\n ReleaseSchema,\n} from \"../schemas/releases\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n deleteRow,\n rowsOf,\n} from \"./shared\";\n\nconst updatedAt = (release: ReleaseObject) => release.updated_at ?? release.created_at;\n\nconst toRow = (release: ReleaseObject, repository_id: bigint): Release => ({\n ...Struct.omit(release, [\"updated_at\"]),\n version: updatedAt(release),\n repository_id,\n});\n\nexport const releaseSpec: RepoResourceSpec<ReleaseObject, Release> = {\n path: \"releases\",\n pageSchema: Schema.Array(ReleaseObjectSchema),\n params: {},\n since: false,\n // The list can't sort or filter, so changes read it all. Most repositories\n // have few releases.\n order: \"newest\",\n createdAt: (release) => release.created_at,\n updatedAt,\n keep: () => true,\n enabled: () => true,\n rows: rowsOf(toRow),\n};\n\nexport const makeReleases = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"releases\",\n rowSchema: ReleaseSchema,\n version: \"version\",\n\n check: checkRepoResource(client, releaseSpec),\n backfill: backfillRepoResource(client, repositories, releaseSpec),\n changes: changesRepoResource(client, releaseSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const event = yield* decodeEvent(ReleaseEventSchema, payload);\n if (Schema.is(ReleaseDeletedEventSchema)(event)) {\n return [yield* deleteRow(event.release.id)];\n }\n return [toRow(event.release, event.repository.id)];\n }),\n },\n });\n","import { Cursor, Fetch, Resource } from \"@useairfoil/connector-kit\";\nimport { Effect, Option, Schema } from \"effect\";\n\nimport { type GitHubClientService, withParams } from \"../client/client\";\nimport {\n RepositoryDeletedEventSchema,\n RepositoryEventSchema,\n WebhookPayloadSchema,\n} from \"../schemas/events\";\nimport {\n type Repository,\n type RepositoryObject,\n RepositoryObjectSchema,\n RepositorySchema,\n} from \"../schemas/repositories\";\nimport {\n changesInterval,\n decodeEvent,\n deleteRow,\n installationRepositoriesPath,\n isSince,\n listRepositories,\n pageSize,\n parseCutoff,\n readChanges,\n repositoryPage,\n} from \"./shared\";\n\nconst toRow = ({ updated_at, topics, ...rest }: RepositoryObject): Repository => ({\n ...rest,\n version: updated_at,\n topics: topics ?? [],\n _deleted: false,\n});\n\nexport const makeRepositories = (client: GitHubClientService) =>\n Resource.entity({\n name: \"repositories\",\n rowSchema: RepositorySchema,\n version: \"version\",\n\n check: client\n .get(\n repositoryPage(RepositoryObjectSchema),\n withParams(installationRepositoriesPath, { per_page: \"1\" }),\n )\n .pipe(Effect.asVoid),\n // The installation's list can't filter on time, so the cutoff is applied here.\n backfill: Fetch.page({\n pageCursor: Cursor.string(),\n cutoff: Cursor.isoDateTime(),\n fetch: ({ pageCursor, cutoff }) =>\n Effect.gen(function* () {\n const cutoffDate = parseCutoff(String(cutoff));\n const page = yield* client.get(\n repositoryPage(RepositoryObjectSchema),\n typeof pageCursor === \"string\"\n ? pageCursor\n : withParams(installationRepositoriesPath, { per_page: pageSize }),\n );\n return {\n rows: page.body.repositories\n .filter((repository) => repository.created_at.getTime() <= cutoffDate.getTime())\n .map(toRow),\n nextPageCursor: Option.getOrUndefined(page.next),\n hasMore: Option.isSome(page.next),\n };\n }),\n }),\n // New repositories are kept too, so one added later still gets a row.\n changes: Fetch.changes({\n cursor: Cursor.string(),\n interval: changesInterval,\n fetch: ({ cursor }) =>\n readChanges(\n String(cursor),\n listRepositories(client, RepositoryObjectSchema),\n (repositories) =>\n repositories\n .filter(({ repository, since }) => isSince(since, repository.updated_at))\n .map(({ repository }) => toRow(repository)),\n ),\n }),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const event = yield* decodeEvent(RepositoryEventSchema, payload);\n if (Schema.is(RepositoryDeletedEventSchema)(event)) {\n return [yield* deleteRow(event.repository.id)];\n }\n const { repository } = event;\n // A webhook can leave the topics out, so read the repository again.\n const full =\n repository.topics !== undefined\n ? repository\n : (yield* client.get(RepositoryObjectSchema, `/repos/${repository.full_name}`)).body;\n return [toRow(full)];\n }),\n },\n });\n","import { Iceberg } from \"@useairfoil/connector-kit\";\nimport { Schema, Struct } from \"effect\";\n\nimport { Long, Timestamp, readVersion } from \"./shared\";\n\nconst step = Schema.Struct({\n number: Long.pipe(Schema.annotateKey({ description: \"Step number.\" })),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"Step name.\" })),\n status: Schema.String.pipe(\n Schema.annotateKey({ description: \"Status, such as queued, in_progress, or completed.\" }),\n ),\n conclusion: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Result of a completed step.\" }),\n ),\n started_at: Schema.optionalKey(Schema.NullOr(Timestamp)).pipe(\n Schema.annotateKey({ description: \"Time the step started.\" }),\n ),\n completed_at: Schema.optionalKey(Schema.NullOr(Timestamp)).pipe(\n Schema.annotateKey({ description: \"Time the step completed.\" }),\n ),\n});\n\nexport const WorkflowJobSchema = Schema.Struct({\n id: Long.pipe(Schema.annotateKey({ description: \"Unique job ID.\" })),\n version: readVersion(\"job\"),\n node_id: Schema.String.pipe(Schema.annotateKey({ description: \"GraphQL node ID of the job.\" })),\n repository_id: Long.pipe(\n Schema.annotateKey({ description: \"ID of the repository the job belongs to.\" }),\n ),\n run_id: Long.pipe(Schema.annotateKey({ description: \"ID of the workflow run.\" })),\n run_attempt: Schema.optionalKey(Long).pipe(\n Schema.annotateKey({ description: \"Attempt of the run the job belongs to.\" }),\n ),\n workflow_name: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Workflow name.\" }),\n ),\n name: Schema.String.pipe(Schema.annotateKey({ description: \"Job name.\" })),\n head_sha: Schema.String.pipe(\n Schema.annotateKey({ description: \"SHA of the commit the job ran on.\" }),\n ),\n head_branch: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Branch the job ran on.\" }),\n ),\n status: Schema.String.pipe(\n Schema.annotateKey({ description: \"Status, such as queued, in_progress, or completed.\" }),\n ),\n conclusion: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Result of a completed job, such as success or failure.\" }),\n ),\n created_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the job was queued.\" })),\n started_at: Timestamp.pipe(Schema.annotateKey({ description: \"Time the job started.\" })),\n completed_at: Schema.NullOr(Timestamp).pipe(\n Schema.annotateKey({ description: \"Time the job completed.\" }),\n ),\n runner_name: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Name of the runner.\" }),\n ),\n labels: Schema.Array(Schema.String).pipe(\n Schema.annotateKey({ description: \"Runner labels the job asked for.\" }),\n ),\n steps: Schema.Array(step).pipe(Schema.annotateKey({ description: \"Steps of the job.\" })),\n html_url: Schema.NullOr(Schema.String).pipe(\n Schema.annotateKey({ description: \"Job page on GitHub.\" }),\n ),\n})\n .annotate({\n description: \"Jobs of GitHub Actions workflow runs. Each run attempt has its own jobs.\",\n })\n .pipe(Iceberg.identifier(\"id\"));\n\nexport type WorkflowJob = Schema.Schema.Type<typeof WorkflowJobSchema>;\n\nexport const WorkflowJobObjectSchema = WorkflowJobSchema.mapFields((fields) => ({\n ...Struct.omit(fields, [\"version\", \"repository_id\", \"steps\"]),\n steps: Schema.optionalKey(Schema.Array(step)),\n}));\n\nexport type WorkflowJobObject = Schema.Schema.Type<typeof WorkflowJobObjectSchema>;\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { Duration, Effect } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\n\nimport { WebhookPayloadSchema, WorkflowRunEventSchema } from \"../schemas/events\";\nimport {\n type WorkflowRun,\n type WorkflowRunObject,\n WorkflowRunObjectSchema,\n WorkflowRunSchema,\n} from \"../schemas/workflow-runs\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n decodeEvent,\n rowsOf,\n timestamps,\n wrappedList,\n} from \"./shared\";\n\nconst toRow = (\n { updated_at, pull_requests, ...rest }: WorkflowRunObject,\n repository_id: bigint,\n): WorkflowRun => ({\n ...rest,\n version: updated_at,\n repository_id,\n pull_requests: pull_requests ?? [],\n});\n\nexport const workflowRunSpec: RepoResourceSpec<WorkflowRunObject, WorkflowRun> = {\n path: \"actions/runs\",\n pageSchema: wrappedList(\"workflow_runs\", WorkflowRunObjectSchema),\n // Filters cap the list at 1,000 runs, so none are used.\n params: {},\n since: false,\n order: \"newest\",\n // Most runs finish within a day. A later change, such as a re-run of an old\n // run, comes by webhook.\n recentFor: Duration.days(1),\n ...timestamps,\n keep: () => true,\n enabled: () => true,\n rows: rowsOf(toRow),\n};\n\nexport const makeWorkflowRuns = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) =>\n Resource.entity({\n name: \"workflow_runs\",\n rowSchema: WorkflowRunSchema,\n version: \"version\",\n\n check: checkRepoResource(client, workflowRunSpec),\n backfill: backfillRepoResource(client, repositories, workflowRunSpec),\n changes: changesRepoResource(client, workflowRunSpec),\n webhook: {\n schema: WebhookPayloadSchema,\n handler: ({ payload }) =>\n decodeEvent(WorkflowRunEventSchema, payload).pipe(\n Effect.map((event) => [toRow(event.workflow_run, event.repository.id)]),\n ),\n },\n });\n","import { type ConnectorError, Resource } from \"@useairfoil/connector-kit\";\nimport { DateTime, Effect } from \"effect\";\n\nimport type { GitHubClientService } from \"../client/client\";\nimport type { RepositoryRef } from \"../schemas/repositories\";\nimport type { WorkflowRunObject } from \"../schemas/workflow-runs\";\n\nimport { WebhookPayloadSchema, WorkflowJobEventSchema } from \"../schemas/events\";\nimport {\n type WorkflowJob,\n type WorkflowJobObject,\n WorkflowJobObjectSchema,\n WorkflowJobSchema,\n} from \"../schemas/workflow-jobs\";\nimport {\n type RepoResourceSpec,\n backfillRepoResource,\n changesRepoResource,\n checkRepoResource,\n childRows,\n decodeEvent,\n wrappedList,\n} from \"./shared\";\nimport { workflowRunSpec } from \"./workflow-runs\";\n\nconst toRow = (\n { steps, ...rest }: WorkflowJobObject,\n repository_id: bigint,\n version: Date,\n): WorkflowJob => ({ ...rest, version, repository_id, steps: steps ?? [] });\n\nconst workflowJobSpec = (\n client: GitHubClientService,\n): RepoResourceSpec<WorkflowRunObject, WorkflowJob> => ({\n ...workflowRunSpec,\n rows: childRows(client, {\n path: (run) => `actions/runs/${run.id}/jobs`,\n pageSchema: wrappedList(\"jobs\", WorkflowJobObjectSchema),\n // Earlier attempts' jobs too, so a re-run keeps the history.\n params: { filter: \"all\" },\n toRow: (job, _run, repositoryId, readAt) => toRow(job, repositoryId, readAt),\n }),\n});\n\nexport const makeWorkflowJobs = (\n client: GitHubClientService,\n repositories: Effect.Effect<ReadonlyArray<RepositoryRef>, ConnectorError>,\n) => {\n const spec = workflowJobSpec(client);\n return Resource.entity({\n name: \"workflow_jobs\",\n rowSchema: WorkflowJobSchema,\n version: \"version\",\n\n check: checkRepoResource(client, spec),\n backfill: backfillRepoResource(client, repositories, spec),\n changes: changesRepoResource(client, spec),\n webhook: {\n schema: WebhookPayloadSchema,\n // No update time, so read the latest state instead of trusting the payload.\n handler: ({ payload }) =>\n Effect.gen(function* () {\n const { repository, workflow_job } = yield* decodeEvent(WorkflowJobEventSchema, payload);\n const readAt = yield* DateTime.nowAsDate;\n const page = yield* client.get(\n WorkflowJobObjectSchema,\n `/repos/${repository.full_name}/actions/jobs/${workflow_job.id}`,\n );\n return [toRow(page.body, repository.id, readAt)];\n }),\n },\n });\n};\n","import { ConnectorError } from \"@useairfoil/connector-kit\";\nimport { Effect } from \"effect\";\nimport { createHmac, timingSafeEqual } from \"node:crypto\";\n\nconst prefix = \"sha256=\";\n\nexport const verifySignature = (options: {\n readonly rawBody: Uint8Array;\n readonly header: string | undefined;\n readonly secret: string;\n}): Effect.Effect<void, ConnectorError> => {\n const header = options.header ?? \"\";\n const expected = createHmac(\"sha256\", options.secret).update(options.rawBody).digest();\n const provided = Buffer.from(header.slice(prefix.length), \"hex\");\n return header.startsWith(prefix) &&\n provided.length === expected.length &&\n timingSafeEqual(provided, expected)\n ? Effect.void\n : Effect.fail(new ConnectorError({ message: \"Invalid GitHub webhook signature\" }));\n};\n","import { type ResourceDefinition, Webhook } from \"@useairfoil/connector-kit\";\nimport { Effect, Option, Result, Schema } from \"effect\";\nimport { HttpServerResponse } from \"effect/http\";\n\nimport { InstallationEventSchema, WebhookPayloadSchema } from \"../schemas/events\";\nimport { verifySignature } from \"./signature\";\n\nexport const webhookPath = \"/webhooks/github\";\n\nexport const makeWebhookRoute = (options: {\n readonly secret: string;\n readonly installationId: number;\n /** Resources by `X-GitHub-Event` name. One event can feed several. */\n readonly targets: ReadonlyMap<string, ReadonlyArray<ResourceDefinition>>;\n}) =>\n Webhook.route({\n path: webhookPath,\n ackMode: \"after-enqueue\",\n schema: WebhookPayloadSchema,\n handler: ({ request, rawBody, payload, to }) =>\n Effect.gen(function* () {\n const verified = yield* verifySignature({\n rawBody,\n header: request.headers[\"x-hub-signature-256\"],\n secret: options.secret,\n }).pipe(Effect.result);\n if (Result.isFailure(verified)) {\n return HttpServerResponse.jsonUnsafe(\n { ok: false, error: verified.failure.message },\n { status: 401 },\n );\n }\n\n // One app can be installed on several accounts, and all of their events\n // come to the same URL. Only ours are stored. `ping` has no installation.\n const installationId = Schema.decodeUnknownOption(InstallationEventSchema)(payload).pipe(\n Option.flatMap(({ installation }) => Option.fromNullishOr(installation?.id)),\n );\n if (Option.contains(installationId, options.installationId)) {\n const resources = options.targets.get(request.headers[\"x-github-event\"] ?? \"\") ?? [];\n yield* Effect.forEach(resources, (resource) => to(resource, payload), { discard: true });\n }\n\n return HttpServerResponse.jsonUnsafe({ ok: true });\n }),\n });\n","import { Connector, type ResourceDefinition } from \"@useairfoil/connector-kit\";\nimport { Config, Context, Effect, Layer, Redacted } from \"effect\";\n\nimport type { GitHubConfig } from \"./manifest\";\n\nimport * as GitHubClient from \"./client/client\";\nimport { makeCheckRuns } from \"./resources/check-runs\";\nimport { makeCommitStatuses } from \"./resources/commit-statuses\";\nimport { makeCommits } from \"./resources/commits\";\nimport { makeIssueComments } from \"./resources/issue-comments\";\nimport { makeIssues } from \"./resources/issues\";\nimport { makePullRequestCommits } from \"./resources/pull-request-commits\";\nimport { makePullRequestReviewComments } from \"./resources/pull-request-review-comments\";\nimport { makePullRequestReviews } from \"./resources/pull-request-reviews\";\nimport { makePullRequests } from \"./resources/pull-requests\";\nimport { makeReleases } from \"./resources/releases\";\nimport { makeRepositories } from \"./resources/repositories\";\nimport { cachedRepositoryRefs } from \"./resources/shared\";\nimport { makeWorkflowJobs } from \"./resources/workflow-jobs\";\nimport { makeWorkflowRuns } from \"./resources/workflow-runs\";\nimport { makeWebhookRoute } from \"./webhook/route\";\nexport { GitHubConfigDef, manifest } from \"./manifest\";\nexport type { GitHubConfig } from \"./manifest\";\n\nexport const make = Effect.fnUntraced(function* (config: GitHubConfig) {\n const client = yield* GitHubClient.GitHubClient;\n // The backfills of the per-repository resources share this list.\n const repositories = yield* cachedRepositoryRefs(client);\n\n const Repositories = makeRepositories(client);\n const Issues = makeIssues(client, repositories);\n const PullRequests = makePullRequests(client, repositories);\n const IssueComments = makeIssueComments(client, repositories);\n const PullRequestReviews = makePullRequestReviews(client, repositories);\n const PullRequestReviewComments = makePullRequestReviewComments(client, repositories);\n const PullRequestCommits = makePullRequestCommits(client, repositories);\n const Commits = makeCommits(client, repositories);\n const CheckRuns = makeCheckRuns(client, repositories);\n const CommitStatuses = makeCommitStatuses(client, repositories);\n const WorkflowRuns = makeWorkflowRuns(client, repositories);\n const WorkflowJobs = makeWorkflowJobs(client, repositories);\n const Releases = makeReleases(client, repositories);\n\n return Connector.define({\n name: \"producer-github\",\n title: \"GitHub\",\n resources: [\n Repositories,\n Issues,\n PullRequests,\n IssueComments,\n PullRequestReviews,\n PullRequestReviewComments,\n PullRequestCommits,\n Commits,\n CheckRuns,\n CommitStatuses,\n WorkflowRuns,\n WorkflowJobs,\n Releases,\n ],\n webhooks: [\n makeWebhookRoute({\n secret: Redacted.value(config.webhookSecret),\n installationId: config.installationId,\n targets: new Map<string, ReadonlyArray<ResourceDefinition>>([\n [\"repository\", [Repositories]],\n [\"issues\", [Issues]],\n [\"pull_request\", [PullRequests, PullRequestCommits]],\n [\"issue_comment\", [IssueComments]],\n [\"pull_request_review\", [PullRequestReviews]],\n [\"pull_request_review_comment\", [PullRequestReviewComments]],\n [\"push\", [Commits]],\n [\"check_run\", [CheckRuns]],\n [\"status\", [CommitStatuses]],\n [\"workflow_run\", [WorkflowRuns]],\n [\"workflow_job\", [WorkflowJobs]],\n [\"release\", [Releases]],\n ]),\n }),\n ],\n });\n});\n\nexport type GitHubConnectorRuntime = Effect.Success<ReturnType<typeof make>>;\n\nexport class GitHubConnector extends Context.Service<GitHubConnector, GitHubConnectorRuntime>()(\n \"@useairfoil/producer-github/GitHubConnector\",\n) {}\n\nexport const layer = (config: GitHubConfig) =>\n Layer.effect(GitHubConnector)(\n make(config).pipe(Effect.annotateLogs({ component: \"github\" })),\n ).pipe(Layer.provide(GitHubClient.layer(config)));\n\nexport const layerConfig = (config: Config.Wrap<GitHubConfig>) =>\n Layer.unwrap(Config.unwrap(config).pipe(Effect.map(layer)));\n"],"mappings":";;;;;;;AACA,MAAa,qBAAqB;AAElC,MAAa,UAAU;;;;;;;;;ACUvB,IAAa,aAAb,cAAgC,QAAQ,QAAuC,CAAC,CAC9E,wCACF,CAAC,CAAC,CAAC;AAEH,MAAM,sBAAsB,OAAO,OAAO;CACxC,OAAO,OAAO;CACd,YAAY,OAAO;AACrB,CAAC;AAED,MAAM,aAAa,UAAmC,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,WAAW;;;;;AAM7F,MAAa,cAAc,YAKzB,OAAO,IAAI;CACT,WAAW;EACT,MAAM,MAAM,KAAK,MAAM,QAAQ,YAAY,GAAI;EAK/C,MAAM,eAAe,GAJN,UAAU,KAAK,UAAU;GAAE,KAAK;GAAS,KAAK;EAAM,CAAC,CAIvC,EAAE,GAHhB,UACb,KAAK,UAAU;GAAE,KAAK,MAAM;GAAI,KAAK,MAAM;GAAQ,KAAK,QAAQ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,MAAM;EACN,OAAO;EACP,WAAW;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,UAAU,CACR,iBAAiB;GACf,QAAQ,SAAS,MAAM,OAAO,aAAa;GAC3C,gBAAgB,OAAO;GACvB,yBAAS,IAAI,IAA+C;IAC1D,CAAC,cAAc,CAAC,YAAY,CAAC;IAC7B,CAAC,UAAU,CAAC,MAAM,CAAC;IACnB,CAAC,gBAAgB,CAAC,cAAc,kBAAkB,CAAC;IACnD,CAAC,iBAAiB,CAAC,aAAa,CAAC;IACjC,CAAC,uBAAuB,CAAC,kBAAkB,CAAC;IAC5C,CAAC,+BAA+B,CAAC,yBAAyB,CAAC;IAC3D,CAAC,QAAQ,CAAC,OAAO,CAAC;IAClB,CAAC,aAAa,CAAC,SAAS,CAAC;IACzB,CAAC,UAAU,CAAC,cAAc,CAAC;IAC3B,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC/B,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC/B,CAAC,WAAW,CAAC,QAAQ,CAAC;GACxB,CAAC;EACH,CAAC,CACH;CACF,CAAC;AACH,CAAC;AAID,IAAa,kBAAb,cAAqC,QAAQ,QAAiD,CAAC,CAC7F,6CACF,CAAC,CAAC,CAAC;AAEH,MAAa,SAAS,WACpB,MAAM,OAAO,eAAe,CAAC,CAC3B,KAAK,MAAM,CAAC,CAAC,KAAK,OAAO,aAAa,EAAE,WAAW,SAAS,CAAC,CAAC,CAChE,CAAC,CAAC,KAAK,MAAM,QAAQC,QAAmB,MAAM,CAAC,CAAC;AAElD,MAAa,eAAe,WAC1B,MAAM,OAAO,OAAO,OAAO,MAAM,CAAC,CAAC,KAAK,OAAO,IAAI,KAAK,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useairfoil/producer-github",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "repository": "useairfoil/connector-kit",
5
5
  "files": [
6
6
  "dist",
@@ -22,6 +22,21 @@
22
22
  "default": "./dist/manifest.mjs"
23
23
  }
24
24
  },
25
+ "dependencies": {
26
+ "@effect/platform-node": "^4.1.0",
27
+ "@effect/sql-pg": "^4.1.0",
28
+ "effect": "^4.1.0",
29
+ "@useairfoil/connector-kit": "0.7.0"
30
+ },
31
+ "devDependencies": {
32
+ "@dotenvx/dotenvx": "^1.62.0",
33
+ "@effect/vitest": "^4.1.0",
34
+ "@types/node": "^24.2.0",
35
+ "tsdown": "^0.23.0",
36
+ "tsx": "^4.21.0",
37
+ "vitest": "^5.0.3",
38
+ "@useairfoil/effect-vcr": "0.4.9"
39
+ },
25
40
  "scripts": {
26
41
  "build": "tsdown",
27
42
  "docker:build": "docker build --load --file Dockerfile --tag airfoil/producer-github:local ../..",
@@ -31,20 +46,5 @@
31
46
  "test": "dotenvx run --ignore=MISSING_ENV_FILE --quiet -- vitest",
32
47
  "test:ci": "dotenvx run --ignore=MISSING_ENV_FILE --quiet -- vitest run",
33
48
  "typecheck": "tsc --noEmit"
34
- },
35
- "dependencies": {
36
- "@effect/platform-node": "^4.0.7",
37
- "@effect/sql-pg": "^4.0.7",
38
- "@useairfoil/connector-kit": "0.6.1",
39
- "effect": "^4.0.7"
40
- },
41
- "devDependencies": {
42
- "@dotenvx/dotenvx": "^1.62.0",
43
- "@effect/vitest": "^4.0.7",
44
- "@types/node": "^24.2.0",
45
- "@useairfoil/effect-vcr": "0.4.8",
46
- "tsdown": "^0.23.0",
47
- "tsx": "^4.21.0",
48
- "vitest": "^5.0.3"
49
49
  }
50
- }
50
+ }
@@ -1,5 +1,10 @@
1
- import { ConnectorApp } from "@useairfoil/connector-kit";
1
+ import { ConnectorApp, RuntimeConfig } from "@useairfoil/connector-kit";
2
+ import { Command } from "effect/cli";
2
3
 
3
4
  import { tableSchemas } from "./tables";
4
5
 
5
6
  export const createTableCommand = ConnectorApp.makeCreateTableCommand(tableSchemas);
7
+
8
+ export const setupCommand = ConnectorApp.makeSetupCommand(tableSchemas).pipe(
9
+ Command.provide(RuntimeConfig.layerHosted()),
10
+ );
package/src/main.ts CHANGED
@@ -6,7 +6,7 @@ import { Command } from "effect/cli";
6
6
  import { FetchHttpClient } from "effect/http";
7
7
 
8
8
  import packageJson from "../package.json";
9
- import { createTableCommand } from "./create-table";
9
+ import { createTableCommand, setupCommand } from "./create-table";
10
10
  import { demoCommand } from "./demo";
11
11
  import { sandboxCommand } from "./sandbox";
12
12
  import { startCommand } from "./start";
@@ -14,7 +14,13 @@ import { startCommand } from "./start";
14
14
  const BootstrapLayer = Layer.mergeAll(FetchHttpClient.layer, NodeServices.layer);
15
15
 
16
16
  const program = Command.make("producer-github", {}, () => Effect.void).pipe(
17
- Command.withSubcommands([startCommand, sandboxCommand, createTableCommand, demoCommand]),
17
+ Command.withSubcommands([
18
+ setupCommand,
19
+ startCommand,
20
+ sandboxCommand,
21
+ createTableCommand,
22
+ demoCommand,
23
+ ]),
18
24
  );
19
25
 
20
26
  const cli = Command.run(program, { version: packageJson.version });
@@ -1,37 +1,61 @@
1
1
  import { Iceberg } from "@useairfoil/connector-kit";
2
2
  import { Schema, Struct } from "effect";
3
3
 
4
- import { Long, Timestamp, field, readVersion } from "./shared";
4
+ import { Long, Timestamp, readVersion } from "./shared";
5
5
 
6
6
  export const CheckRunSchema = Schema.Struct({
7
- id: Long.pipe(field(1, "Unique check run ID.")),
8
- version: readVersion(2, "check run"),
9
- node_id: Schema.String.pipe(field(3, "GraphQL node ID of the check run.")),
10
- repository_id: Long.pipe(field(4, "ID of the repository the check run belongs to.")),
11
- head_sha: Schema.String.pipe(field(5, "SHA of the commit the check ran on.")),
12
- name: Schema.String.pipe(field(6, "Check name.")),
13
- status: Schema.String.pipe(field(7, "Status, such as queued, in_progress, or completed.")),
7
+ id: Long.pipe(Schema.annotateKey({ description: "Unique check run ID." })),
8
+ version: readVersion("check run"),
9
+ node_id: Schema.String.pipe(
10
+ Schema.annotateKey({ description: "GraphQL node ID of the check run." }),
11
+ ),
12
+ repository_id: Long.pipe(
13
+ Schema.annotateKey({ description: "ID of the repository the check run belongs to." }),
14
+ ),
15
+ head_sha: Schema.String.pipe(
16
+ Schema.annotateKey({ description: "SHA of the commit the check ran on." }),
17
+ ),
18
+ name: Schema.String.pipe(Schema.annotateKey({ description: "Check name." })),
19
+ status: Schema.String.pipe(
20
+ Schema.annotateKey({ description: "Status, such as queued, in_progress, or completed." }),
21
+ ),
14
22
  conclusion: Schema.NullOr(Schema.String).pipe(
15
- field(8, "Result of a completed check, such as success or failure."),
23
+ Schema.annotateKey({ description: "Result of a completed check, such as success or failure." }),
24
+ ),
25
+ started_at: Schema.NullOr(Timestamp).pipe(
26
+ Schema.annotateKey({ description: "Time the check started." }),
27
+ ),
28
+ completed_at: Schema.NullOr(Timestamp).pipe(
29
+ Schema.annotateKey({ description: "Time the check completed." }),
16
30
  ),
17
- started_at: Schema.NullOr(Timestamp).pipe(field(9, "Time the check started.")),
18
- completed_at: Schema.NullOr(Timestamp).pipe(field(10, "Time the check completed.")),
19
31
  app: Schema.NullOr(
20
32
  Schema.Struct({
21
- id: Long.pipe(field(100, "GitHub App ID.")),
22
- name: Schema.String.pipe(field(101, "GitHub App name.")),
33
+ id: Long.pipe(Schema.annotateKey({ description: "GitHub App ID." })),
34
+ name: Schema.String.pipe(Schema.annotateKey({ description: "GitHub App name." })),
35
+ }),
36
+ ).pipe(
37
+ Schema.annotateKey({
38
+ description: "GitHub App that created the check, such as GitHub Actions.",
23
39
  }),
24
- ).pipe(field(11, "GitHub App that created the check, such as GitHub Actions.")),
25
- check_suite: Schema.NullOr(Schema.Struct({ id: Long.pipe(field(102, "Check suite ID.")) })).pipe(
26
- field(12, "Check suite the check run belongs to."),
27
40
  ),
41
+ check_suite: Schema.NullOr(
42
+ Schema.Struct({ id: Long.pipe(Schema.annotateKey({ description: "Check suite ID." })) }),
43
+ ).pipe(Schema.annotateKey({ description: "Check suite the check run belongs to." })),
28
44
  output: Schema.Struct({
29
- title: Schema.NullOr(Schema.String).pipe(field(103, "Output title.")),
30
- summary: Schema.NullOr(Schema.String).pipe(field(104, "Output summary in Markdown.")),
31
- }).pipe(field(13, "Output the check reported.")),
32
- external_id: Schema.NullOr(Schema.String).pipe(field(14, "ID the app gave the check.")),
33
- details_url: Schema.NullOr(Schema.String).pipe(field(15, "Details page from the app.")),
34
- html_url: Schema.NullOr(Schema.String).pipe(field(16, "Check run page on GitHub.")),
45
+ title: Schema.NullOr(Schema.String).pipe(Schema.annotateKey({ description: "Output title." })),
46
+ summary: Schema.NullOr(Schema.String).pipe(
47
+ Schema.annotateKey({ description: "Output summary in Markdown." }),
48
+ ),
49
+ }).pipe(Schema.annotateKey({ description: "Output the check reported." })),
50
+ external_id: Schema.NullOr(Schema.String).pipe(
51
+ Schema.annotateKey({ description: "ID the app gave the check." }),
52
+ ),
53
+ details_url: Schema.NullOr(Schema.String).pipe(
54
+ Schema.annotateKey({ description: "Details page from the app." }),
55
+ ),
56
+ html_url: Schema.NullOr(Schema.String).pipe(
57
+ Schema.annotateKey({ description: "Check run page on GitHub." }),
58
+ ),
35
59
  })
36
60
  .annotate({
37
61
  description: