@rawdash/connector-github 0.15.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 +48 -64
- package/dist/index.d.ts +359 -4
- package/dist/index.js +367 -94
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
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
|
[](https://www.npmjs.com/package/@rawdash/connector-github)
|
|
4
6
|
[](https://github.com/rawdash/rawdash/blob/main/LICENSE)
|
|
5
7
|
|
|
6
|
-
|
|
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
|
-
##
|
|
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,
|
|
@@ -32,7 +64,7 @@ const github = {
|
|
|
32
64
|
config: {
|
|
33
65
|
owner: 'my-org',
|
|
34
66
|
repo: 'my-repo',
|
|
35
|
-
token: secret('GITHUB_TOKEN'),
|
|
67
|
+
token: secret('GITHUB_TOKEN'),
|
|
36
68
|
},
|
|
37
69
|
};
|
|
38
70
|
|
|
@@ -47,79 +79,31 @@ export default defineConfig({
|
|
|
47
79
|
metric: defineMetric({
|
|
48
80
|
connector: github,
|
|
49
81
|
shape: 'entity',
|
|
50
|
-
|
|
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.name}:workflow_runs`,
|
|
59
|
-
},
|
|
60
87
|
},
|
|
61
88
|
}),
|
|
62
89
|
},
|
|
63
90
|
});
|
|
64
|
-
|
|
65
|
-
// Wire the registry separately when mounting:
|
|
66
|
-
// mountEngine(config, { connectorRegistry: { 'github-actions': GitHubConnector } });
|
|
67
91
|
```
|
|
68
92
|
|
|
69
|
-
##
|
|
70
|
-
|
|
71
|
-
| Field | Type | Required | Description |
|
|
72
|
-
| ------- | -------- | -------- | --------------------------------------------------------------------------------- |
|
|
73
|
-
| `owner` | `string` | Yes | GitHub username or organization name |
|
|
74
|
-
| `repo` | `string` | Yes | Repository name |
|
|
75
|
-
| `token` | `Secret` | No | GitHub PAT with `repo` scope. Required for private repos and to avoid rate limits |
|
|
76
|
-
|
|
77
|
-
## Data synced
|
|
78
|
-
|
|
79
|
-
- **Workflow runs** — CI pipeline executions (shape: `event`)
|
|
80
|
-
- **Pull requests** — open and closed PRs with review state (shape: `entity`)
|
|
81
|
-
- **Issues** — open and closed issues with labels and assignees (shape: `entity`)
|
|
82
|
-
- **Deployments** — deployment events and statuses (shape: `event`)
|
|
83
|
-
- **Releases** — published GitHub releases (shape: `event`)
|
|
84
|
-
- **Contributors** — commit activity per author (shape: `metric`)
|
|
85
|
-
|
|
86
|
-
## Schemas
|
|
87
|
-
|
|
88
|
-
`GitHubConnector.schemas` declares the Zod schema for each resource's raw API response. The cloud shape-drift pipeline reads these at deploy time to populate `connector_baselines`, and the package's property tests fuzz against them.
|
|
89
|
-
|
|
90
|
-
| Resource | Represents |
|
|
91
|
-
| ---------------------- | ----------------------------------------------------- |
|
|
92
|
-
| `repo` | `GET /repos/{owner}/{repo}` — top-level repo stats |
|
|
93
|
-
| `workflow_runs` | `GET /repos/{owner}/{repo}/actions/runs` page |
|
|
94
|
-
| `pull_requests` | `GET /repos/{owner}/{repo}/pulls` page |
|
|
95
|
-
| `pull_request_reviews` | `GET /repos/{owner}/{repo}/pulls/{n}/reviews` |
|
|
96
|
-
| `issues` | `GET /repos/{owner}/{repo}/issues` page |
|
|
97
|
-
| `deployments` | `GET /repos/{owner}/{repo}/deployments` page |
|
|
98
|
-
| `deployment_statuses` | `GET /repos/{owner}/{repo}/deployments/{id}/statuses` |
|
|
99
|
-
| `releases` | `GET /repos/{owner}/{repo}/releases` page |
|
|
100
|
-
| `contributors` | `GET /repos/{owner}/{repo}/stats/contributors` |
|
|
101
|
-
|
|
102
|
-
## Duplicate handling
|
|
103
|
-
|
|
104
|
-
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.
|
|
105
|
-
|
|
106
|
-
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.
|
|
107
|
-
|
|
108
|
-
## Property tests
|
|
93
|
+
## Rate limits
|
|
109
94
|
|
|
110
|
-
|
|
95
|
+
Unauthenticated requests share GitHub’s low 60 requests/hour limit; an authenticated token raises it to 5,000 requests/hour.
|
|
111
96
|
|
|
112
|
-
|
|
113
|
-
2. Pipes them through `connector.sync()` against an `InMemoryStorage` instance.
|
|
114
|
-
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
|
|
115
98
|
|
|
116
|
-
The
|
|
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.
|
|
117
101
|
|
|
118
102
|
## Links
|
|
119
103
|
|
|
120
|
-
- [
|
|
104
|
+
- [Rawdash docs](https://rawdash.dev/docs/connectors/)
|
|
105
|
+
- [GitHub API docs](https://docs.github.com/rest)
|
|
121
106
|
- [GitHub](https://github.com/rawdash/rawdash)
|
|
122
|
-
- [Issues](https://github.com/rawdash/rawdash/issues)
|
|
123
107
|
|
|
124
108
|
## License
|
|
125
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,13 +22,261 @@ 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
|
+
};
|
|
24
271
|
static readonly schemas: {
|
|
25
272
|
readonly repo: z.ZodObject<{
|
|
26
273
|
stargazers_count: z.ZodNumber;
|
|
27
274
|
forks_count: z.ZodNumber;
|
|
28
275
|
subscribers_count: z.ZodNumber;
|
|
29
276
|
}, z.core.$strip>;
|
|
277
|
+
} & {
|
|
30
278
|
readonly workflow_runs: z.ZodObject<{
|
|
279
|
+
total_count: z.ZodOptional<z.ZodNumber>;
|
|
31
280
|
workflow_runs: z.ZodArray<z.ZodObject<{
|
|
32
281
|
id: z.ZodNumber;
|
|
33
282
|
name: z.ZodString;
|
|
@@ -40,8 +289,37 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
40
289
|
created_at: z.ZodISODateTime;
|
|
41
290
|
updated_at: z.ZodISODateTime;
|
|
42
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>;
|
|
43
320
|
}, z.core.$strip>>;
|
|
44
321
|
}, z.core.$strip>;
|
|
322
|
+
} & {
|
|
45
323
|
readonly pull_requests: z.ZodArray<z.ZodObject<{
|
|
46
324
|
number: z.ZodNumber;
|
|
47
325
|
title: z.ZodString;
|
|
@@ -49,9 +327,56 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
49
327
|
draft: z.ZodBoolean;
|
|
50
328
|
user: z.ZodObject<{
|
|
51
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>;
|
|
52
348
|
}, z.core.$strip>;
|
|
53
349
|
created_at: z.ZodISODateTime;
|
|
54
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>;
|
|
55
380
|
}, z.core.$strip>>;
|
|
56
381
|
readonly pull_request_reviews: z.ZodArray<z.ZodObject<{
|
|
57
382
|
user: z.ZodNullable<z.ZodObject<{
|
|
@@ -60,6 +385,7 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
60
385
|
state: z.ZodString;
|
|
61
386
|
submitted_at: z.ZodISODateTime;
|
|
62
387
|
}, z.core.$strip>>;
|
|
388
|
+
} & {
|
|
63
389
|
readonly issues: z.ZodArray<z.ZodObject<{
|
|
64
390
|
number: z.ZodNumber;
|
|
65
391
|
title: z.ZodString;
|
|
@@ -72,11 +398,36 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
72
398
|
}, z.core.$strip>>;
|
|
73
399
|
user: z.ZodObject<{
|
|
74
400
|
login: z.ZodString;
|
|
75
|
-
}, z.core.$
|
|
401
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
76
402
|
created_at: z.ZodISODateTime;
|
|
77
403
|
updated_at: z.ZodISODateTime;
|
|
78
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>;
|
|
79
429
|
}, z.core.$strip>>;
|
|
430
|
+
} & {
|
|
80
431
|
readonly deployments: z.ZodArray<z.ZodObject<{
|
|
81
432
|
id: z.ZodNumber;
|
|
82
433
|
environment: z.ZodString;
|
|
@@ -91,6 +442,7 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
91
442
|
state: z.ZodString;
|
|
92
443
|
updated_at: z.ZodISODateTime;
|
|
93
444
|
}, z.core.$strip>>;
|
|
445
|
+
} & {
|
|
94
446
|
readonly releases: z.ZodArray<z.ZodObject<{
|
|
95
447
|
id: z.ZodNumber;
|
|
96
448
|
tag_name: z.ZodString;
|
|
@@ -103,6 +455,7 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
103
455
|
login: z.ZodString;
|
|
104
456
|
}, z.core.$strip>;
|
|
105
457
|
}, z.core.$strip>>;
|
|
458
|
+
} & {
|
|
106
459
|
readonly contributors: z.ZodArray<z.ZodObject<{
|
|
107
460
|
total: z.ZodNumber;
|
|
108
461
|
weeks: z.ZodArray<z.ZodObject<{
|
|
@@ -115,7 +468,7 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
115
468
|
login: z.ZodString;
|
|
116
469
|
}, z.core.$strip>;
|
|
117
470
|
}, z.core.$strip>>;
|
|
118
|
-
}
|
|
471
|
+
} & Readonly<Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
119
472
|
static create(input: unknown, ctx?: ConnectorContext): GitHubConnector;
|
|
120
473
|
readonly id = "github-actions";
|
|
121
474
|
readonly credentials: {
|
|
@@ -125,10 +478,12 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
125
478
|
};
|
|
126
479
|
};
|
|
127
480
|
private seenWorkflowRunIds;
|
|
481
|
+
private preservedDeploymentStatus;
|
|
128
482
|
private buildHeaders;
|
|
129
483
|
private fetch;
|
|
130
484
|
private allowedPageBasePath;
|
|
131
485
|
private sanitizePageUrl;
|
|
486
|
+
private isResourceAllowed;
|
|
132
487
|
private resolveCursor;
|
|
133
488
|
private fetchRepoStats;
|
|
134
489
|
private fetchWorkflowRunsLatest;
|
|
@@ -149,4 +504,4 @@ declare class GitHubConnector extends BaseConnector<GitHubSettings, GitHubCreden
|
|
|
149
504
|
sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<SyncResult>;
|
|
150
505
|
}
|
|
151
506
|
|
|
152
|
-
export { GitHubConnector, type GitHubSettings, configFields, GitHubConnector as default };
|
|
507
|
+
export { GitHubConnector, type GitHubSettings, configFields, GitHubConnector as default, doc };
|