@kud/gh 0.5.1 → 0.6.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/dist/inbox.d.ts +21 -0
- package/dist/inbox.d.ts.map +1 -1
- package/dist/inbox.js +37 -1
- package/dist/inbox.js.map +1 -1
- package/package.json +1 -1
package/dist/inbox.d.ts
CHANGED
|
@@ -12,6 +12,27 @@
|
|
|
12
12
|
* beneath each one. A caller that renders a title and a link was paying for
|
|
13
13
|
* every check run on every open PR. At 111 a poller gets 45 refreshes an hour.
|
|
14
14
|
*/
|
|
15
|
+
/**
|
|
16
|
+
* How many of your own open PRs to ask for.
|
|
17
|
+
*
|
|
18
|
+
* This is the single biggest lever on the query's cost, because connections
|
|
19
|
+
* MULTIPLY: the health and conversation fragments hang ~80 nodes off each PR
|
|
20
|
+
* (`reviewThreads(first: 50)`, `statusCheckRollup.contexts(first: 20)`,
|
|
21
|
+
* `labels(first: 10)`), so the outer number is a multiplier on all of them.
|
|
22
|
+
* GitHub scores a call by the nodes it could return, not by how many calls you
|
|
23
|
+
* make — which is why batching queries saves nothing here and this saves a lot.
|
|
24
|
+
*
|
|
25
|
+
* It was 100, against ~25,550 total nodes and a measured 111 points. 100 × 80 is
|
|
26
|
+
* 8,000 of those nodes from this one search, and it was 100 for no reason beyond
|
|
27
|
+
* the search API's own maximum — every other search here already asks for 20-30.
|
|
28
|
+
* At 30 this search costs 2,400 nodes instead of 8,000, roughly halving the whole
|
|
29
|
+
* query.
|
|
30
|
+
*
|
|
31
|
+
* `issueCount` is fetched alongside so the cap can never drop rows in silence: a
|
|
32
|
+
* scalar costs nothing, and a host that knows the true total can say what it is
|
|
33
|
+
* not showing.
|
|
34
|
+
*/
|
|
35
|
+
export declare const MY_PRS_LIMIT = 30;
|
|
15
36
|
export type InboxShape = "full" | "minimal";
|
|
16
37
|
/** A repo-scoped or account-wide inbox. */
|
|
17
38
|
export type InboxQueryOptions = {
|
package/dist/inbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../src/inbox.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAA;AAE3C,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AA6DD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,mCAI7B,iBAAsB,
|
|
1
|
+
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../src/inbox.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,KAAK,CAAA;AAE9B,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAA;AAE3C,2CAA2C;AAC3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AA6DD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,mCAI7B,iBAAsB,WAyGxB,CAAA"}
|
package/dist/inbox.js
CHANGED
|
@@ -5,6 +5,41 @@
|
|
|
5
5
|
// Query-only by design. Assembling the result into sections is the surface's
|
|
6
6
|
// own vocabulary — cockpit splits home from work, a web dashboard may group by
|
|
7
7
|
// project — so nothing here decides what a section is.
|
|
8
|
+
/**
|
|
9
|
+
* How much of each row to ask for.
|
|
10
|
+
*
|
|
11
|
+
* `full` carries health, conversation and labels — everything `computeHealth`
|
|
12
|
+
* and a conversation line need. `minimal` carries identity only: type, number,
|
|
13
|
+
* title, url, draft, timestamp, repo.
|
|
14
|
+
*
|
|
15
|
+
* This is a cost axis, not a taste one. Measured against GitHub's own
|
|
16
|
+
* `rateLimit { cost }`: the full query costs **111 points** of a 5000/hour
|
|
17
|
+
* budget, at a nodeCount of ~25,550 — because `statusCheckRollup.contexts`
|
|
18
|
+
* appears in five PR fragments and `reviewThreads(first: 50)` multiplies
|
|
19
|
+
* beneath each one. A caller that renders a title and a link was paying for
|
|
20
|
+
* every check run on every open PR. At 111 a poller gets 45 refreshes an hour.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* How many of your own open PRs to ask for.
|
|
24
|
+
*
|
|
25
|
+
* This is the single biggest lever on the query's cost, because connections
|
|
26
|
+
* MULTIPLY: the health and conversation fragments hang ~80 nodes off each PR
|
|
27
|
+
* (`reviewThreads(first: 50)`, `statusCheckRollup.contexts(first: 20)`,
|
|
28
|
+
* `labels(first: 10)`), so the outer number is a multiplier on all of them.
|
|
29
|
+
* GitHub scores a call by the nodes it could return, not by how many calls you
|
|
30
|
+
* make — which is why batching queries saves nothing here and this saves a lot.
|
|
31
|
+
*
|
|
32
|
+
* It was 100, against ~25,550 total nodes and a measured 111 points. 100 × 80 is
|
|
33
|
+
* 8,000 of those nodes from this one search, and it was 100 for no reason beyond
|
|
34
|
+
* the search API's own maximum — every other search here already asks for 20-30.
|
|
35
|
+
* At 30 this search costs 2,400 nodes instead of 8,000, roughly halving the whole
|
|
36
|
+
* query.
|
|
37
|
+
*
|
|
38
|
+
* `issueCount` is fetched alongside so the cap can never drop rows in silence: a
|
|
39
|
+
* scalar costs nothing, and a host that knows the true total can say what it is
|
|
40
|
+
* not showing.
|
|
41
|
+
*/
|
|
42
|
+
export const MY_PRS_LIMIT = 30;
|
|
8
43
|
// computeHealth's precedence needs reviewDecision, mergeable and the check
|
|
9
44
|
// rollup. A fragment that omits them does NOT degrade gracefully — it falls
|
|
10
45
|
// straight through to whatever token is left, so a PR you already sent back
|
|
@@ -92,7 +127,8 @@ export const buildInboxQuery = ({ repo, doneWithinDays = 14, shape = "full", } =
|
|
|
92
127
|
{
|
|
93
128
|
rateLimit { cost nodeCount remaining resetAt }
|
|
94
129
|
viewer { login }
|
|
95
|
-
myPRs: search(query: "${scope}is:pr is:open author:@me", type: ISSUE, first:
|
|
130
|
+
myPRs: search(query: "${scope}is:pr is:open author:@me", type: ISSUE, first: ${MY_PRS_LIMIT}) {
|
|
131
|
+
issueCount
|
|
96
132
|
nodes { __typename ... on PullRequest {
|
|
97
133
|
number title createdAt url headRefName isDraft
|
|
98
134
|
repository { nameWithOwner }
|
package/dist/inbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../src/inbox.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,uDAAuD;
|
|
1
|
+
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../src/inbox.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,uDAAuD;AAEvD;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAA;AAmB9B,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,mEAAmE;AACnE,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,yBAAyB;AACzB,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,2EAA2E;AAC3E,qBAAqB;AACrB,MAAM,SAAS,GAAG;;;;;YAKN,CAAA;AAEZ,6EAA6E;A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