@rawdash/connector-github 0.14.0 → 0.16.0

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.
package/README.md CHANGED
@@ -1,13 +1,11 @@
1
+ <!-- This file is generated from connector metadata by scripts/generate-connector-docs.ts. Do not edit by hand. -->
2
+
1
3
  # @rawdash/connector-github
2
4
 
3
5
  [![npm version](https://img.shields.io/npm/v/@rawdash/connector-github)](https://www.npmjs.com/package/@rawdash/connector-github)
4
6
  [![license](https://img.shields.io/npm/l/@rawdash/connector-github)](https://github.com/rawdash/rawdash/blob/main/LICENSE)
5
7
 
6
- GitHub connector for rawdash — sync pull requests, issues, deployments, releases, and CI runs into your dashboard.
7
-
8
- ## What it is
9
-
10
- `@rawdash/connector-github` is a rawdash connector that pulls data from the GitHub REST API. It syncs workflow runs, pull requests, issues, deployments, releases, and contributor activity into the rawdash storage engine, where they become available to widgets defined in your `rawdash.config.ts`.
8
+ Sync pull requests, issues, deployments, releases, CI runs, and contributor activity from a GitHub repository.
11
9
 
12
10
  ## Install
13
11
 
@@ -15,10 +13,44 @@ GitHub connector for rawdash — sync pull requests, issues, deployments, releas
15
13
  npm install @rawdash/connector-github
16
14
  ```
17
15
 
18
- ## Quick example
16
+ ## Authentication
17
+
18
+ A personal access token is optional for public repositories but required for private repos and to avoid the low unauthenticated rate limit.
19
+
20
+ 1. Open GitHub → Settings → Developer settings → Personal access tokens.
21
+ 2. Generate a token with the `repo` scope (read access is sufficient).
22
+ 3. Store it as a secret and reference it from the connector config as `token: secret("GITHUB_TOKEN")`.
23
+
24
+ ## Configuration
25
+
26
+ | Field | Type | Required | Description |
27
+ | ------- | ------ | -------- | ------------------------------------- |
28
+ | `owner` | string | Yes | GitHub username or organization name. |
29
+ | `repo` | string | Yes | Repository name. |
30
+ | `token` | secret | No | GitHub PAT with `repo` scope. |
31
+
32
+ ## Resources
33
+
34
+ - **`repo`** _(entity)_ - Top-level repository stats (stars, forks, and watchers) as a single entity.
35
+ - Endpoint: `GET /repos/{owner}/{repo}`
36
+ - **`workflow_run`** _(event)_ - GitHub Actions CI pipeline executions.
37
+ - Endpoint: `GET /repos/{owner}/{repo}/actions/runs`
38
+ - **`pull_request`** _(entity)_ - Open and closed pull requests, including draft state, author, and review state.
39
+ - Endpoint: `GET /repos/{owner}/{repo}/pulls`
40
+ - Review state is folded in from GET /repos/{owner}/{repo}/pulls/{number}/reviews per PR.
41
+ - **`issue`** _(entity)_ - Open and closed issues with labels, assignees, and author (pull requests excluded).
42
+ - Endpoint: `GET /repos/{owner}/{repo}/issues`
43
+ - **`deployment`** _(entity)_ - Deployments with their latest status, keyed by environment and ref.
44
+ - Endpoint: `GET /repos/{owner}/{repo}/deployments`
45
+ - The latest status is folded in from GET /repos/{owner}/{repo}/deployments/{id}/statuses.
46
+ - **`release`** _(entity)_ - Published, draft, and prerelease GitHub releases.
47
+ - Endpoint: `GET /repos/{owner}/{repo}/releases`
48
+ - **`contributor`** _(entity)_ - Per-author commit activity (commits, additions, deletions) for the repository.
49
+ - Endpoint: `GET /repos/{owner}/{repo}/stats/contributors`
50
+
51
+ ## Example
19
52
 
20
53
  ```ts
21
- import { GitHubConnector } from '@rawdash/connector-github';
22
54
  import {
23
55
  defineConfig,
24
56
  defineDashboard,
@@ -26,18 +58,18 @@ import {
26
58
  secret,
27
59
  } from '@rawdash/core';
28
60
 
29
- const github = new GitHubConnector(
30
- {
61
+ const github = {
62
+ name: 'github',
63
+ connectorId: 'github-actions',
64
+ config: {
31
65
  owner: 'my-org',
32
66
  repo: 'my-repo',
67
+ token: secret('GITHUB_TOKEN'),
33
68
  },
34
- {
35
- token: secret('GITHUB_TOKEN'), // optional for public repos
36
- },
37
- );
69
+ };
38
70
 
39
71
  export default defineConfig({
40
- connectors: [{ connector: github }],
72
+ connectors: [github],
41
73
  dashboards: {
42
74
  engineering: defineDashboard({
43
75
  widgets: {
@@ -47,60 +79,31 @@ export default defineConfig({
47
79
  metric: defineMetric({
48
80
  connector: github,
49
81
  shape: 'entity',
50
- field: 'id',
82
+ entityType: 'pull_request',
51
83
  fn: 'count',
52
84
  filter: [{ field: 'state', op: 'eq', value: 'open' }],
53
85
  }),
54
86
  },
55
- ci_status: {
56
- kind: 'status',
57
- title: 'CI',
58
- source: `${github.id}:workflow_runs`,
59
- },
60
87
  },
61
88
  }),
62
89
  },
63
90
  });
64
91
  ```
65
92
 
66
- ## Configuration
67
-
68
- | Field | Type | Required | Description |
69
- | ------- | -------- | -------- | --------------------------------------------------------------------------------- |
70
- | `owner` | `string` | Yes | GitHub username or organization name |
71
- | `repo` | `string` | Yes | Repository name |
72
- | `token` | `Secret` | No | GitHub PAT with `repo` scope. Required for private repos and to avoid rate limits |
73
-
74
- ## Data synced
75
-
76
- - **Workflow runs** — CI pipeline executions (shape: `event`)
77
- - **Pull requests** — open and closed PRs with review state (shape: `entity`)
78
- - **Issues** — open and closed issues with labels and assignees (shape: `entity`)
79
- - **Deployments** — deployment events and statuses (shape: `event`)
80
- - **Releases** — published GitHub releases (shape: `event`)
81
- - **Contributors** — commit activity per author (shape: `metric`)
82
-
83
- ## Duplicate handling
84
-
85
- The GitHub REST API can return the same item more than once within a single sync — for example when cursor pagination overlaps as the underlying collection mutates mid-fetch, when a retried request re-introduces items already seen, or when the same entity appears via more than one endpoint.
86
-
87
- Per resource (`workflow_runs`, `pull_requests`, `issues`, `deployments`, `releases`, `contributors`), the connector dedupes by stable id before writing to storage. The strategy is **keep last**: when two copies share an id, the later copy in the API response wins. `workflow_runs` additionally tracks ids across paginated pages within a single sync so the same run can't be written as two separate events. When duplicates are dropped, the connector emits a `console.warn` with the count so the behavior is observable. `repo_stats` is a single-document resource so dedupe doesn't apply.
88
-
89
- ## Property tests
93
+ ## Rate limits
90
94
 
91
- Every resource in this connector has a fast-check property test under `src/property.test.ts` that:
95
+ Unauthenticated requests share GitHub’s low 60 requests/hour limit; an authenticated token raises it to 5,000 requests/hour.
92
96
 
93
- 1. Generates N≥100 synthetic API payloads from a Zod schema mirroring the GitHub API response.
94
- 2. Pipes them through `connector.sync()` against an `InMemoryStorage` instance.
95
- 3. Asserts universal invariants — non-empty entity ids, finite event timestamps, no `undefined` leaking into storage, no thrown errors on any valid input — plus per-resource counts.
97
+ ## Limitations
96
98
 
97
- The helper lives in `@rawdash/connector-test-utils`. When extending the connector with a new resource, add a Zod schema for its payload and a test wired up via `runPropertySyncTest`.
99
+ - The GitHub REST API can return the same item more than once within a sync (cursor pagination overlapping a mutating collection, retried requests, or an item surfaced via multiple endpoints). Each resource dedupes by stable id before writing, keeping the last copy seen.
100
+ - Public repositories without a token are subject to GitHub’s low unauthenticated rate limit.
98
101
 
99
102
  ## Links
100
103
 
101
- - [rawdash docs](https://rawdash.dev)
104
+ - [Rawdash docs](https://rawdash.dev/docs/connectors/)
105
+ - [GitHub API docs](https://docs.github.com/rest)
102
106
  - [GitHub](https://github.com/rawdash/rawdash)
103
- - [Issues](https://github.com/rawdash/rawdash/issues)
104
107
 
105
108
  ## License
106
109
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseConnector, ConnectorContext, SyncOptions, StorageHandle, SyncResult } from '@rawdash/core';
1
+ import { BaseConnector, ConnectorContext, SyncOptions, StorageHandle, SyncResult, ConnectorDoc } from '@rawdash/core';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const configFields: z.ZodObject<{
@@ -8,6 +8,7 @@ declare const configFields: z.ZodObject<{
8
8
  $secret: z.ZodString;
9
9
  }, z.core.$strip>>;
10
10
  }, z.core.$strip>;
11
+ declare const doc: ConnectorDoc;
11
12
  interface GitHubSettings {
12
13
  owner: string;
13
14
  repo: string;
@@ -21,6 +22,453 @@ declare const githubCredentials: {
21
22
  type GitHubCredentials = typeof githubCredentials;
22
23
  declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCredentials> {
23
24
  static readonly id = "github-actions";
25
+ static readonly resources: {
26
+ readonly repo: {
27
+ readonly shape: "entity";
28
+ readonly description: "Top-level repository stats (stars, forks, and watchers) as a single entity.";
29
+ readonly endpoint: "GET /repos/{owner}/{repo}";
30
+ readonly responses: {
31
+ readonly repo: z.ZodObject<{
32
+ stargazers_count: z.ZodNumber;
33
+ forks_count: z.ZodNumber;
34
+ subscribers_count: z.ZodNumber;
35
+ }, z.core.$strip>;
36
+ };
37
+ };
38
+ readonly workflow_run: {
39
+ readonly shape: "event";
40
+ readonly description: "GitHub Actions CI pipeline executions.";
41
+ readonly endpoint: "GET /repos/{owner}/{repo}/actions/runs";
42
+ readonly responses: {
43
+ readonly workflow_runs: z.ZodObject<{
44
+ total_count: z.ZodOptional<z.ZodNumber>;
45
+ workflow_runs: z.ZodArray<z.ZodObject<{
46
+ id: z.ZodNumber;
47
+ name: z.ZodString;
48
+ conclusion: z.ZodNullable<z.ZodString>;
49
+ status: z.ZodString;
50
+ head_branch: z.ZodNullable<z.ZodString>;
51
+ actor: z.ZodNullable<z.ZodObject<{
52
+ login: z.ZodString;
53
+ }, z.core.$strip>>;
54
+ created_at: z.ZodISODateTime;
55
+ updated_at: z.ZodISODateTime;
56
+ run_attempt: z.ZodNumber;
57
+ artifacts_url: z.ZodOptional<z.ZodString>;
58
+ cancel_url: z.ZodOptional<z.ZodString>;
59
+ check_suite_id: z.ZodOptional<z.ZodNumber>;
60
+ check_suite_node_id: z.ZodOptional<z.ZodString>;
61
+ check_suite_url: z.ZodOptional<z.ZodString>;
62
+ display_title: z.ZodOptional<z.ZodString>;
63
+ event: z.ZodOptional<z.ZodString>;
64
+ head_commit: z.ZodOptional<z.ZodUnknown>;
65
+ head_repository: z.ZodOptional<z.ZodUnknown>;
66
+ head_sha: z.ZodOptional<z.ZodString>;
67
+ html_url: z.ZodOptional<z.ZodString>;
68
+ jobs_url: z.ZodOptional<z.ZodString>;
69
+ logs_url: z.ZodOptional<z.ZodString>;
70
+ node_id: z.ZodOptional<z.ZodString>;
71
+ path: z.ZodOptional<z.ZodString>;
72
+ previous_attempt_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ pull_requests: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
74
+ referenced_workflows: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
75
+ repository: z.ZodOptional<z.ZodUnknown>;
76
+ rerun_url: z.ZodOptional<z.ZodString>;
77
+ run_number: z.ZodOptional<z.ZodNumber>;
78
+ run_started_at: z.ZodOptional<z.ZodISODateTime>;
79
+ triggering_actor: z.ZodOptional<z.ZodObject<{
80
+ login: z.ZodString;
81
+ }, z.core.$strip>>;
82
+ url: z.ZodOptional<z.ZodString>;
83
+ workflow_id: z.ZodOptional<z.ZodNumber>;
84
+ workflow_url: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strip>;
87
+ };
88
+ };
89
+ readonly pull_request: {
90
+ readonly shape: "entity";
91
+ readonly description: "Open and closed pull requests, including draft state, author, and review state.";
92
+ readonly endpoint: "GET /repos/{owner}/{repo}/pulls";
93
+ readonly notes: "Review state is folded in from GET /repos/{owner}/{repo}/pulls/{number}/reviews per PR.";
94
+ readonly responses: {
95
+ readonly pull_requests: z.ZodArray<z.ZodObject<{
96
+ number: z.ZodNumber;
97
+ title: z.ZodString;
98
+ state: z.ZodString;
99
+ draft: z.ZodBoolean;
100
+ user: z.ZodObject<{
101
+ login: z.ZodString;
102
+ avatar_url: z.ZodOptional<z.ZodString>;
103
+ events_url: z.ZodOptional<z.ZodString>;
104
+ followers_url: z.ZodOptional<z.ZodString>;
105
+ following_url: z.ZodOptional<z.ZodString>;
106
+ gists_url: z.ZodOptional<z.ZodString>;
107
+ gravatar_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
+ html_url: z.ZodOptional<z.ZodString>;
109
+ id: z.ZodOptional<z.ZodNumber>;
110
+ node_id: z.ZodOptional<z.ZodString>;
111
+ organizations_url: z.ZodOptional<z.ZodString>;
112
+ received_events_url: z.ZodOptional<z.ZodString>;
113
+ repos_url: z.ZodOptional<z.ZodString>;
114
+ site_admin: z.ZodOptional<z.ZodBoolean>;
115
+ starred_url: z.ZodOptional<z.ZodString>;
116
+ subscriptions_url: z.ZodOptional<z.ZodString>;
117
+ type: z.ZodOptional<z.ZodString>;
118
+ url: z.ZodOptional<z.ZodString>;
119
+ user_view_type: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ created_at: z.ZodISODateTime;
122
+ updated_at: z.ZodISODateTime;
123
+ _links: z.ZodOptional<z.ZodUnknown>;
124
+ active_lock_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
+ assignee: z.ZodOptional<z.ZodUnknown>;
126
+ assignees: z.ZodOptional<z.ZodUnknown>;
127
+ author_association: z.ZodOptional<z.ZodString>;
128
+ auto_merge: z.ZodOptional<z.ZodUnknown>;
129
+ base: z.ZodOptional<z.ZodUnknown>;
130
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
+ closed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
+ comments_url: z.ZodOptional<z.ZodString>;
133
+ commits_url: z.ZodOptional<z.ZodString>;
134
+ diff_url: z.ZodOptional<z.ZodString>;
135
+ head: z.ZodOptional<z.ZodUnknown>;
136
+ html_url: z.ZodOptional<z.ZodString>;
137
+ id: z.ZodOptional<z.ZodNumber>;
138
+ issue_url: z.ZodOptional<z.ZodString>;
139
+ labels: z.ZodOptional<z.ZodUnknown>;
140
+ locked: z.ZodOptional<z.ZodBoolean>;
141
+ merge_commit_sha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ merged_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
+ milestone: z.ZodOptional<z.ZodUnknown>;
144
+ node_id: z.ZodOptional<z.ZodString>;
145
+ patch_url: z.ZodOptional<z.ZodString>;
146
+ requested_reviewers: z.ZodOptional<z.ZodUnknown>;
147
+ requested_teams: z.ZodOptional<z.ZodUnknown>;
148
+ review_comment_url: z.ZodOptional<z.ZodString>;
149
+ review_comments_url: z.ZodOptional<z.ZodString>;
150
+ statuses_url: z.ZodOptional<z.ZodString>;
151
+ url: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>>;
153
+ readonly pull_request_reviews: z.ZodArray<z.ZodObject<{
154
+ user: z.ZodNullable<z.ZodObject<{
155
+ login: z.ZodString;
156
+ }, z.core.$strip>>;
157
+ state: z.ZodString;
158
+ submitted_at: z.ZodISODateTime;
159
+ }, z.core.$strip>>;
160
+ };
161
+ };
162
+ readonly issue: {
163
+ readonly shape: "entity";
164
+ readonly description: "Open and closed issues with labels, assignees, and author (pull requests excluded).";
165
+ readonly endpoint: "GET /repos/{owner}/{repo}/issues";
166
+ readonly responses: {
167
+ readonly issues: z.ZodArray<z.ZodObject<{
168
+ number: z.ZodNumber;
169
+ title: z.ZodString;
170
+ state: z.ZodString;
171
+ labels: z.ZodArray<z.ZodObject<{
172
+ name: z.ZodString;
173
+ }, z.core.$strip>>;
174
+ assignees: z.ZodArray<z.ZodObject<{
175
+ login: z.ZodString;
176
+ }, z.core.$strip>>;
177
+ user: z.ZodObject<{
178
+ login: z.ZodString;
179
+ }, z.core.$catchall<z.ZodUnknown>>;
180
+ created_at: z.ZodISODateTime;
181
+ updated_at: z.ZodISODateTime;
182
+ closed_at: z.ZodNullable<z.ZodISODateTime>;
183
+ pull_request: z.ZodOptional<z.ZodUnknown>;
184
+ active_lock_reason: z.ZodOptional<z.ZodUnknown>;
185
+ assignee: z.ZodOptional<z.ZodUnknown>;
186
+ author_association: z.ZodOptional<z.ZodString>;
187
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
+ closed_by: z.ZodOptional<z.ZodUnknown>;
189
+ comments: z.ZodOptional<z.ZodNumber>;
190
+ comments_url: z.ZodOptional<z.ZodString>;
191
+ draft: z.ZodOptional<z.ZodBoolean>;
192
+ events_url: z.ZodOptional<z.ZodString>;
193
+ html_url: z.ZodOptional<z.ZodString>;
194
+ id: z.ZodOptional<z.ZodNumber>;
195
+ issue_field_values: z.ZodOptional<z.ZodUnknown>;
196
+ labels_url: z.ZodOptional<z.ZodString>;
197
+ locked: z.ZodOptional<z.ZodBoolean>;
198
+ milestone: z.ZodOptional<z.ZodUnknown>;
199
+ node_id: z.ZodOptional<z.ZodString>;
200
+ performed_via_github_app: z.ZodOptional<z.ZodUnknown>;
201
+ reactions: z.ZodOptional<z.ZodUnknown>;
202
+ repository_url: z.ZodOptional<z.ZodString>;
203
+ state_reason: z.ZodOptional<z.ZodUnknown>;
204
+ timeline_url: z.ZodOptional<z.ZodString>;
205
+ type: z.ZodOptional<z.ZodUnknown>;
206
+ url: z.ZodOptional<z.ZodString>;
207
+ }, z.core.$strip>>;
208
+ };
209
+ };
210
+ readonly deployment: {
211
+ readonly shape: "entity";
212
+ readonly description: "Deployments with their latest status, keyed by environment and ref.";
213
+ readonly endpoint: "GET /repos/{owner}/{repo}/deployments";
214
+ readonly notes: "The latest status is folded in from GET /repos/{owner}/{repo}/deployments/{id}/statuses.";
215
+ readonly responses: {
216
+ readonly deployments: z.ZodArray<z.ZodObject<{
217
+ id: z.ZodNumber;
218
+ environment: z.ZodString;
219
+ ref: z.ZodString;
220
+ sha: z.ZodString;
221
+ creator: z.ZodNullable<z.ZodObject<{
222
+ login: z.ZodString;
223
+ }, z.core.$strip>>;
224
+ created_at: z.ZodISODateTime;
225
+ }, z.core.$strip>>;
226
+ readonly deployment_statuses: z.ZodArray<z.ZodObject<{
227
+ state: z.ZodString;
228
+ updated_at: z.ZodISODateTime;
229
+ }, z.core.$strip>>;
230
+ };
231
+ };
232
+ readonly release: {
233
+ readonly shape: "entity";
234
+ readonly description: "Published, draft, and prerelease GitHub releases.";
235
+ readonly endpoint: "GET /repos/{owner}/{repo}/releases";
236
+ readonly responses: {
237
+ readonly releases: z.ZodArray<z.ZodObject<{
238
+ id: z.ZodNumber;
239
+ tag_name: z.ZodString;
240
+ name: z.ZodNullable<z.ZodString>;
241
+ draft: z.ZodBoolean;
242
+ prerelease: z.ZodBoolean;
243
+ created_at: z.ZodISODateTime;
244
+ published_at: z.ZodNullable<z.ZodISODateTime>;
245
+ author: z.ZodObject<{
246
+ login: z.ZodString;
247
+ }, z.core.$strip>;
248
+ }, z.core.$strip>>;
249
+ };
250
+ };
251
+ readonly contributor: {
252
+ readonly shape: "entity";
253
+ readonly description: "Per-author commit activity (commits, additions, deletions) for the repository.";
254
+ readonly endpoint: "GET /repos/{owner}/{repo}/stats/contributors";
255
+ readonly responses: {
256
+ readonly contributors: z.ZodArray<z.ZodObject<{
257
+ total: z.ZodNumber;
258
+ weeks: z.ZodArray<z.ZodObject<{
259
+ w: z.ZodNumber;
260
+ a: z.ZodNumber;
261
+ d: z.ZodNumber;
262
+ c: z.ZodNumber;
263
+ }, z.core.$strip>>;
264
+ author: z.ZodObject<{
265
+ login: z.ZodString;
266
+ }, z.core.$strip>;
267
+ }, z.core.$strip>>;
268
+ };
269
+ };
270
+ };
271
+ static readonly schemas: {
272
+ readonly repo: z.ZodObject<{
273
+ stargazers_count: z.ZodNumber;
274
+ forks_count: z.ZodNumber;
275
+ subscribers_count: z.ZodNumber;
276
+ }, z.core.$strip>;
277
+ } & {
278
+ readonly workflow_runs: z.ZodObject<{
279
+ total_count: z.ZodOptional<z.ZodNumber>;
280
+ workflow_runs: z.ZodArray<z.ZodObject<{
281
+ id: z.ZodNumber;
282
+ name: z.ZodString;
283
+ conclusion: z.ZodNullable<z.ZodString>;
284
+ status: z.ZodString;
285
+ head_branch: z.ZodNullable<z.ZodString>;
286
+ actor: z.ZodNullable<z.ZodObject<{
287
+ login: z.ZodString;
288
+ }, z.core.$strip>>;
289
+ created_at: z.ZodISODateTime;
290
+ updated_at: z.ZodISODateTime;
291
+ run_attempt: z.ZodNumber;
292
+ artifacts_url: z.ZodOptional<z.ZodString>;
293
+ cancel_url: z.ZodOptional<z.ZodString>;
294
+ check_suite_id: z.ZodOptional<z.ZodNumber>;
295
+ check_suite_node_id: z.ZodOptional<z.ZodString>;
296
+ check_suite_url: z.ZodOptional<z.ZodString>;
297
+ display_title: z.ZodOptional<z.ZodString>;
298
+ event: z.ZodOptional<z.ZodString>;
299
+ head_commit: z.ZodOptional<z.ZodUnknown>;
300
+ head_repository: z.ZodOptional<z.ZodUnknown>;
301
+ head_sha: z.ZodOptional<z.ZodString>;
302
+ html_url: z.ZodOptional<z.ZodString>;
303
+ jobs_url: z.ZodOptional<z.ZodString>;
304
+ logs_url: z.ZodOptional<z.ZodString>;
305
+ node_id: z.ZodOptional<z.ZodString>;
306
+ path: z.ZodOptional<z.ZodString>;
307
+ previous_attempt_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
308
+ pull_requests: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
309
+ referenced_workflows: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
310
+ repository: z.ZodOptional<z.ZodUnknown>;
311
+ rerun_url: z.ZodOptional<z.ZodString>;
312
+ run_number: z.ZodOptional<z.ZodNumber>;
313
+ run_started_at: z.ZodOptional<z.ZodISODateTime>;
314
+ triggering_actor: z.ZodOptional<z.ZodObject<{
315
+ login: z.ZodString;
316
+ }, z.core.$strip>>;
317
+ url: z.ZodOptional<z.ZodString>;
318
+ workflow_id: z.ZodOptional<z.ZodNumber>;
319
+ workflow_url: z.ZodOptional<z.ZodString>;
320
+ }, z.core.$strip>>;
321
+ }, z.core.$strip>;
322
+ } & {
323
+ readonly pull_requests: z.ZodArray<z.ZodObject<{
324
+ number: z.ZodNumber;
325
+ title: z.ZodString;
326
+ state: z.ZodString;
327
+ draft: z.ZodBoolean;
328
+ user: z.ZodObject<{
329
+ login: z.ZodString;
330
+ avatar_url: z.ZodOptional<z.ZodString>;
331
+ events_url: z.ZodOptional<z.ZodString>;
332
+ followers_url: z.ZodOptional<z.ZodString>;
333
+ following_url: z.ZodOptional<z.ZodString>;
334
+ gists_url: z.ZodOptional<z.ZodString>;
335
+ gravatar_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
336
+ html_url: z.ZodOptional<z.ZodString>;
337
+ id: z.ZodOptional<z.ZodNumber>;
338
+ node_id: z.ZodOptional<z.ZodString>;
339
+ organizations_url: z.ZodOptional<z.ZodString>;
340
+ received_events_url: z.ZodOptional<z.ZodString>;
341
+ repos_url: z.ZodOptional<z.ZodString>;
342
+ site_admin: z.ZodOptional<z.ZodBoolean>;
343
+ starred_url: z.ZodOptional<z.ZodString>;
344
+ subscriptions_url: z.ZodOptional<z.ZodString>;
345
+ type: z.ZodOptional<z.ZodString>;
346
+ url: z.ZodOptional<z.ZodString>;
347
+ user_view_type: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ created_at: z.ZodISODateTime;
350
+ updated_at: z.ZodISODateTime;
351
+ _links: z.ZodOptional<z.ZodUnknown>;
352
+ active_lock_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
353
+ assignee: z.ZodOptional<z.ZodUnknown>;
354
+ assignees: z.ZodOptional<z.ZodUnknown>;
355
+ author_association: z.ZodOptional<z.ZodString>;
356
+ auto_merge: z.ZodOptional<z.ZodUnknown>;
357
+ base: z.ZodOptional<z.ZodUnknown>;
358
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ closed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
+ comments_url: z.ZodOptional<z.ZodString>;
361
+ commits_url: z.ZodOptional<z.ZodString>;
362
+ diff_url: z.ZodOptional<z.ZodString>;
363
+ head: z.ZodOptional<z.ZodUnknown>;
364
+ html_url: z.ZodOptional<z.ZodString>;
365
+ id: z.ZodOptional<z.ZodNumber>;
366
+ issue_url: z.ZodOptional<z.ZodString>;
367
+ labels: z.ZodOptional<z.ZodUnknown>;
368
+ locked: z.ZodOptional<z.ZodBoolean>;
369
+ merge_commit_sha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
370
+ merged_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
371
+ milestone: z.ZodOptional<z.ZodUnknown>;
372
+ node_id: z.ZodOptional<z.ZodString>;
373
+ patch_url: z.ZodOptional<z.ZodString>;
374
+ requested_reviewers: z.ZodOptional<z.ZodUnknown>;
375
+ requested_teams: z.ZodOptional<z.ZodUnknown>;
376
+ review_comment_url: z.ZodOptional<z.ZodString>;
377
+ review_comments_url: z.ZodOptional<z.ZodString>;
378
+ statuses_url: z.ZodOptional<z.ZodString>;
379
+ url: z.ZodOptional<z.ZodString>;
380
+ }, z.core.$strip>>;
381
+ readonly pull_request_reviews: z.ZodArray<z.ZodObject<{
382
+ user: z.ZodNullable<z.ZodObject<{
383
+ login: z.ZodString;
384
+ }, z.core.$strip>>;
385
+ state: z.ZodString;
386
+ submitted_at: z.ZodISODateTime;
387
+ }, z.core.$strip>>;
388
+ } & {
389
+ readonly issues: z.ZodArray<z.ZodObject<{
390
+ number: z.ZodNumber;
391
+ title: z.ZodString;
392
+ state: z.ZodString;
393
+ labels: z.ZodArray<z.ZodObject<{
394
+ name: z.ZodString;
395
+ }, z.core.$strip>>;
396
+ assignees: z.ZodArray<z.ZodObject<{
397
+ login: z.ZodString;
398
+ }, z.core.$strip>>;
399
+ user: z.ZodObject<{
400
+ login: z.ZodString;
401
+ }, z.core.$catchall<z.ZodUnknown>>;
402
+ created_at: z.ZodISODateTime;
403
+ updated_at: z.ZodISODateTime;
404
+ closed_at: z.ZodNullable<z.ZodISODateTime>;
405
+ pull_request: z.ZodOptional<z.ZodUnknown>;
406
+ active_lock_reason: z.ZodOptional<z.ZodUnknown>;
407
+ assignee: z.ZodOptional<z.ZodUnknown>;
408
+ author_association: z.ZodOptional<z.ZodString>;
409
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
410
+ closed_by: z.ZodOptional<z.ZodUnknown>;
411
+ comments: z.ZodOptional<z.ZodNumber>;
412
+ comments_url: z.ZodOptional<z.ZodString>;
413
+ draft: z.ZodOptional<z.ZodBoolean>;
414
+ events_url: z.ZodOptional<z.ZodString>;
415
+ html_url: z.ZodOptional<z.ZodString>;
416
+ id: z.ZodOptional<z.ZodNumber>;
417
+ issue_field_values: z.ZodOptional<z.ZodUnknown>;
418
+ labels_url: z.ZodOptional<z.ZodString>;
419
+ locked: z.ZodOptional<z.ZodBoolean>;
420
+ milestone: z.ZodOptional<z.ZodUnknown>;
421
+ node_id: z.ZodOptional<z.ZodString>;
422
+ performed_via_github_app: z.ZodOptional<z.ZodUnknown>;
423
+ reactions: z.ZodOptional<z.ZodUnknown>;
424
+ repository_url: z.ZodOptional<z.ZodString>;
425
+ state_reason: z.ZodOptional<z.ZodUnknown>;
426
+ timeline_url: z.ZodOptional<z.ZodString>;
427
+ type: z.ZodOptional<z.ZodUnknown>;
428
+ url: z.ZodOptional<z.ZodString>;
429
+ }, z.core.$strip>>;
430
+ } & {
431
+ readonly deployments: z.ZodArray<z.ZodObject<{
432
+ id: z.ZodNumber;
433
+ environment: z.ZodString;
434
+ ref: z.ZodString;
435
+ sha: z.ZodString;
436
+ creator: z.ZodNullable<z.ZodObject<{
437
+ login: z.ZodString;
438
+ }, z.core.$strip>>;
439
+ created_at: z.ZodISODateTime;
440
+ }, z.core.$strip>>;
441
+ readonly deployment_statuses: z.ZodArray<z.ZodObject<{
442
+ state: z.ZodString;
443
+ updated_at: z.ZodISODateTime;
444
+ }, z.core.$strip>>;
445
+ } & {
446
+ readonly releases: z.ZodArray<z.ZodObject<{
447
+ id: z.ZodNumber;
448
+ tag_name: z.ZodString;
449
+ name: z.ZodNullable<z.ZodString>;
450
+ draft: z.ZodBoolean;
451
+ prerelease: z.ZodBoolean;
452
+ created_at: z.ZodISODateTime;
453
+ published_at: z.ZodNullable<z.ZodISODateTime>;
454
+ author: z.ZodObject<{
455
+ login: z.ZodString;
456
+ }, z.core.$strip>;
457
+ }, z.core.$strip>>;
458
+ } & {
459
+ readonly contributors: z.ZodArray<z.ZodObject<{
460
+ total: z.ZodNumber;
461
+ weeks: z.ZodArray<z.ZodObject<{
462
+ w: z.ZodNumber;
463
+ a: z.ZodNumber;
464
+ d: z.ZodNumber;
465
+ c: z.ZodNumber;
466
+ }, z.core.$strip>>;
467
+ author: z.ZodObject<{
468
+ login: z.ZodString;
469
+ }, z.core.$strip>;
470
+ }, z.core.$strip>>;
471
+ } & Readonly<Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
24
472
  static create(input: unknown, ctx?: ConnectorContext): GitHubConnector;
25
473
  readonly id = "github-actions";
26
474
  readonly credentials: {
@@ -30,10 +478,12 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
30
478
  };
31
479
  };
32
480
  private seenWorkflowRunIds;
481
+ private preservedDeploymentStatus;
33
482
  private buildHeaders;
34
483
  private fetch;
35
484
  private allowedPageBasePath;
36
485
  private sanitizePageUrl;
486
+ private isResourceAllowed;
37
487
  private resolveCursor;
38
488
  private fetchRepoStats;
39
489
  private fetchWorkflowRunsLatest;
@@ -54,4 +504,4 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
54
504
  sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<SyncResult>;
55
505
  }
56
506
 
57
- export { GitHubConnector, type GitHubSettings, configFields, GitHubConnector as default };
507
+ export { GitHubConnector, type GitHubSettings, configFields, GitHubConnector as default, doc };