@usine/github 0.1.1 → 0.2.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 +31 -55
- package/dist/access.d.ts +30 -8
- package/dist/access.d.ts.map +1 -1
- package/dist/access.js +31 -8
- package/dist/access.js.map +1 -1
- package/dist/credentials.d.ts +6 -6
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +6 -6
- package/dist/credentials.js.map +1 -1
- package/dist/error.d.ts +28 -10
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +32 -7
- package/dist/error.js.map +1 -1
- package/dist/github-app.d.ts +12 -9
- package/dist/github-app.d.ts.map +1 -1
- package/dist/github-app.js +43 -29
- package/dist/github-app.js.map +1 -1
- package/dist/graphql.d.ts +11 -0
- package/dist/graphql.d.ts.map +1 -0
- package/dist/graphql.js +47 -0
- package/dist/graphql.js.map +1 -0
- package/dist/http.d.ts +9 -3
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +26 -8
- package/dist/http.js.map +1 -1
- package/dist/installation.d.ts +17 -9
- package/dist/installation.d.ts.map +1 -1
- package/dist/installation.js +17 -9
- package/dist/installation.js.map +1 -1
- package/dist/item-history.d.ts +57 -0
- package/dist/item-history.d.ts.map +1 -0
- package/dist/item-history.js +190 -0
- package/dist/item-history.js.map +1 -0
- package/dist/item-writer.d.ts +2 -2
- package/dist/item-writer.d.ts.map +1 -1
- package/dist/item-writer.js +1 -1
- package/dist/item-writer.js.map +1 -1
- package/dist/jwt.d.ts +3 -3
- package/dist/jwt.d.ts.map +1 -1
- package/dist/jwt.js +4 -4
- package/dist/jwt.js.map +1 -1
- package/dist/label-writer.d.ts +2 -2
- package/dist/label-writer.d.ts.map +1 -1
- package/dist/label-writer.js +2 -2
- package/dist/label-writer.js.map +1 -1
- package/dist/local-secrets.d.ts +2 -2
- package/dist/local-secrets.d.ts.map +1 -1
- package/dist/local-secrets.js +6 -6
- package/dist/local-secrets.js.map +1 -1
- package/dist/polling/content.js +2 -2
- package/dist/polling/detection.d.ts +9 -9
- package/dist/polling/detection.d.ts.map +1 -1
- package/dist/polling/detection.js +9 -9
- package/dist/polling/detection.js.map +1 -1
- package/dist/polling/labels.d.ts +5 -5
- package/dist/polling/labels.d.ts.map +1 -1
- package/dist/polling/labels.js +5 -5
- package/dist/polling/labels.js.map +1 -1
- package/dist/polling/payload.d.ts +10 -6
- package/dist/polling/payload.d.ts.map +1 -1
- package/dist/polling/payload.js +15 -11
- package/dist/polling/payload.js.map +1 -1
- package/dist/polling/polling.d.ts +18 -6
- package/dist/polling/polling.d.ts.map +1 -1
- package/dist/polling/polling.js +59 -52
- package/dist/polling/polling.js.map +1 -1
- package/dist/polling/queries.d.ts +6 -1
- package/dist/polling/queries.d.ts.map +1 -1
- package/dist/polling/queries.js +16 -0
- package/dist/polling/queries.js.map +1 -1
- package/package.json +8 -3
|
@@ -6,7 +6,7 @@ declare const PollCursor_base: Schema.Class<PollCursor, Schema.Struct<{
|
|
|
6
6
|
readonly entityTag: Schema.OptionFromNullOr<Schema.brand<Schema.NonEmptyString, "GitHubEntityTag">>;
|
|
7
7
|
readonly watermark: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
8
8
|
}>, {}>;
|
|
9
|
-
/** REST cursor for efficiency
|
|
9
|
+
/** A REST cursor used only for efficiency; losing it is safe because Event deduplication is permanent (ADR 0007). */
|
|
10
10
|
export declare class PollCursor extends PollCursor_base {
|
|
11
11
|
static readonly empty: PollCursor;
|
|
12
12
|
}
|
|
@@ -14,38 +14,38 @@ declare const ChangedIssue_base: Schema.Class<ChangedIssue, Schema.TaggedStruct<
|
|
|
14
14
|
readonly number: Schema.Int;
|
|
15
15
|
readonly updatedAt: Schema.DateTimeUtc;
|
|
16
16
|
}>, {}>;
|
|
17
|
-
/** An issue number and update time
|
|
17
|
+
/** An issue number and update time from repository change detection. */
|
|
18
18
|
export declare class ChangedIssue extends ChangedIssue_base {
|
|
19
19
|
}
|
|
20
20
|
declare const ChangedPullRequest_base: Schema.Class<ChangedPullRequest, Schema.TaggedStruct<"ChangedPullRequest", {
|
|
21
21
|
readonly number: Schema.Int;
|
|
22
22
|
readonly updatedAt: Schema.DateTimeUtc;
|
|
23
23
|
}>, {}>;
|
|
24
|
-
/** A pull request number and update time
|
|
24
|
+
/** A pull request number and update time from repository change detection. */
|
|
25
25
|
export declare class ChangedPullRequest extends ChangedPullRequest_base {
|
|
26
26
|
}
|
|
27
|
-
/** An issue or pull request whose payload
|
|
27
|
+
/** An issue or pull request whose payload must be fetched after change detection. */
|
|
28
28
|
export declare const ChangedItem: Schema.Union<readonly [typeof ChangedIssue, typeof ChangedPullRequest]>;
|
|
29
29
|
export type ChangedItem = typeof ChangedItem.Type;
|
|
30
30
|
declare const RepositoryNotModified_base: Schema.Class<RepositoryNotModified, Schema.TaggedStruct<"RepositoryNotModified", {
|
|
31
31
|
readonly cursor: typeof PollCursor;
|
|
32
32
|
readonly nextPollAt: Schema.Option<Schema.DateTimeUtc>;
|
|
33
|
-
/**
|
|
33
|
+
/** The backoff from rate pressure or `Retry-After`, not including the normal polling interval. */
|
|
34
34
|
readonly backoffUntil: Schema.withConstructorDefault<Schema.Option<Schema.DateTimeUtc>>;
|
|
35
35
|
}>, {}>;
|
|
36
|
-
/** GitHub
|
|
36
|
+
/** The result when GitHub confirms that the repository cursor is current. */
|
|
37
37
|
export declare class RepositoryNotModified extends RepositoryNotModified_base {
|
|
38
38
|
}
|
|
39
39
|
declare const RepositoryChanges_base: Schema.Class<RepositoryChanges, Schema.TaggedStruct<"RepositoryChanges", {
|
|
40
40
|
readonly cursor: typeof PollCursor;
|
|
41
41
|
readonly items: Schema.$Array<Schema.Union<readonly [typeof ChangedIssue, typeof ChangedPullRequest]>>;
|
|
42
|
-
/**
|
|
42
|
+
/** Whether the page cap ended the walk early; the rest is fetched next cycle. */
|
|
43
43
|
readonly backlog: Schema.Boolean;
|
|
44
44
|
readonly nextPollAt: Schema.Option<Schema.DateTimeUtc>;
|
|
45
|
-
/**
|
|
45
|
+
/** The backoff from rate pressure or `Retry-After`, not including the normal polling interval. */
|
|
46
46
|
readonly backoffUntil: Schema.withConstructorDefault<Schema.Option<Schema.DateTimeUtc>>;
|
|
47
47
|
}>, {}>;
|
|
48
|
-
/** Changed Items, the next cursor, and whether the page cap left
|
|
48
|
+
/** Changed Items, the next cursor, and whether the page cap left Items unfetched. */
|
|
49
49
|
export declare class RepositoryChanges extends RepositoryChanges_base {
|
|
50
50
|
}
|
|
51
51
|
/** The result of checking repository changes, including the earliest next poll time. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/polling/detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,4FAA4F;AAC5F,eAAO,MAAM,SAAS,wDAA8D,CAAC;AACrF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;;;;;AAE9C,
|
|
1
|
+
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/polling/detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,4FAA4F;AAC5F,eAAO,MAAM,SAAS,wDAA8D,CAAC;AACrF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC;;;;;AAE9C,qHAAqH;AACrH,qBAAa,UAAW,SAAQ,eAG9B;IACA,MAAM,CAAC,QAAQ,CAAC,KAAK,aAGlB;CACJ;;;;;AAED,wEAAwE;AACxE,qBAAa,YAAa,SAAQ,iBAMjC;CAAG;;;;;AAEJ,8EAA8E;AAC9E,qBAAa,kBAAmB,SAAQ,uBAKtC;CAAG;AAEL,qFAAqF;AACrF,eAAO,MAAM,WAAW,yEAAmD,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;IAQhD,kGAAkG;;;AANpG,6EAA6E;AAC7E,qBAAa,qBAAsB,SAAQ,0BASzC;CAAG;;;;IAQH,iFAAiF;;;IAGjF,kGAAkG;;;AATpG,qFAAqF;AACrF,qBAAa,iBAAkB,SAAQ,sBAYrC;CAAG;AAEL,wFAAwF;AACxF,eAAO,MAAM,eAAe,iFAA2D,CAAC;AACxF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Option, Schema } from "effect";
|
|
2
2
|
/** GitHub's opaque HTTP validator for a conditional repository or label-catalog request. */
|
|
3
3
|
export const EntityTag = Schema.NonEmptyString.pipe(Schema.brand("GitHubEntityTag"));
|
|
4
|
-
/** REST cursor for efficiency
|
|
4
|
+
/** A REST cursor used only for efficiency; losing it is safe because Event deduplication is permanent (ADR 0007). */
|
|
5
5
|
export class PollCursor extends Schema.Class("@usine/github/PollCursor")({
|
|
6
6
|
entityTag: Schema.OptionFromNullOr(EntityTag),
|
|
7
7
|
watermark: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
|
|
@@ -11,36 +11,36 @@ export class PollCursor extends Schema.Class("@usine/github/PollCursor")({
|
|
|
11
11
|
watermark: Option.none(),
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
/** An issue number and update time
|
|
14
|
+
/** An issue number and update time from repository change detection. */
|
|
15
15
|
export class ChangedIssue extends Schema.TaggedClass("@usine/github/ChangedIssue")("ChangedIssue", {
|
|
16
16
|
number: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
|
|
17
17
|
updatedAt: Schema.DateTimeUtc,
|
|
18
18
|
}) {
|
|
19
19
|
}
|
|
20
|
-
/** A pull request number and update time
|
|
20
|
+
/** A pull request number and update time from repository change detection. */
|
|
21
21
|
export class ChangedPullRequest extends Schema.TaggedClass("@usine/github/ChangedPullRequest")("ChangedPullRequest", {
|
|
22
22
|
number: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
|
|
23
23
|
updatedAt: Schema.DateTimeUtc,
|
|
24
24
|
}) {
|
|
25
25
|
}
|
|
26
|
-
/** An issue or pull request whose payload
|
|
26
|
+
/** An issue or pull request whose payload must be fetched after change detection. */
|
|
27
27
|
export const ChangedItem = Schema.Union([ChangedIssue, ChangedPullRequest]);
|
|
28
|
-
/** GitHub
|
|
28
|
+
/** The result when GitHub confirms that the repository cursor is current. */
|
|
29
29
|
export class RepositoryNotModified extends Schema.TaggedClass("@usine/github/RepositoryNotModified")("RepositoryNotModified", {
|
|
30
30
|
cursor: PollCursor,
|
|
31
31
|
nextPollAt: Schema.Option(Schema.DateTimeUtc),
|
|
32
|
-
/**
|
|
32
|
+
/** The backoff from rate pressure or `Retry-After`, not including the normal polling interval. */
|
|
33
33
|
backoffUntil: Schema.Option(Schema.DateTimeUtc).pipe(Schema.withConstructorDefault(Effect.succeed(Option.none()))),
|
|
34
34
|
}) {
|
|
35
35
|
}
|
|
36
|
-
/** Changed Items, the next cursor, and whether the page cap left
|
|
36
|
+
/** Changed Items, the next cursor, and whether the page cap left Items unfetched. */
|
|
37
37
|
export class RepositoryChanges extends Schema.TaggedClass("@usine/github/RepositoryChanges")("RepositoryChanges", {
|
|
38
38
|
cursor: PollCursor,
|
|
39
39
|
items: Schema.Array(ChangedItem),
|
|
40
|
-
/**
|
|
40
|
+
/** Whether the page cap ended the walk early; the rest is fetched next cycle. */
|
|
41
41
|
backlog: Schema.Boolean,
|
|
42
42
|
nextPollAt: Schema.Option(Schema.DateTimeUtc),
|
|
43
|
-
/**
|
|
43
|
+
/** The backoff from rate pressure or `Retry-After`, not including the normal polling interval. */
|
|
44
44
|
backoffUntil: Schema.Option(Schema.DateTimeUtc).pipe(Schema.withConstructorDefault(Effect.succeed(Option.none()))),
|
|
45
45
|
}) {
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detection.js","sourceRoot":"","sources":["../../src/polling/detection.ts"],"names":[],"mappings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EL,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC,CAAC"}
|
package/dist/polling/labels.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
/** A repository label name as returned by GitHub,
|
|
2
|
+
/** A repository label name as returned by GitHub, with case preserved. */
|
|
3
3
|
export declare const RepositoryLabelName: Schema.brand<Schema.NonEmptyString, "GitHubRepositoryLabelName">;
|
|
4
4
|
export type RepositoryLabelName = typeof RepositoryLabelName.Type;
|
|
5
|
-
/**
|
|
5
|
+
/** A label color as six hex digits without the leading `#`. */
|
|
6
6
|
export declare const RepositoryLabelColor: Schema.brand<Schema.String, "GitHubRepositoryLabelColor">;
|
|
7
7
|
export type RepositoryLabelColor = typeof RepositoryLabelColor.Type;
|
|
8
8
|
declare const RepositoryLabel_base: Schema.Class<RepositoryLabel, Schema.Struct<{
|
|
@@ -10,7 +10,7 @@ declare const RepositoryLabel_base: Schema.Class<RepositoryLabel, Schema.Struct<
|
|
|
10
10
|
readonly color: Schema.brand<Schema.String, "GitHubRepositoryLabelColor">;
|
|
11
11
|
readonly description: Schema.OptionFromNullOr<Schema.String>;
|
|
12
12
|
}>, {}>;
|
|
13
|
-
/**
|
|
13
|
+
/** A repository label. The name selects lanes; color and description are for display only. */
|
|
14
14
|
export declare class RepositoryLabel extends RepositoryLabel_base {
|
|
15
15
|
}
|
|
16
16
|
declare const RepositoryLabelCatalog_base: Schema.Class<RepositoryLabelCatalog, Schema.Struct<{
|
|
@@ -21,10 +21,10 @@ declare const RepositoryLabelCatalog_base: Schema.Class<RepositoryLabelCatalog,
|
|
|
21
21
|
export declare class RepositoryLabelCatalog extends RepositoryLabelCatalog_base {
|
|
22
22
|
}
|
|
23
23
|
declare const RepositoryLabelsNotModified_base: Schema.Class<RepositoryLabelsNotModified, Schema.TaggedStruct<"RepositoryLabelsNotModified", {}>, {}>;
|
|
24
|
-
/** GitHub
|
|
24
|
+
/** The result when GitHub confirms that the catalog with this ETag hasn't changed. */
|
|
25
25
|
export declare class RepositoryLabelsNotModified extends RepositoryLabelsNotModified_base {
|
|
26
26
|
}
|
|
27
|
-
/** A complete label catalog or confirmation that the cached catalog is unchanged. */
|
|
27
|
+
/** A complete label catalog, or confirmation that the cached catalog is unchanged. */
|
|
28
28
|
export declare const RepositoryLabelDetection: Schema.Union<readonly [typeof RepositoryLabelCatalog, typeof RepositoryLabelsNotModified]>;
|
|
29
29
|
export type RepositoryLabelDetection = typeof RepositoryLabelDetection.Type;
|
|
30
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/polling/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/polling/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,kEAE/B,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC;AAElE,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,2DAEiB,CAAC;AACnD,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAC;;;;;;AAEpE,8FAA8F;AAC9F,qBAAa,eAAgB,SAAQ,oBAMpC;CAAG;;;;;AAOJ,wEAAwE;AACxE,qBAAa,sBAAuB,SAAQ,2BAK1C;CAAG;;AAEL,sFAAsF;AACtF,qBAAa,2BAA4B,SAAQ,gCAEb;CAAG;AAEvC,sFAAsF;AACtF,eAAO,MAAM,wBAAwB,4FAGnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,IAAI,CAAC"}
|
package/dist/polling/labels.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { EntityTag } from "./detection.js";
|
|
3
|
-
/** A repository label name as returned by GitHub,
|
|
3
|
+
/** A repository label name as returned by GitHub, with case preserved. */
|
|
4
4
|
export const RepositoryLabelName = Schema.NonEmptyString.pipe(Schema.brand("GitHubRepositoryLabelName"));
|
|
5
|
-
/**
|
|
5
|
+
/** A label color as six hex digits without the leading `#`. */
|
|
6
6
|
export const RepositoryLabelColor = Schema.String.check(Schema.isPattern(/^[0-9a-fA-F]{6}$/u, { message: "Expected a six-digit hex label color" })).pipe(Schema.brand("GitHubRepositoryLabelColor"));
|
|
7
|
-
/**
|
|
7
|
+
/** A repository label. The name selects lanes; color and description are for display only. */
|
|
8
8
|
export class RepositoryLabel extends Schema.Class("@usine/github/RepositoryLabel")({
|
|
9
9
|
name: RepositoryLabelName,
|
|
10
10
|
color: RepositoryLabelColor,
|
|
@@ -18,10 +18,10 @@ export class RepositoryLabelCatalog extends Schema.Class("@usine/github/Reposito
|
|
|
18
18
|
labels: Schema.Array(RepositoryLabel).check(uniqueLabelNames),
|
|
19
19
|
}) {
|
|
20
20
|
}
|
|
21
|
-
/** GitHub
|
|
21
|
+
/** The result when GitHub confirms that the catalog with this ETag hasn't changed. */
|
|
22
22
|
export class RepositoryLabelsNotModified extends Schema.TaggedClass("@usine/github/RepositoryLabelsNotModified")("RepositoryLabelsNotModified", {}) {
|
|
23
23
|
}
|
|
24
|
-
/** A complete label catalog or confirmation that the cached catalog is unchanged. */
|
|
24
|
+
/** A complete label catalog, or confirmation that the cached catalog is unchanged. */
|
|
25
25
|
export const RepositoryLabelDetection = Schema.Union([
|
|
26
26
|
RepositoryLabelCatalog,
|
|
27
27
|
RepositoryLabelsNotModified,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/polling/labels.ts"],"names":[],"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MAAM,CAAC,KAAK,CACtD,sCAAsC,CACvC,CAAC;IACA,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CAC9D,CAAC;CAAG;AAEL,sFAAsF;AACtF,MAAM,OAAO,2BAA4B,SAAQ,MAAM,CAAC,WAAW,CACjE,2CAA2C,CAC5C,CAAC,6BAA6B,EAAE,EAAE,CAAC;CAAG;AAEvC,sFAAsF;AACtF,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,KAAK,CAAC;IACnD,sBAAsB;IACtB,2BAA2B;CAC5B,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
/** The issue payload slice
|
|
2
|
+
/** The issue payload slice available to `if:` expressions and prompt interpolation. */
|
|
3
3
|
export declare const IssuePayload: Schema.Struct<{
|
|
4
4
|
readonly number: Schema.Int;
|
|
5
5
|
readonly title: Schema.String;
|
|
@@ -91,7 +91,7 @@ export declare const IssuePayload: Schema.Struct<{
|
|
|
91
91
|
}, never, never>>, never, never>;
|
|
92
92
|
}>;
|
|
93
93
|
export type IssuePayload = typeof IssuePayload.Type;
|
|
94
|
-
/** The pull
|
|
94
|
+
/** The pull request payload slice available to `if:` expressions and prompt interpolation. */
|
|
95
95
|
export declare const PullRequestPayload: Schema.Struct<{
|
|
96
96
|
readonly number: Schema.Int;
|
|
97
97
|
readonly title: Schema.String;
|
|
@@ -113,6 +113,8 @@ export declare const PullRequestPayload: Schema.Struct<{
|
|
|
113
113
|
readonly deletions: Schema.Int;
|
|
114
114
|
readonly changedFiles: Schema.Int;
|
|
115
115
|
readonly reviewDecision: Schema.NullOr<Schema.String>;
|
|
116
|
+
readonly mergeable: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
117
|
+
readonly mergeStateStatus: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
116
118
|
readonly statusCheckRollup: Schema.NullOr<Schema.Struct<{
|
|
117
119
|
readonly state: Schema.String;
|
|
118
120
|
}>>;
|
|
@@ -273,7 +275,7 @@ export declare const PullRequestPayload: Schema.Struct<{
|
|
|
273
275
|
}, never, never>>, never, never>;
|
|
274
276
|
}>;
|
|
275
277
|
export type PullRequestPayload = typeof PullRequestPayload.Type;
|
|
276
|
-
/**
|
|
278
|
+
/** The hash of an Item's payload content for Event deduplication; timestamp-only changes keep the same hash. */
|
|
277
279
|
export declare const ContentHash: Schema.brand<Schema.String, "GitHubContentHash">;
|
|
278
280
|
export type ContentHash = typeof ContentHash.Type;
|
|
279
281
|
declare const IssueSnapshot_base: Schema.Class<IssueSnapshot, Schema.TaggedStruct<"IssueSnapshot", {
|
|
@@ -369,7 +371,7 @@ declare const IssueSnapshot_base: Schema.Class<IssueSnapshot, Schema.TaggedStruc
|
|
|
369
371
|
}>;
|
|
370
372
|
readonly contentHash: Schema.brand<Schema.String, "GitHubContentHash">;
|
|
371
373
|
}>, {}>;
|
|
372
|
-
/** An issue's
|
|
374
|
+
/** An issue's payload and the content hash used to decide whether it's new work. */
|
|
373
375
|
export declare class IssueSnapshot extends IssueSnapshot_base {
|
|
374
376
|
}
|
|
375
377
|
declare const PullRequestSnapshot_base: Schema.Class<PullRequestSnapshot, Schema.TaggedStruct<"PullRequestSnapshot", {
|
|
@@ -394,6 +396,8 @@ declare const PullRequestSnapshot_base: Schema.Class<PullRequestSnapshot, Schema
|
|
|
394
396
|
readonly deletions: Schema.Int;
|
|
395
397
|
readonly changedFiles: Schema.Int;
|
|
396
398
|
readonly reviewDecision: Schema.NullOr<Schema.String>;
|
|
399
|
+
readonly mergeable: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
400
|
+
readonly mergeStateStatus: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
397
401
|
readonly statusCheckRollup: Schema.NullOr<Schema.Struct<{
|
|
398
402
|
readonly state: Schema.String;
|
|
399
403
|
}>>;
|
|
@@ -555,10 +559,10 @@ declare const PullRequestSnapshot_base: Schema.Class<PullRequestSnapshot, Schema
|
|
|
555
559
|
}>;
|
|
556
560
|
readonly contentHash: Schema.brand<Schema.String, "GitHubContentHash">;
|
|
557
561
|
}>, {}>;
|
|
558
|
-
/** A pull request's
|
|
562
|
+
/** A pull request's payload and the content hash used to decide whether it's new work. */
|
|
559
563
|
export declare class PullRequestSnapshot extends PullRequestSnapshot_base {
|
|
560
564
|
}
|
|
561
|
-
/** The fetched Item state
|
|
565
|
+
/** The fetched Item state used by selection, prompt rendering, and Event deduplication. */
|
|
562
566
|
export declare const PayloadSnapshot: Schema.Union<readonly [typeof IssueSnapshot, typeof PullRequestSnapshot]>;
|
|
563
567
|
export type PayloadSnapshot = typeof PayloadSnapshot.Type;
|
|
564
568
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/polling/payload.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/polling/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAgB,MAAM,QAAQ,CAAC;AA6CtD,uFAAuF;AACvF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC;AAiBpD,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAC;AAEhE,gHAAgH;AAChH,eAAO,MAAM,WAAW,kDAEiB,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElD,oFAAoF;AACpF,qBAAa,aAAc,SAAQ,kBAMlC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEJ,0FAA0F;AAC1F,qBAAa,mBAAoB,SAAQ,wBAKvC;CAAG;AAEL,2FAA2F;AAC3F,eAAO,MAAM,eAAe,2EAAqD,CAAC;AAClF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC"}
|
package/dist/polling/payload.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Schema, SchemaGetter } from "effect";
|
|
1
|
+
import { Effect, Schema, SchemaGetter } from "effect";
|
|
2
2
|
const PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
3
3
|
const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
4
4
|
const Timestamp = Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/u, {
|
|
5
5
|
message: "Expected a GitHub UTC timestamp",
|
|
6
6
|
}));
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* non-null and hashes both shapes identically.
|
|
8
|
+
* Decodes a nullable GraphQL connection with null as `empty`, so the payload type is non-null
|
|
9
|
+
* and both shapes hash the same.
|
|
11
10
|
*/
|
|
12
11
|
const orEmpty = (schema, empty) => Schema.NullOr(schema).pipe(Schema.decodeTo(schema, {
|
|
13
12
|
decode: SchemaGetter.transform((value) => value ?? empty),
|
|
@@ -27,7 +26,7 @@ const IssueComments = Schema.Struct({
|
|
|
27
26
|
totalCount: NonNegativeInt,
|
|
28
27
|
nodes: Schema.Array(IssueComment),
|
|
29
28
|
});
|
|
30
|
-
/** The issue payload slice
|
|
29
|
+
/** The issue payload slice available to `if:` expressions and prompt interpolation. */
|
|
31
30
|
export const IssuePayload = Schema.Struct({
|
|
32
31
|
number: PositiveInt,
|
|
33
32
|
title: Schema.String,
|
|
@@ -54,7 +53,7 @@ export const IssuePayload = Schema.Struct({
|
|
|
54
53
|
})),
|
|
55
54
|
}), emptyConnection),
|
|
56
55
|
});
|
|
57
|
-
/** Null
|
|
56
|
+
/** Null for a deleted user or a mannequin; the null is kept in the payload. */
|
|
58
57
|
const RequestedReviewer = Schema.NullOr(Schema.Struct({ login: Schema.optionalKey(Schema.NonEmptyString) }));
|
|
59
58
|
const Review = Schema.Struct({
|
|
60
59
|
author: NullableActor,
|
|
@@ -64,7 +63,7 @@ const Review = Schema.Struct({
|
|
|
64
63
|
commit: Schema.NullOr(Schema.Struct({ oid: Schema.NonEmptyString })),
|
|
65
64
|
});
|
|
66
65
|
const ReviewThreadComment = Schema.Struct({ author: NullableActor, body: Schema.String });
|
|
67
|
-
/** The pull
|
|
66
|
+
/** The pull request payload slice available to `if:` expressions and prompt interpolation. */
|
|
68
67
|
export const PullRequestPayload = Schema.Struct({
|
|
69
68
|
number: PositiveInt,
|
|
70
69
|
title: Schema.String,
|
|
@@ -84,6 +83,11 @@ export const PullRequestPayload = Schema.Struct({
|
|
|
84
83
|
deletions: NonNegativeInt,
|
|
85
84
|
changedFiles: NonNegativeInt,
|
|
86
85
|
reviewDecision: Schema.NullOr(Schema.String),
|
|
86
|
+
// GitHub computes mergeability lazily, so the first fetch after the base changes can return
|
|
87
|
+
// UNKNOWN. Polling refreshes open PRs even when the REST issue feed is unchanged, until the
|
|
88
|
+
// value is computed. Older projections decode as UNKNOWN until then.
|
|
89
|
+
mergeable: Schema.String.pipe(Schema.withDecodingDefaultKey(Effect.succeed("UNKNOWN"))),
|
|
90
|
+
mergeStateStatus: Schema.String.pipe(Schema.withDecodingDefaultKey(Effect.succeed("UNKNOWN"))),
|
|
87
91
|
statusCheckRollup: Schema.NullOr(Schema.Struct({ state: Schema.String })),
|
|
88
92
|
labels: orEmpty(Labels, emptyConnection),
|
|
89
93
|
reviewRequests: orEmpty(Schema.Struct({
|
|
@@ -109,20 +113,20 @@ export const PullRequestPayload = Schema.Struct({
|
|
|
109
113
|
nodes: Schema.Array(Schema.Struct({ number: PositiveInt, state: Schema.String })),
|
|
110
114
|
}), emptyConnection),
|
|
111
115
|
});
|
|
112
|
-
/**
|
|
116
|
+
/** The hash of an Item's payload content for Event deduplication; timestamp-only changes keep the same hash. */
|
|
113
117
|
export const ContentHash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u, { message: "Expected a SHA-256 content hash" })).pipe(Schema.brand("GitHubContentHash"));
|
|
114
|
-
/** An issue's
|
|
118
|
+
/** An issue's payload and the content hash used to decide whether it's new work. */
|
|
115
119
|
export class IssueSnapshot extends Schema.TaggedClass("@usine/github/IssueSnapshot")("IssueSnapshot", {
|
|
116
120
|
payload: IssuePayload,
|
|
117
121
|
contentHash: ContentHash,
|
|
118
122
|
}) {
|
|
119
123
|
}
|
|
120
|
-
/** A pull request's
|
|
124
|
+
/** A pull request's payload and the content hash used to decide whether it's new work. */
|
|
121
125
|
export class PullRequestSnapshot extends Schema.TaggedClass("@usine/github/PullRequestSnapshot")("PullRequestSnapshot", {
|
|
122
126
|
payload: PullRequestPayload,
|
|
123
127
|
contentHash: ContentHash,
|
|
124
128
|
}) {
|
|
125
129
|
}
|
|
126
|
-
/** The fetched Item state
|
|
130
|
+
/** The fetched Item state used by selection, prompt rendering, and Event deduplication. */
|
|
127
131
|
export const PayloadSnapshot = Schema.Union([IssueSnapshot, PullRequestSnapshot]);
|
|
128
132
|
//# sourceMappingURL=payload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/polling/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/polling/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtD,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvE,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1E,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACnC,MAAM,CAAC,SAAS,CAAC,mDAAmD,EAAE;IACpE,OAAO,EAAE,iCAAiC;CAC3C,CAAC,CACH,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,GAAG,CAAI,MAAwC,EAAE,KAAQ,EAAE,EAAE,CACxE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CACxB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,KAAe,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,CAAC;IACnE,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,KAAQ,EAAE,EAAE,CAAC,KAAK,CAAC;C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,CAAC;KAClF,CAAC,EACF,eAAe,CAChB;CACF,CAAC,CAAC;AAGH,gHAAgH;AAChH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAC5C,MAAM,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC,CACpF,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAG1C,oFAAoF;AACpF,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,CAAgB,6BAA6B,CAAC,CACjG,eAAe,EACf;IACE,OAAO,EAAE,YAAY;IACrB,WAAW,EAAE,WAAW;CACzB,CACF;CAAG;AAEJ,0FAA0F;AAC1F,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,CACzD,mCAAmC,CACpC,CAAC,qBAAqB,EAAE;IACvB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EAAE,WAAW;CACzB,CAAC;CAAG;AAEL,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC,CAAC"}
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
+
import { ItemNumber } from "@usine/core/item";
|
|
1
2
|
import { RepositoryName } from "@usine/core/repository";
|
|
2
3
|
import { Context, Crypto, Effect, Layer, Option } from "effect";
|
|
3
4
|
import { HttpClient } from "effect/unstable/http";
|
|
4
5
|
import { GitHubApp } from "../github-app.ts";
|
|
5
|
-
import { type GitHubAppError } from "../error.ts";
|
|
6
|
+
import { GitHubItemNotFoundError, type GitHubAppError } from "../error.ts";
|
|
6
7
|
import { EntityTag, PollCursor, type ChangeDetection, type ChangedItem } from "./detection.ts";
|
|
7
8
|
import { type PayloadSnapshot } from "./payload.ts";
|
|
8
9
|
import { RepositoryLabelCatalog, RepositoryLabelsNotModified } from "./labels.ts";
|
|
9
10
|
declare const GitHubPolling_base: Context.ServiceClass<GitHubPolling, "@usine/github/GitHubPolling", {
|
|
10
|
-
/**
|
|
11
|
+
/** Returns issue and PR updates since the saved cursor. Persist the returned cursor after processing the detected Items. */
|
|
11
12
|
readonly changes: (repository: RepositoryName, cursor: PollCursor) => Effect.Effect<ChangeDetection, GitHubAppError>;
|
|
12
|
-
/**
|
|
13
|
+
/** Returns the repository's label catalog, or confirms that the catalog with `entityTag` is unchanged. */
|
|
13
14
|
readonly labels: (repository: RepositoryName, entityTag: Option.Option<EntityTag>) => Effect.Effect<RepositoryLabelCatalog | RepositoryLabelsNotModified, GitHubAppError>;
|
|
14
|
-
/**
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Returns an Item's selection and prompt payload with its content hash. Fails with
|
|
17
|
+
* `GitHubItemNotFoundError` if the repository responds but has no such Item.
|
|
18
|
+
*/
|
|
19
|
+
readonly snapshot: (repository: RepositoryName, item: ChangedItem) => Effect.Effect<PayloadSnapshot, GitHubAppError | GitHubItemNotFoundError>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the issue numbers in `numbers` that the repository no longer has (deleted,
|
|
22
|
+
* transferred, or not readable by the App). Sends sequential GraphQL requests of 50 numbers,
|
|
23
|
+
* and none for an empty list. Fails with `InvalidGitHubResponseError` if the repository is
|
|
24
|
+
* null.
|
|
25
|
+
*/
|
|
26
|
+
readonly missingIssues: (repository: RepositoryName, numbers: ReadonlyArray<ItemNumber>) => Effect.Effect<ReadonlyArray<ItemNumber>, GitHubAppError>;
|
|
16
27
|
}>;
|
|
17
|
-
/**
|
|
28
|
+
/** The service that finds changed GitHub Items and fetches their snapshots for Loop selection. */
|
|
18
29
|
export declare class GitHubPolling extends GitHubPolling_base {
|
|
19
30
|
static readonly layer: Layer.Layer<GitHubPolling, never, Crypto.Crypto | GitHubApp | HttpClient.HttpClient>;
|
|
20
31
|
}
|
|
21
32
|
export { EntityTag, PollCursor, ChangedIssue, ChangedPullRequest, ChangedItem, RepositoryNotModified, RepositoryChanges, ChangeDetection, } from "./detection.ts";
|
|
22
33
|
export { RepositoryLabelName, RepositoryLabelColor, RepositoryLabel, RepositoryLabelCatalog, RepositoryLabelsNotModified, RepositoryLabelDetection, } from "./labels.ts";
|
|
34
|
+
export { GitHubItemNotFoundError } from "../error.ts";
|
|
23
35
|
export { ContentHash, IssuePayload, PullRequestPayload, IssueSnapshot, PullRequestSnapshot, PayloadSnapshot, } from "./payload.ts";
|
|
24
36
|
//# sourceMappingURL=polling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../src/polling/polling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAuB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../src/polling/polling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAuB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAGL,OAAO,EACP,MAAM,EAEN,MAAM,EACN,KAAK,EACL,MAAM,EAEP,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,UAAU,EAAyC,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAY7C,OAAO,EAAE,uBAAuB,EAAE,KAAK,cAAc,EAAwB,MAAM,aAAa,CAAC;AACjG,OAAO,EAGL,SAAS,EACT,UAAU,EAGV,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,sBAAsB,EAEtB,2BAA2B,EAE5B,MAAM,aAAa,CAAC;;IAiJjB,4HAA4H;sBAC1G,CAChB,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,UAAU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