@effected/github 0.2.2 → 0.2.3
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/PullRequest.js +10 -0
- package/index.d.ts +40 -0
- package/package.json +2 -2
package/PullRequest.js
CHANGED
|
@@ -16,6 +16,16 @@ const MergeMethod = Schema.Literals([
|
|
|
16
16
|
/**
|
|
17
17
|
* A pull request, projected to what callers read.
|
|
18
18
|
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This is the **domain** shape, and the only pull-request type this package
|
|
21
|
+
* exports. The wire shape GitHub actually answers with is the private
|
|
22
|
+
* `RawPull` interface further down this module, and the two are deliberately
|
|
23
|
+
* different: `RawPull` nests `head`/`base` as `{ ref, sha }` and spells the
|
|
24
|
+
* link `html_url`, where this class flattens them to `head`/`headSha` and
|
|
25
|
+
* spells it `url`. Reading the wrong one produces code that typechecks against
|
|
26
|
+
* a member set the boundary will never hand it. If you are writing a test
|
|
27
|
+
* double or a fixture, this is the type you build.
|
|
28
|
+
*
|
|
19
29
|
* @public
|
|
20
30
|
*/
|
|
21
31
|
var PullRequestInfo = class extends Schema.Class("PullRequestInfo")({
|
package/index.d.ts
CHANGED
|
@@ -2067,6 +2067,17 @@ interface GitTagShape {
|
|
|
2067
2067
|
* `Effect.result` per parse and another per comparison** to answer this. Both
|
|
2068
2068
|
* are synchronous in `@effected/semver` (`parseResult`, `compare`), so this is
|
|
2069
2069
|
* a single pass over the page stream with no round trips at all.
|
|
2070
|
+
*
|
|
2071
|
+
* **"Newest" means highest version, not most recent.** That is the right
|
|
2072
|
+
* answer for a single-versioned repository and the wrong instrument for a
|
|
2073
|
+
* **monorepo publishing independently versioned packages**, where version
|
|
2074
|
+
* ordering and recency are unrelated: a `pkg-a@2.0.0` tag outranks a
|
|
2075
|
+
* `pkg-b@1.4.0` cut yesterday, so the result can sit several releases behind
|
|
2076
|
+
* the actual head and never move. Nothing about the failure is visible —
|
|
2077
|
+
* a stale-but-plausible tag comes back, and one consumer pinned its release
|
|
2078
|
+
* boundary two releases back, permanently. In a monorepo, filter by the
|
|
2079
|
+
* package's tag prefix (see {@link LatestSemverOptions}) so the comparison
|
|
2080
|
+
* runs within one version line, or order by tagged-commit date instead.
|
|
2070
2081
|
*/
|
|
2071
2082
|
readonly latestSemver: (options?: LatestSemverOptions) => Effect.Effect<Option.Option<SemverTag>, GitHubError, Repo>;
|
|
2072
2083
|
}
|
|
@@ -2123,6 +2134,16 @@ declare const PullRequestInfo_base: Schema.Class<PullRequestInfo, Schema.Struct<
|
|
|
2123
2134
|
/**
|
|
2124
2135
|
* A pull request, projected to what callers read.
|
|
2125
2136
|
*
|
|
2137
|
+
* @remarks
|
|
2138
|
+
* This is the **domain** shape, and the only pull-request type this package
|
|
2139
|
+
* exports. The wire shape GitHub actually answers with is the private
|
|
2140
|
+
* `RawPull` interface further down this module, and the two are deliberately
|
|
2141
|
+
* different: `RawPull` nests `head`/`base` as `{ ref, sha }` and spells the
|
|
2142
|
+
* link `html_url`, where this class flattens them to `head`/`headSha` and
|
|
2143
|
+
* spells it `url`. Reading the wrong one produces code that typechecks against
|
|
2144
|
+
* a member set the boundary will never hand it. If you are writing a test
|
|
2145
|
+
* double or a fixture, this is the type you build.
|
|
2146
|
+
*
|
|
2126
2147
|
* @public
|
|
2127
2148
|
*/
|
|
2128
2149
|
declare class PullRequestInfo extends PullRequestInfo_base {}
|
|
@@ -2138,6 +2159,25 @@ interface UpsertedPullRequest {
|
|
|
2138
2159
|
*/
|
|
2139
2160
|
interface PullRequestShape {
|
|
2140
2161
|
readonly get: (number: number) => Effect.Effect<PullRequestInfo, GitHubError, Repo>;
|
|
2162
|
+
/**
|
|
2163
|
+
* Open, closed or all pull requests, optionally filtered.
|
|
2164
|
+
*
|
|
2165
|
+
* @remarks
|
|
2166
|
+
* `head` accepts **either** the qualified `owner:ref` GitHub's filter wants
|
|
2167
|
+
* or a bare `ref`, which is qualified with the current repo's owner on the
|
|
2168
|
+
* way out. So for a pull request opened **from the current repository**,
|
|
2169
|
+
* feeding this method `PullRequestInfo.head` — which is the bare
|
|
2170
|
+
* `raw.head.ref` — round-trips correctly, and a consumer filtering the full
|
|
2171
|
+
* list client-side because the raw REST route ignores an unqualified ref no
|
|
2172
|
+
* longer needs to.
|
|
2173
|
+
*
|
|
2174
|
+
* **The round trip does not hold for a fork-originated pull request.**
|
|
2175
|
+
* `PullRequestInfo` projects only the ref and drops the source owner, so
|
|
2176
|
+
* qualifying it here prefixes the *current* repo's owner and names a branch
|
|
2177
|
+
* in the wrong account — the filter then matches nothing, silently. When the
|
|
2178
|
+
* head may live in a fork, pass a qualified `owner:ref` built from the source
|
|
2179
|
+
* owner rather than from anything this projection carries.
|
|
2180
|
+
*/
|
|
2141
2181
|
readonly list: (options?: {
|
|
2142
2182
|
readonly head?: string | undefined;
|
|
2143
2183
|
readonly base?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/github",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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.3.
|
|
41
|
+
"@effected/semver": "^0.3.2",
|
|
42
42
|
"@octokit/core": "^7.0.6",
|
|
43
43
|
"@octokit/plugin-paginate-rest": "^14.0.0",
|
|
44
44
|
"@octokit/types": "^16.0.0",
|