@framers/agentos-ext-github 0.3.1 → 0.4.1
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 +6 -4
- package/dist/__tests__/app.test.js +75 -0
- package/dist/__tests__/app.test.js.map +1 -1
- package/dist/__tests__/documents.test.d.ts +2 -1
- package/dist/__tests__/documents.test.d.ts.map +1 -1
- package/dist/__tests__/documents.test.js +95 -2
- package/dist/__tests__/documents.test.js.map +1 -1
- package/dist/app/http.d.ts +15 -2
- package/dist/app/http.d.ts.map +1 -1
- package/dist/app/http.js +41 -5
- package/dist/app/http.js.map +1 -1
- package/dist/app/userFlow.d.ts +9 -4
- package/dist/app/userFlow.d.ts.map +1 -1
- package/dist/app/userFlow.js +44 -23
- package/dist/app/userFlow.js.map +1 -1
- package/dist/documents/GitHubDocumentsConnector.d.ts +29 -13
- package/dist/documents/GitHubDocumentsConnector.d.ts.map +1 -1
- package/dist/documents/GitHubDocumentsConnector.js +88 -20
- package/dist/documents/GitHubDocumentsConnector.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
package/dist/app/http.d.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* carries, the pages of a listing followed through its `Link` header, and the small readers that turn an answer into
|
|
4
4
|
* typed fields. An answer outside 2xx throws {@link GitHubApiError}, whose message names the status and nothing of
|
|
5
5
|
* the answer's body and which says whether GitHub refused for a rate limit and when to try again; a call that gets no
|
|
6
|
-
* answer throws {@link GitHubNoAnswer}
|
|
6
|
+
* answer by its deadline throws {@link GitHubNoAnswer}, whatever the fetch does with the signal it is handed. An
|
|
7
|
+
* answer's body is read under a byte cap.
|
|
7
8
|
* @module agentos-ext-github/app/http
|
|
8
9
|
*/
|
|
9
10
|
/** The REST API version every call pins (`X-GitHub-Api-Version`). */
|
|
@@ -90,6 +91,17 @@ export interface CallDeadline {
|
|
|
90
91
|
* @param timeoutMs How long the call may take; {@link GITHUB_TIMEOUT_MS} when absent.
|
|
91
92
|
*/
|
|
92
93
|
export declare function callDeadline(signal: AbortSignal | undefined, timeoutMs?: number): CallDeadline;
|
|
94
|
+
/**
|
|
95
|
+
* Settles as `work` does, or throws the call's {@link GitHubNoAnswer} once its deadline passes or its caller cancels,
|
|
96
|
+
* whichever comes first. A fetch ends its request and its answer's body when the signal it was handed aborts; this
|
|
97
|
+
* holds a call to its deadline also through a fetch that does not. Work still under way at the deadline is left to
|
|
98
|
+
* settle unobserved, and `release` is handed what it answers after, such as a response whose body is to be let go.
|
|
99
|
+
*
|
|
100
|
+
* @param work The request or the body read under way.
|
|
101
|
+
* @param deadline The call's deadline.
|
|
102
|
+
* @param release Takes what `work` answers once the deadline has ended the call.
|
|
103
|
+
*/
|
|
104
|
+
export declare function untilDeadline<T>(work: Promise<T>, deadline: CallDeadline, release?: (late: T) => void): Promise<T>;
|
|
93
105
|
/** A 2xx answer, and its body read under the call's deadline. */
|
|
94
106
|
export interface GitHubAnswer {
|
|
95
107
|
readonly response: Response;
|
|
@@ -102,7 +114,8 @@ export interface GitHubAnswer {
|
|
|
102
114
|
/**
|
|
103
115
|
* Sends one call under its deadline and the caller's signal. An answer outside 2xx is read only as far as telling a
|
|
104
116
|
* rate limit needs and thrown as {@link GitHubApiError}; a call that gets no answer, or whose refusal's body stops
|
|
105
|
-
* while it is read, throws {@link GitHubNoAnswer}.
|
|
117
|
+
* while it is read, throws {@link GitHubNoAnswer}. The request and every read of its answer's body end at the
|
|
118
|
+
* deadline or the caller's cancel, even through a fetch that leaves them open past its signal.
|
|
106
119
|
*/
|
|
107
120
|
export declare function githubSend(fetchImpl: typeof fetch, url: string, request: GitHubRequest): Promise<GitHubAnswer>;
|
|
108
121
|
/**
|
package/dist/app/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/app/http.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"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/app/http.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* carries, the pages of a listing followed through its `Link` header, and the small readers that turn an answer into
|
|
4
4
|
* typed fields. An answer outside 2xx throws {@link GitHubApiError}, whose message names the status and nothing of
|
|
5
5
|
* the answer's body and which says whether GitHub refused for a rate limit and when to try again; a call that gets no
|
|
6
|
-
* answer throws {@link GitHubNoAnswer}
|
|
6
|
+
* answer by its deadline throws {@link GitHubNoAnswer}, whatever the fetch does with the signal it is handed. An
|
|
7
|
+
* answer's body is read under a byte cap.
|
|
7
8
|
* @module agentos-ext-github/app/http
|
|
8
9
|
*/
|
|
9
10
|
import { readCapped, ReadCapExceeded } from '@framers/agentos-ext-account-sources';
|
|
@@ -89,6 +90,40 @@ export function callDeadline(signal, timeoutMs = GITHUB_TIMEOUT_MS) {
|
|
|
89
90
|
noAnswer: () => new GitHubNoAnswer(signal?.aborted === true ? 'cancelled' : timeout.aborted ? 'timeout' : 'network'),
|
|
90
91
|
};
|
|
91
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Settles as `work` does, or throws the call's {@link GitHubNoAnswer} once its deadline passes or its caller cancels,
|
|
95
|
+
* whichever comes first. A fetch ends its request and its answer's body when the signal it was handed aborts; this
|
|
96
|
+
* holds a call to its deadline also through a fetch that does not. Work still under way at the deadline is left to
|
|
97
|
+
* settle unobserved, and `release` is handed what it answers after, such as a response whose body is to be let go.
|
|
98
|
+
*
|
|
99
|
+
* @param work The request or the body read under way.
|
|
100
|
+
* @param deadline The call's deadline.
|
|
101
|
+
* @param release Takes what `work` answers once the deadline has ended the call.
|
|
102
|
+
*/
|
|
103
|
+
export function untilDeadline(work, deadline, release) {
|
|
104
|
+
const { signal } = deadline;
|
|
105
|
+
return new Promise((resolve, reject) => {
|
|
106
|
+
let ended = false;
|
|
107
|
+
const end = () => {
|
|
108
|
+
ended = true;
|
|
109
|
+
reject(deadline.noAnswer());
|
|
110
|
+
};
|
|
111
|
+
if (signal.aborted)
|
|
112
|
+
end();
|
|
113
|
+
else
|
|
114
|
+
signal.addEventListener('abort', end, { once: true });
|
|
115
|
+
work.then((value) => {
|
|
116
|
+
signal.removeEventListener('abort', end);
|
|
117
|
+
if (ended)
|
|
118
|
+
release?.(value);
|
|
119
|
+
else
|
|
120
|
+
resolve(value);
|
|
121
|
+
}, (error) => {
|
|
122
|
+
signal.removeEventListener('abort', end);
|
|
123
|
+
reject(error);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
92
127
|
/**
|
|
93
128
|
* True when a refused call's body names a rate limit, read up to {@link REFUSAL_READ_BYTES}; the body is never kept. A
|
|
94
129
|
* body that stops before its end (the deadline, the caller's cancel or the connection) throws the call's
|
|
@@ -97,7 +132,7 @@ export function callDeadline(signal, timeoutMs = GITHUB_TIMEOUT_MS) {
|
|
|
97
132
|
async function bodyNamesRateLimit(response, deadline) {
|
|
98
133
|
let bytes;
|
|
99
134
|
try {
|
|
100
|
-
bytes = await readCapped(response, REFUSAL_READ_BYTES);
|
|
135
|
+
bytes = await untilDeadline(readCapped(response, REFUSAL_READ_BYTES), deadline);
|
|
101
136
|
}
|
|
102
137
|
catch (error) {
|
|
103
138
|
// An oversized refusal is told by its status and headers alone.
|
|
@@ -155,7 +190,8 @@ async function refusalOf(response, deadline) {
|
|
|
155
190
|
/**
|
|
156
191
|
* Sends one call under its deadline and the caller's signal. An answer outside 2xx is read only as far as telling a
|
|
157
192
|
* rate limit needs and thrown as {@link GitHubApiError}; a call that gets no answer, or whose refusal's body stops
|
|
158
|
-
* while it is read, throws {@link GitHubNoAnswer}.
|
|
193
|
+
* while it is read, throws {@link GitHubNoAnswer}. The request and every read of its answer's body end at the
|
|
194
|
+
* deadline or the caller's cancel, even through a fetch that leaves them open past its signal.
|
|
159
195
|
*/
|
|
160
196
|
export async function githubSend(fetchImpl, url, request) {
|
|
161
197
|
const headers = githubHeaders(request.token, request.accept);
|
|
@@ -164,7 +200,7 @@ export async function githubSend(fetchImpl, url, request) {
|
|
|
164
200
|
const deadline = callDeadline(request.signal, request.timeoutMs);
|
|
165
201
|
let response;
|
|
166
202
|
try {
|
|
167
|
-
response = await fetchImpl(url, { method: request.method ?? 'GET', headers, body: request.body, signal: deadline.signal });
|
|
203
|
+
response = await untilDeadline(fetchImpl(url, { method: request.method ?? 'GET', headers, body: request.body, signal: deadline.signal }), deadline, (late) => void discardBody(late));
|
|
168
204
|
}
|
|
169
205
|
catch {
|
|
170
206
|
// The fetch's own error would name the address or its cause; the reason is all a caller acts on.
|
|
@@ -176,7 +212,7 @@ export async function githubSend(fetchImpl, url, request) {
|
|
|
176
212
|
response,
|
|
177
213
|
async bytes(maxBytes) {
|
|
178
214
|
try {
|
|
179
|
-
return await readCapped(response, maxBytes);
|
|
215
|
+
return await untilDeadline(readCapped(response, maxBytes), deadline);
|
|
180
216
|
}
|
|
181
217
|
catch (error) {
|
|
182
218
|
if (error instanceof ReadCapExceeded)
|
package/dist/app/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/app/http.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/app/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEnF,qEAAqE;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE/C,yBAAyB;AACzB,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC,kGAAkG;AAClG,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAElD,uFAAuF;AACvF,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,yFAAyF;AACzF,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAiClC;;;;;;GA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K,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,qBAAqB,GAAG,EAAE,CAAC,CAAC;IAClG,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/app/userFlow.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @fileoverview A GitHub App's user authorization on a web server: GitHub's authorize address with `state` and PKCE,
|
|
3
3
|
* and the code exchanged for a user access token, on the auth module's `RedirectOAuthFlow`. The token proves who the
|
|
4
4
|
* person is and which installations and repositories they can reach; it is used once, then revoked at GitHub and
|
|
5
|
-
* dropped, so the flow has no store. The exchange and the revocation
|
|
6
|
-
* whole under a cap before it is
|
|
5
|
+
* dropped, so the flow has no store. The exchange and the revocation end at their deadline; the token answer is read
|
|
6
|
+
* whole under a cap before it is parsed, and a revocation's answer is told by its status alone.
|
|
7
7
|
* @module agentos-ext-github/app/userFlow
|
|
8
8
|
*/
|
|
9
9
|
import { RedirectOAuthFlow, type RedirectBegin, type RedirectOAuthConfig } from '@framers/agentos/auth';
|
|
@@ -41,6 +41,10 @@ export declare class GitHubAppUserFlow extends RedirectOAuthFlow {
|
|
|
41
41
|
readonly providerId = "github";
|
|
42
42
|
/** GitHub's REST API, where `revoke` deletes a token. */
|
|
43
43
|
private readonly apiBase;
|
|
44
|
+
/** The fetch a revocation is sent with, as given: its answer is told by its status, its body never read. */
|
|
45
|
+
private readonly revocationFetch;
|
|
46
|
+
/** How long a revocation may take; {@link GITHUB_TIMEOUT_MS} when absent. */
|
|
47
|
+
private readonly revocationTimeoutMs;
|
|
44
48
|
/**
|
|
45
49
|
* @param client The app's client id and client secret.
|
|
46
50
|
* @param fetchImpl The fetch the code is exchanged and a token revoked with.
|
|
@@ -56,8 +60,9 @@ export declare class GitHubAppUserFlow extends RedirectOAuthFlow {
|
|
|
56
60
|
* Deletes a user access token at GitHub, so a token the caller is done with stops working at once instead of at its
|
|
57
61
|
* expiry: GitHub's "Delete an app token" (`DELETE /applications/{client_id}/token` with the token in a JSON body),
|
|
58
62
|
* authenticated as the app with Basic authentication, its client id and client secret
|
|
59
|
-
* (https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token). GitHub answers 204
|
|
60
|
-
* throws `OAuthGrantRefused` (reason `revoke`, its status)
|
|
63
|
+
* (https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token). GitHub answers 204, and 204 alone
|
|
64
|
+
* resolves: any other answer, another 2xx included, throws `OAuthGrantRefused` (reason `revoke`, its status), told
|
|
65
|
+
* by its status alone with its body released unread, however large or slow. A redirect is refused rather than
|
|
61
66
|
* followed so the client secret reaches GitHub's API alone, and a call that gets no answer by the flow's deadline
|
|
62
67
|
* throws `GitHubNoAnswer`.
|
|
63
68
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userFlow.d.ts","sourceRoot":"","sources":["../../src/app/userFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAqB,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG3H,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oEAAoE;AACpE,MAAM,WAAW,wBAAwB;IACvC,uHAAuH;IACvH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6HAA6H;IAC7H,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sDAAsD;AACtD,eAAO,MAAM,sBAAsB,EAAE,oBAGpC,CAAC;
|
|
1
|
+
{"version":3,"file":"userFlow.d.ts","sourceRoot":"","sources":["../../src/app/userFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAqB,iBAAiB,EAAE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I,CAAC;CA+BpD"}
|
package/dist/app/userFlow.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @fileoverview A GitHub App's user authorization on a web server: GitHub's authorize address with `state` and PKCE,
|
|
3
3
|
* and the code exchanged for a user access token, on the auth module's `RedirectOAuthFlow`. The token proves who the
|
|
4
4
|
* person is and which installations and repositories they can reach; it is used once, then revoked at GitHub and
|
|
5
|
-
* dropped, so the flow has no store. The exchange and the revocation
|
|
6
|
-
* whole under a cap before it is
|
|
5
|
+
* dropped, so the flow has no store. The exchange and the revocation end at their deadline; the token answer is read
|
|
6
|
+
* whole under a cap before it is parsed, and a revocation's answer is told by its status alone.
|
|
7
7
|
* @module agentos-ext-github/app/userFlow
|
|
8
8
|
*/
|
|
9
9
|
import { readCapped, ReadCapExceeded } from '@framers/agentos-ext-account-sources';
|
|
10
10
|
import { OAuthGrantRefused, RedirectOAuthFlow } from '@framers/agentos/auth';
|
|
11
|
-
import { callDeadline, GITHUB_API_BASE, GITHUB_API_VERSION } from './http.js';
|
|
11
|
+
import { callDeadline, discardBody, GITHUB_API_BASE, GITHUB_API_VERSION, untilDeadline } from './http.js';
|
|
12
12
|
/** github.com's own authorize and token addresses. */
|
|
13
13
|
export const GITHUB_OAUTH_ENDPOINTS = {
|
|
14
14
|
authorize: 'https://github.com/login/oauth/authorize',
|
|
@@ -18,24 +18,25 @@ export const GITHUB_OAUTH_ENDPOINTS = {
|
|
|
18
18
|
const TOKEN_ANSWER_BYTES = 65_536;
|
|
19
19
|
/**
|
|
20
20
|
* A fetch that ends each call at its deadline and hands on the answer only once its whole body is read under
|
|
21
|
-
* {@link TOKEN_ANSWER_BYTES}, so the auth module never waits on GitHub past the deadline
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `GitHubNoAnswer`; a body past the cap throws an
|
|
21
|
+
* {@link TOKEN_ANSWER_BYTES}, so the auth module never waits on GitHub past the deadline, even through a fetch that
|
|
22
|
+
* leaves the request or the body open past its signal. A redirect is answered as it came and never followed: a 307 or
|
|
23
|
+
* 308 would send the code and the client secret on to its target, and the auth module refuses the redirect's status. A
|
|
24
|
+
* call that gets no answer, or whose body stops before its end, throws `GitHubNoAnswer`; a body past the cap throws an
|
|
25
|
+
* error that names the cap.
|
|
25
26
|
*/
|
|
26
27
|
function boundedFetch(fetchImpl, timeoutMs) {
|
|
27
28
|
return async (input, init) => {
|
|
28
29
|
const deadline = callDeadline(init?.signal ?? undefined, timeoutMs);
|
|
29
30
|
let response;
|
|
30
31
|
try {
|
|
31
|
-
response = await fetchImpl(input, { ...init, redirect: 'manual', signal: deadline.signal });
|
|
32
|
+
response = await untilDeadline(fetchImpl(input, { ...init, redirect: 'manual', signal: deadline.signal }), deadline, (late) => void discardBody(late));
|
|
32
33
|
}
|
|
33
34
|
catch {
|
|
34
35
|
throw deadline.noAnswer();
|
|
35
36
|
}
|
|
36
37
|
let bytes;
|
|
37
38
|
try {
|
|
38
|
-
bytes = await readCapped(response, TOKEN_ANSWER_BYTES);
|
|
39
|
+
bytes = await untilDeadline(readCapped(response, TOKEN_ANSWER_BYTES), deadline);
|
|
39
40
|
}
|
|
40
41
|
catch (error) {
|
|
41
42
|
if (error instanceof ReadCapExceeded)
|
|
@@ -64,6 +65,10 @@ export class GitHubAppUserFlow extends RedirectOAuthFlow {
|
|
|
64
65
|
providerId = 'github';
|
|
65
66
|
/** GitHub's REST API, where `revoke` deletes a token. */
|
|
66
67
|
apiBase;
|
|
68
|
+
/** The fetch a revocation is sent with, as given: its answer is told by its status, its body never read. */
|
|
69
|
+
revocationFetch;
|
|
70
|
+
/** How long a revocation may take; {@link GITHUB_TIMEOUT_MS} when absent. */
|
|
71
|
+
revocationTimeoutMs;
|
|
67
72
|
/**
|
|
68
73
|
* @param client The app's client id and client secret.
|
|
69
74
|
* @param fetchImpl The fetch the code is exchanged and a token revoked with.
|
|
@@ -75,6 +80,8 @@ export class GitHubAppUserFlow extends RedirectOAuthFlow {
|
|
|
75
80
|
this.client = client;
|
|
76
81
|
this.endpoints = endpoints;
|
|
77
82
|
this.apiBase = options.apiBase ?? GITHUB_API_BASE;
|
|
83
|
+
this.revocationFetch = fetchImpl;
|
|
84
|
+
this.revocationTimeoutMs = options.timeoutMs;
|
|
78
85
|
}
|
|
79
86
|
/** GitHub's addresses and the app's client, with no scopes. */
|
|
80
87
|
getConfig() {
|
|
@@ -98,8 +105,9 @@ export class GitHubAppUserFlow extends RedirectOAuthFlow {
|
|
|
98
105
|
* Deletes a user access token at GitHub, so a token the caller is done with stops working at once instead of at its
|
|
99
106
|
* expiry: GitHub's "Delete an app token" (`DELETE /applications/{client_id}/token` with the token in a JSON body),
|
|
100
107
|
* authenticated as the app with Basic authentication, its client id and client secret
|
|
101
|
-
* (https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token). GitHub answers 204
|
|
102
|
-
* throws `OAuthGrantRefused` (reason `revoke`, its status)
|
|
108
|
+
* (https://docs.github.com/en/rest/apps/oauth-applications#delete-an-app-token). GitHub answers 204, and 204 alone
|
|
109
|
+
* resolves: any other answer, another 2xx included, throws `OAuthGrantRefused` (reason `revoke`, its status), told
|
|
110
|
+
* by its status alone with its body released unread, however large or slow. A redirect is refused rather than
|
|
103
111
|
* followed so the client secret reaches GitHub's API alone, and a call that gets no answer by the flow's deadline
|
|
104
112
|
* throws `GitHubNoAnswer`.
|
|
105
113
|
*
|
|
@@ -107,18 +115,31 @@ export class GitHubAppUserFlow extends RedirectOAuthFlow {
|
|
|
107
115
|
*/
|
|
108
116
|
async revoke(token) {
|
|
109
117
|
const credentials = Buffer.from(`${this.client.clientId}:${this.client.clientSecret}`).toString('base64');
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
'
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
// Called as a plain function, as the fetch is everywhere else in the pack: a runtime's own fetch may refuse another receiver.
|
|
119
|
+
const send = this.revocationFetch;
|
|
120
|
+
const deadline = callDeadline(undefined, this.revocationTimeoutMs);
|
|
121
|
+
let response;
|
|
122
|
+
try {
|
|
123
|
+
response = await untilDeadline(send(`${this.apiBase}/applications/${encodeURIComponent(this.client.clientId)}/token`, {
|
|
124
|
+
method: 'DELETE',
|
|
125
|
+
headers: {
|
|
126
|
+
authorization: `Basic ${credentials}`,
|
|
127
|
+
accept: 'application/vnd.github+json',
|
|
128
|
+
'content-type': 'application/json',
|
|
129
|
+
'x-github-api-version': GITHUB_API_VERSION,
|
|
130
|
+
'user-agent': 'agentos-ext-github',
|
|
131
|
+
},
|
|
132
|
+
body: JSON.stringify({ access_token: token }),
|
|
133
|
+
redirect: 'manual',
|
|
134
|
+
signal: deadline.signal,
|
|
135
|
+
}), deadline, (late) => void discardBody(late));
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
throw deadline.noAnswer();
|
|
139
|
+
}
|
|
140
|
+
// The status is the whole answer: the body is let go unread, and the revocation never waits on it.
|
|
141
|
+
void discardBody(response);
|
|
142
|
+
if (response.status !== 204)
|
|
122
143
|
throw new OAuthGrantRefused('revoke', response.status);
|
|
123
144
|
}
|
|
124
145
|
}
|
package/dist/app/userFlow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userFlow.js","sourceRoot":"","sources":["../../src/app/userFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAgD,MAAM,uBAAuB,CAAC;AAC3H,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAqB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"userFlow.js","sourceRoot":"","sources":["../../src/app/userFlow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,eAA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AY,EAAE,oBAAoB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;gBAC7C,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,QAAQ,CAAC,MAAM;aACxB,CAAC,EACF,QAAQ,EACR,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,WAAW,CAAC,IAAI,CAAC,CACjC,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC5B,CAAC;QACD,mGAAmG;QACnG,KAAK,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG;YAAE,MAAM,IAAI,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview A repository's documentation as account sources, read through a GitHub App's installation: each
|
|
3
3
|
* repository's tree read once a commit within a request budget, the documentation kept by a filter, each file read as
|
|
4
|
-
* raw bytes under a cap, and a push compared by the tree at its `after` commit.
|
|
4
|
+
* raw bytes under a cap, and a push compared by the tree at its `after` commit. A selection, an item or a call it
|
|
5
|
+
* cannot answer whole is refused before any request.
|
|
5
6
|
* @module agentos-ext-github/documents/GitHubDocumentsConnector
|
|
6
7
|
*/
|
|
7
8
|
import { type AccountSourceConnector, type SourceChanges, type SourceGone, type SourceItem, type SourceRead, type SourceSelection } from '@framers/agentos-ext-account-sources';
|
|
@@ -14,7 +15,7 @@ export interface LinkedRepository {
|
|
|
14
15
|
defaultBranch: string;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
* What `changesSince` compares:
|
|
18
|
+
* What `changesSince` compares: one repository (`ids` holds its id alone), and from a push its `after` commit and its
|
|
18
19
|
* `ref`, with the listing at `after` when the caller holds it.
|
|
19
20
|
*/
|
|
20
21
|
export interface GitHubChangesSelection extends SourceSelection {
|
|
@@ -22,13 +23,17 @@ export interface GitHubChangesSelection extends SourceSelection {
|
|
|
22
23
|
after?: string;
|
|
23
24
|
/** The push's ref, such as `refs/heads/main`; a push to another branch than the default changes nothing. */
|
|
24
25
|
ref?: string;
|
|
25
|
-
/** The documentation's listing at `after`, which spares the tree's read. */
|
|
26
|
+
/** The documentation's listing at `after`, which spares the tree's read; taken only with the `after` it was read at. */
|
|
26
27
|
listing?: readonly TreeBlob[];
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* A repository's documentation as account sources: an item's id is `<repositoryId>:<path>`, its version
|
|
30
31
|
* `<blob>@<commit>`, and the cursor of `changesSince` the JSON of each documentation path's blob at the commit last
|
|
31
|
-
* read.
|
|
32
|
+
* read. A repository id is a positive integer in decimal. A call whose signal is already aborted throws
|
|
33
|
+
* `GitHubNoAnswer` (`cancelled`) before it checks anything else. What a call cannot answer whole then throws before any
|
|
34
|
+
* request: a `TypeError` for an id that is not a repository id, a repository named twice, an item id that names no
|
|
35
|
+
* file or a change set of other than one repository, and an `Error` for a repository outside the link. An
|
|
36
|
+
* installation is removed by the app's own call (`uninstallInstallation`), never by a link's connector.
|
|
32
37
|
*/
|
|
33
38
|
export declare class GitHubDocumentsConnector implements AccountSourceConnector {
|
|
34
39
|
private readonly credential;
|
|
@@ -47,6 +52,7 @@ export declare class GitHubDocumentsConnector implements AccountSourceConnector
|
|
|
47
52
|
* @param apiBase GitHub's REST API, or a stand-in's address in tests.
|
|
48
53
|
*/
|
|
49
54
|
constructor(credential: GitHubAppCredential, installationId: number, repositories: readonly LinkedRepository[], filter?: TreeFilter, fetchImpl?: typeof fetch, apiBase?: string);
|
|
55
|
+
/** The linked repository of an id; one outside the link throws. */
|
|
50
56
|
private repository;
|
|
51
57
|
/** An installation token narrowed to one repository, its request ended by the caller's signal. */
|
|
52
58
|
private token;
|
|
@@ -54,29 +60,39 @@ export declare class GitHubDocumentsConnector implements AccountSourceConnector
|
|
|
54
60
|
head(repositoryId: number, signal?: AbortSignal): Promise<string>;
|
|
55
61
|
/**
|
|
56
62
|
* The documentation files of a repository at a commit: its tree read once within the request budget, never walking
|
|
57
|
-
* a skipped folder, then filtered. A caller keeps it for that commit and hands it to `changesSince
|
|
63
|
+
* a skipped folder, then filtered. A caller keeps it for that commit and hands it to `changesSince` with that commit
|
|
64
|
+
* as `after`.
|
|
58
65
|
*/
|
|
59
66
|
listing(repositoryId: number, commit: string, signal?: AbortSignal): Promise<TreeBlob[]>;
|
|
60
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* The documentation of each selected repository (its id in `ids`) at its default branch's head. Every id is checked
|
|
69
|
+
* before any repository is read, so a selection is listed whole or not at all: an id that is not a repository id, or
|
|
70
|
+
* a repository named twice, throws a `TypeError`, and a repository outside the link an `Error`.
|
|
71
|
+
*/
|
|
61
72
|
list(selection: SourceSelection, signal?: AbortSignal): Promise<{
|
|
62
73
|
items: SourceItem[];
|
|
63
74
|
gone: SourceGone[];
|
|
64
75
|
}>;
|
|
65
76
|
/**
|
|
66
|
-
* A file's raw bytes at the commit of its version
|
|
77
|
+
* A file's raw bytes at the commit of its version (the default branch when the version names no commit, and then
|
|
78
|
+
* the reference names the branch), read as a stream under the call's deadline and cut at
|
|
67
79
|
* `maxFileBytes`: PDF, Word and HTML as bytes with their media type, the rest as UTF-8 text, each with a `github`
|
|
68
80
|
* attribution linking the file at that commit. A file GitHub no longer has (the contents read answers 404), or one
|
|
69
81
|
* past the cap, is answered gone with reason `removed`; any other refusal throws `GitHubApiError`, a rate limit with
|
|
70
82
|
* its `retryAt`, so a read GitHub held back is never taken for a file gone. So does a refusal of the installation
|
|
71
|
-
* token (404 for an installation GitHub no longer has): a lost installation never reads as every file gone.
|
|
83
|
+
* token (404 for an installation GitHub no longer has): a lost installation never reads as every file gone. An item
|
|
84
|
+
* id that names no file (no path, or a path with an empty, `.` or `..` segment) throws a `TypeError` before any
|
|
85
|
+
* request.
|
|
72
86
|
*/
|
|
73
87
|
read(item: SourceItem, signal?: AbortSignal): Promise<SourceRead | SourceGone>;
|
|
74
88
|
/**
|
|
75
|
-
* What a push to `after` changed, from the listing at `after` (read here when the caller holds
|
|
76
|
-
* blobs read before (`cursor`: the JSON of each path's blob). A push's own commit lists are never
|
|
77
|
-
* push, or a push of more commits than its event lists, is read like any other. A cursor this
|
|
78
|
-
* answer throws a `TypeError` before any request, whatever the push's branch
|
|
79
|
-
*
|
|
89
|
+
* What a push to `after` changed in one repository, from the listing at `after` (read here when the caller holds
|
|
90
|
+
* none) against the blobs read before (`cursor`: the JSON of each path's blob). A push's own commit lists are never
|
|
91
|
+
* read, so a force push, or a push of more commits than its event lists, is read like any other. A cursor this
|
|
92
|
+
* connector did not answer throws a `TypeError` before any request, whatever the push's branch, and so does a
|
|
93
|
+
* selection of other than one repository, or a `listing` without the `after` commit it was read at: call it once
|
|
94
|
+
* per repository, each with that repository's cursor. A push to another branch than the default answers no change
|
|
95
|
+
* and the cursor it was given.
|
|
80
96
|
*/
|
|
81
97
|
changesSince(cursor: string | null, selection: GitHubChangesSelection, signal?: AbortSignal): Promise<SourceChanges>;
|
|
82
98
|
/** Nothing to end here: an installation is removed by the app's own call (`uninstallInstallation`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubDocumentsConnector.d.ts","sourceRoot":"","sources":["../../src/documents/GitHubDocumentsConnector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GitHubDocumentsConnector.d.ts","sourceRoot":"","sources":["../../src/documents/GitHubDocumentsConnector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,eAAe,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC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