@effected/github 0.4.2 → 0.5.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/GitHubRepository.js +12 -3
- package/README.md +1 -1
- package/index.d.ts +25 -4
- package/package.json +3 -3
package/GitHubRepository.js
CHANGED
|
@@ -29,14 +29,23 @@ const SECURITY_ANALYSIS_STATUS_FIELDS = /* @__PURE__ */ new Set([
|
|
|
29
29
|
* mapped from snake_case keys to camelCase GraphQL input fields.
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* GitHub never exposed these
|
|
33
|
-
*
|
|
32
|
+
* GitHub never exposed these on the REST repository endpoint — the
|
|
33
|
+
* `PATCH /repos/{owner}/{repo}` route accepts none of them, and
|
|
34
|
+
* `has_discussions` is the treacherous one: the REST **read** returns it, so
|
|
35
|
+
* routing its write to the PATCH looks symmetric, but the PATCH silently
|
|
36
|
+
* ignores unknown body fields and answers 200 — reported as applied on every
|
|
37
|
+
* run while the repository never changed (effected#358). Setting any of these
|
|
38
|
+
* forces a second round trip to learn the repository's node id.
|
|
39
|
+
*
|
|
40
|
+
* Field names verified against `UpdateRepositoryInput` by live introspection,
|
|
41
|
+
* 2026-08-15.
|
|
34
42
|
*
|
|
35
43
|
* @public
|
|
36
44
|
*/
|
|
37
45
|
const GRAPHQL_ONLY_SETTINGS = {
|
|
38
46
|
has_sponsorships: "hasSponsorshipsEnabled",
|
|
39
|
-
has_pull_requests: "hasPullRequestsEnabled"
|
|
47
|
+
has_pull_requests: "hasPullRequestsEnabled",
|
|
48
|
+
has_discussions: "hasDiscussionsEnabled"
|
|
40
49
|
};
|
|
41
50
|
/** `{ status: "enabled" | "disabled" }` — the form GitHub accepts and the type declares. */
|
|
42
51
|
const isStatusObject = (raw) => {
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Typed GitHub REST and GraphQL for [Effect](https://effect.website) v4. `client.request("GET /repos/{owner}/{repo}", { owner, repo })` types both the parameters and the returned `data` from the route literal alone — no `operation: string`, no callback, no cast. One `GitHubError` covers every REST failure with a `kind` you branch on instead of grepping a message, one pagination engine backs every paginating route and `client.request`'s `Stream` form, and a set of resource services (`GitBranch`, `GitTag`, `CheckRun`, `PullRequest`, `PullRequestComment`, `GitHubRelease`, `Attestation`) turn multi-call dances — "does this branch already exist?", "conclude this check run no matter how the program exits" — into one call. A second tier writes the configuration half: secrets, variables, rulesets, deployment environments, the security toggles and CodeQL default setup. `GitHubApp` mints and revokes installation tokens for App auth.
|
|
9
9
|
|
|
10
10
|
> **Pre-release.** This package is part of the `@effected/*` kit, in pre-`1.0.0`
|
|
11
|
-
> development against a single pinned Effect v4
|
|
11
|
+
> development against a single pinned Effect v4 prerelease. Packages graduate to
|
|
12
12
|
> `1.0.0` once Effect `4.0.0` ships. To hold your own `effect` versions at
|
|
13
13
|
> exactly the ones the kit is built and tested against, install
|
|
14
14
|
> [`@effected/pnpm-plugin-effect`](https://www.npmjs.com/package/@effected/pnpm-plugin-effect).
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config, Context, Duration, Effect, Layer, Option, Redacted, Result, Schedule, Schema,
|
|
1
|
+
import { Config, Context, Duration, Effect, Layer, Option, Redacted, Result, Schedule, Schema, Scope, Stream } from "effect";
|
|
2
2
|
import { PaginatingEndpoints } from "@octokit/plugin-paginate-rest";
|
|
3
3
|
import { Endpoints, RequestHeaders } from "@octokit/types";
|
|
4
4
|
import { SemVer } from "@effected/semver";
|
|
@@ -206,7 +206,7 @@ declare class GraphQLDocument<A, V extends Record<string, unknown>> {
|
|
|
206
206
|
/** The document text sent to GitHub. */
|
|
207
207
|
readonly document: string;
|
|
208
208
|
/** Decodes the raw `data` payload into the domain value. */
|
|
209
|
-
readonly decode: (raw: unknown) => Effect.Effect<A,
|
|
209
|
+
readonly decode: (raw: unknown) => Effect.Effect<A, Schema.SchemaError>;
|
|
210
210
|
/**
|
|
211
211
|
* Turns the caller's variables into the wire object.
|
|
212
212
|
*
|
|
@@ -2009,6 +2009,19 @@ interface GitHubIssueShape {
|
|
|
2009
2009
|
* @remarks
|
|
2010
2010
|
* The idempotence guard one consumer wrote a bespoke timeline query for,
|
|
2011
2011
|
* so that re-running a workflow does not comment twice.
|
|
2012
|
+
*
|
|
2013
|
+
* Two hazards before building on it (effected#306):
|
|
2014
|
+
*
|
|
2015
|
+
* - **An issue obtained from `linkedIssues(pr)` answers `true` from the
|
|
2016
|
+
* outset** — the closing link itself puts a cross-reference on the
|
|
2017
|
+
* issue's timeline. As a "have I commented yet?" guard on those issues
|
|
2018
|
+
* the answer is always yes, and the comment is never posted. Guard a
|
|
2019
|
+
* comment by looking for the comment (a marker in its body), not for a
|
|
2020
|
+
* cross-reference.
|
|
2021
|
+
* - **It observes `CROSS_REFERENCED_EVENT` only, not `ConnectedEvent`** —
|
|
2022
|
+
* an issue a human attached through the sidebar's Development section is
|
|
2023
|
+
* connected, not cross-referenced, and reads `false` here even though
|
|
2024
|
+
* GitHub's UI shows the link.
|
|
2012
2025
|
*/
|
|
2013
2026
|
readonly isCrossReferencedBy: (issueNumber: number, prNumber: number) => Effect.Effect<boolean, GitHubGraphQLError, Repo>;
|
|
2014
2027
|
}
|
|
@@ -2166,8 +2179,16 @@ declare const SECURITY_ANALYSIS_STATUS_FIELDS: ReadonlySet<string>;
|
|
|
2166
2179
|
* mapped from snake_case keys to camelCase GraphQL input fields.
|
|
2167
2180
|
*
|
|
2168
2181
|
* @remarks
|
|
2169
|
-
* GitHub never exposed these
|
|
2170
|
-
*
|
|
2182
|
+
* GitHub never exposed these on the REST repository endpoint — the
|
|
2183
|
+
* `PATCH /repos/{owner}/{repo}` route accepts none of them, and
|
|
2184
|
+
* `has_discussions` is the treacherous one: the REST **read** returns it, so
|
|
2185
|
+
* routing its write to the PATCH looks symmetric, but the PATCH silently
|
|
2186
|
+
* ignores unknown body fields and answers 200 — reported as applied on every
|
|
2187
|
+
* run while the repository never changed (effected#358). Setting any of these
|
|
2188
|
+
* forces a second round trip to learn the repository's node id.
|
|
2189
|
+
*
|
|
2190
|
+
* Field names verified against `UpdateRepositoryInput` by live introspection,
|
|
2191
|
+
* 2026-08-15.
|
|
2171
2192
|
*
|
|
2172
2193
|
* @public
|
|
2173
2194
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Typed GitHub REST and GraphQL services over the octokit core request surface, with app auth and resource helpers.",
|
|
6
6
|
"keywords": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@effected/semver": "^0.
|
|
41
|
+
"@effected/semver": "^0.5.0",
|
|
42
42
|
"@octokit/core": "^7.0.6",
|
|
43
43
|
"@octokit/plugin-paginate-rest": "^14.0.0",
|
|
44
44
|
"@octokit/types": "^16.0.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"universal-github-app-jwt": "^2.2.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"effect": "4.0.0-
|
|
50
|
+
"effect": "4.0.0-rc.109"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=24.11.0"
|