@usine/github 0.0.1 → 0.1.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 +117 -2
- package/dist/access.d.ts +48 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +53 -0
- package/dist/access.js.map +1 -0
- package/dist/credentials.d.ts +28 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +22 -0
- package/dist/credentials.js.map +1 -0
- package/dist/error.d.ts +36 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +48 -0
- package/dist/error.js.map +1 -0
- package/dist/github-app.d.ts +30 -0
- package/dist/github-app.d.ts.map +1 -0
- package/dist/github-app.js +184 -0
- package/dist/github-app.js.map +1 -0
- package/dist/http.d.ts +18 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +68 -0
- package/dist/http.js.map +1 -0
- package/dist/installation.d.ts +48 -0
- package/dist/installation.d.ts.map +1 -0
- package/dist/installation.js +40 -0
- package/dist/installation.js.map +1 -0
- package/dist/item-writer.d.ts +23 -0
- package/dist/item-writer.d.ts.map +1 -0
- package/dist/item-writer.js +67 -0
- package/dist/item-writer.js.map +1 -0
- package/dist/jwt.d.ts +11 -0
- package/dist/jwt.d.ts.map +1 -0
- package/dist/jwt.js +72 -0
- package/dist/jwt.js.map +1 -0
- package/dist/label-writer.d.ts +23 -0
- package/dist/label-writer.d.ts.map +1 -0
- package/dist/label-writer.js +54 -0
- package/dist/label-writer.js.map +1 -0
- package/dist/local-secrets.d.ts +28 -0
- package/dist/local-secrets.d.ts.map +1 -0
- package/dist/local-secrets.js +56 -0
- package/dist/local-secrets.js.map +1 -0
- package/dist/polling/content.d.ts +3 -0
- package/dist/polling/content.d.ts.map +1 -0
- package/dist/polling/content.js +24 -0
- package/dist/polling/content.js.map +1 -0
- package/dist/polling/detection.d.ts +55 -0
- package/dist/polling/detection.d.ts.map +1 -0
- package/dist/polling/detection.js +49 -0
- package/dist/polling/detection.js.map +1 -0
- package/dist/polling/labels.d.ts +31 -0
- package/dist/polling/labels.d.ts.map +1 -0
- package/dist/polling/labels.js +29 -0
- package/dist/polling/labels.js.map +1 -0
- package/dist/polling/payload.d.ts +565 -0
- package/dist/polling/payload.d.ts.map +1 -0
- package/dist/polling/payload.js +128 -0
- package/dist/polling/payload.js.map +1 -0
- package/dist/polling/polling.d.ts +24 -0
- package/dist/polling/polling.d.ts.map +1 -0
- package/dist/polling/polling.js +325 -0
- package/dist/polling/polling.js.map +1 -0
- package/dist/polling/queries.d.ts +3 -0
- package/dist/polling/queries.d.ts.map +1 -0
- package/dist/polling/queries.js +125 -0
- package/dist/polling/queries.js.map +1 -0
- package/package.json +32 -6
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-secrets.js","sourceRoot":"","sources":["../src/local-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEhG,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAEhE,MAAM,OAAO,2BAA4B,SAAQ,MAAM,CAAC,WAAW,CACjE,2CAA2C,CAC5C,CAAC,6BAA6B,EAAE;IAC/B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC;CAAG;AAEL,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAGnF,MAAM,O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
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* Timestamp fields in the payload schemas in payload.ts. Add each new timestamp
|
|
4
|
+
* field here so changes to it remain outside the content hash (ADR 0007).
|
|
5
|
+
*/
|
|
6
|
+
const TIMESTAMP_FIELDS = new Set([
|
|
7
|
+
"closedAt",
|
|
8
|
+
"createdAt",
|
|
9
|
+
"mergedAt",
|
|
10
|
+
"submittedAt",
|
|
11
|
+
"updatedAt",
|
|
12
|
+
]);
|
|
13
|
+
export const canonicalContent = (value) => {
|
|
14
|
+
if (Array.isArray(value))
|
|
15
|
+
return value.map(canonicalContent);
|
|
16
|
+
if (Schema.is(Schema.JsonObject)(value)) {
|
|
17
|
+
return Object.fromEntries(Object.entries(value)
|
|
18
|
+
.filter(([key]) => !TIMESTAMP_FIELDS.has(key))
|
|
19
|
+
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
20
|
+
.map(([key, child]) => [key, canonicalContent(child)]));
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/polling/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;GAGG;AACH,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC;IACpD,UAAU;IACV,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAkB,EAAe,EAAE;IAClE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC7D,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aAClB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAC7C,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACrE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CACzD,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** GitHub's opaque HTTP validator for a conditional repository or label-catalog request. */
|
|
3
|
+
export declare const EntityTag: Schema.brand<Schema.NonEmptyString, "GitHubEntityTag">;
|
|
4
|
+
export type EntityTag = typeof EntityTag.Type;
|
|
5
|
+
declare const PollCursor_base: Schema.Class<PollCursor, Schema.Struct<{
|
|
6
|
+
readonly entityTag: Schema.OptionFromNullOr<Schema.brand<Schema.NonEmptyString, "GitHubEntityTag">>;
|
|
7
|
+
readonly watermark: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
8
|
+
}>, {}>;
|
|
9
|
+
/** REST cursor for efficiency only. Losing it is safe because Event dedup is permanent (ADR 0007). */
|
|
10
|
+
export declare class PollCursor extends PollCursor_base {
|
|
11
|
+
static readonly empty: PollCursor;
|
|
12
|
+
}
|
|
13
|
+
declare const ChangedIssue_base: Schema.Class<ChangedIssue, Schema.TaggedStruct<"ChangedIssue", {
|
|
14
|
+
readonly number: Schema.Int;
|
|
15
|
+
readonly updatedAt: Schema.DateTimeUtc;
|
|
16
|
+
}>, {}>;
|
|
17
|
+
/** An issue number and update time reported by repository change detection. */
|
|
18
|
+
export declare class ChangedIssue extends ChangedIssue_base {
|
|
19
|
+
}
|
|
20
|
+
declare const ChangedPullRequest_base: Schema.Class<ChangedPullRequest, Schema.TaggedStruct<"ChangedPullRequest", {
|
|
21
|
+
readonly number: Schema.Int;
|
|
22
|
+
readonly updatedAt: Schema.DateTimeUtc;
|
|
23
|
+
}>, {}>;
|
|
24
|
+
/** A pull request number and update time reported by repository change detection. */
|
|
25
|
+
export declare class ChangedPullRequest extends ChangedPullRequest_base {
|
|
26
|
+
}
|
|
27
|
+
/** An issue or pull request whose payload needs to be fetched after change detection. */
|
|
28
|
+
export declare const ChangedItem: Schema.Union<readonly [typeof ChangedIssue, typeof ChangedPullRequest]>;
|
|
29
|
+
export type ChangedItem = typeof ChangedItem.Type;
|
|
30
|
+
declare const RepositoryNotModified_base: Schema.Class<RepositoryNotModified, Schema.TaggedStruct<"RepositoryNotModified", {
|
|
31
|
+
readonly cursor: typeof PollCursor;
|
|
32
|
+
readonly nextPollAt: Schema.Option<Schema.DateTimeUtc>;
|
|
33
|
+
/** Request backoff from rate pressure or Retry-After; excludes the normal polling interval. */
|
|
34
|
+
readonly backoffUntil: Schema.withConstructorDefault<Schema.Option<Schema.DateTimeUtc>>;
|
|
35
|
+
}>, {}>;
|
|
36
|
+
/** GitHub confirmed that the repository cursor still describes its current state. */
|
|
37
|
+
export declare class RepositoryNotModified extends RepositoryNotModified_base {
|
|
38
|
+
}
|
|
39
|
+
declare const RepositoryChanges_base: Schema.Class<RepositoryChanges, Schema.TaggedStruct<"RepositoryChanges", {
|
|
40
|
+
readonly cursor: typeof PollCursor;
|
|
41
|
+
readonly items: Schema.$Array<Schema.Union<readonly [typeof ChangedIssue, typeof ChangedPullRequest]>>;
|
|
42
|
+
/** True when the page cap ended the walk early. The rest arrives next cycle. */
|
|
43
|
+
readonly backlog: Schema.Boolean;
|
|
44
|
+
readonly nextPollAt: Schema.Option<Schema.DateTimeUtc>;
|
|
45
|
+
/** Request backoff from rate pressure or Retry-After; excludes the normal polling interval. */
|
|
46
|
+
readonly backoffUntil: Schema.withConstructorDefault<Schema.Option<Schema.DateTimeUtc>>;
|
|
47
|
+
}>, {}>;
|
|
48
|
+
/** Changed Items, the next cursor, and whether the page cap left more Items to fetch. */
|
|
49
|
+
export declare class RepositoryChanges extends RepositoryChanges_base {
|
|
50
|
+
}
|
|
51
|
+
/** The result of checking repository changes, including the earliest next poll time. */
|
|
52
|
+
export declare const ChangeDetection: Schema.Union<readonly [typeof RepositoryNotModified, typeof RepositoryChanges]>;
|
|
53
|
+
export type ChangeDetection = typeof ChangeDetection.Type;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=detection.d.ts.map
|
|
@@ -0,0 +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,sGAAsG;AACtG,qBAAa,UAAW,SAAQ,eAG9B;IACA,MAAM,CAAC,QAAQ,CAAC,KAAK,aAGlB;CACJ;;;;;AAED,+EAA+E;AAC/E,qBAAa,YAAa,SAAQ,iBAMjC;CAAG;;;;;AAEJ,qFAAqF;AACrF,qBAAa,kBAAmB,SAAQ,uBAKtC;CAAG;AAEL,yFAAyF;AACzF,eAAO,MAAM,WAAW,yEAAmD,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;IAQhD,+FAA+F;;;AANjG,qFAAqF;AACrF,qBAAa,qBAAsB,SAAQ,0BASzC;CAAG;;;;IAQH,gFAAgF;;;IAGhF,+FAA+F;;;AATjG,yFAAyF;AACzF,qBAAa,iBAAkB,SAAQ,sBAYrC;CAAG;AAEL,wFAAwF;AACxF,eAAO,MAAM,eAAe,iFAA2D,CAAC;AACxF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Effect, Option, Schema } from "effect";
|
|
2
|
+
/** GitHub's opaque HTTP validator for a conditional repository or label-catalog request. */
|
|
3
|
+
export const EntityTag = Schema.NonEmptyString.pipe(Schema.brand("GitHubEntityTag"));
|
|
4
|
+
/** REST cursor for efficiency only. Losing it is safe because Event dedup is permanent (ADR 0007). */
|
|
5
|
+
export class PollCursor extends Schema.Class("@usine/github/PollCursor")({
|
|
6
|
+
entityTag: Schema.OptionFromNullOr(EntityTag),
|
|
7
|
+
watermark: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
|
|
8
|
+
}) {
|
|
9
|
+
static empty = new PollCursor({
|
|
10
|
+
entityTag: Option.none(),
|
|
11
|
+
watermark: Option.none(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/** An issue number and update time reported by repository change detection. */
|
|
15
|
+
export class ChangedIssue extends Schema.TaggedClass("@usine/github/ChangedIssue")("ChangedIssue", {
|
|
16
|
+
number: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
|
|
17
|
+
updatedAt: Schema.DateTimeUtc,
|
|
18
|
+
}) {
|
|
19
|
+
}
|
|
20
|
+
/** A pull request number and update time reported by repository change detection. */
|
|
21
|
+
export class ChangedPullRequest extends Schema.TaggedClass("@usine/github/ChangedPullRequest")("ChangedPullRequest", {
|
|
22
|
+
number: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
|
|
23
|
+
updatedAt: Schema.DateTimeUtc,
|
|
24
|
+
}) {
|
|
25
|
+
}
|
|
26
|
+
/** An issue or pull request whose payload needs to be fetched after change detection. */
|
|
27
|
+
export const ChangedItem = Schema.Union([ChangedIssue, ChangedPullRequest]);
|
|
28
|
+
/** GitHub confirmed that the repository cursor still describes its current state. */
|
|
29
|
+
export class RepositoryNotModified extends Schema.TaggedClass("@usine/github/RepositoryNotModified")("RepositoryNotModified", {
|
|
30
|
+
cursor: PollCursor,
|
|
31
|
+
nextPollAt: Schema.Option(Schema.DateTimeUtc),
|
|
32
|
+
/** Request backoff from rate pressure or Retry-After; excludes the normal polling interval. */
|
|
33
|
+
backoffUntil: Schema.Option(Schema.DateTimeUtc).pipe(Schema.withConstructorDefault(Effect.succeed(Option.none()))),
|
|
34
|
+
}) {
|
|
35
|
+
}
|
|
36
|
+
/** Changed Items, the next cursor, and whether the page cap left more Items to fetch. */
|
|
37
|
+
export class RepositoryChanges extends Schema.TaggedClass("@usine/github/RepositoryChanges")("RepositoryChanges", {
|
|
38
|
+
cursor: PollCursor,
|
|
39
|
+
items: Schema.Array(ChangedItem),
|
|
40
|
+
/** True when the page cap ended the walk early. The rest arrives next cycle. */
|
|
41
|
+
backlog: Schema.Boolean,
|
|
42
|
+
nextPollAt: Schema.Option(Schema.DateTimeUtc),
|
|
43
|
+
/** Request backoff from rate pressure or Retry-After; excludes the normal polling interval. */
|
|
44
|
+
backoffUntil: Schema.Option(Schema.DateTimeUtc).pipe(Schema.withConstructorDefault(Effect.succeed(Option.none()))),
|
|
45
|
+
}) {
|
|
46
|
+
}
|
|
47
|
+
/** The result of checking repository changes, including the earliest next poll time. */
|
|
48
|
+
export const ChangeDetection = Schema.Union([RepositoryNotModified, RepositoryChanges]);
|
|
49
|
+
//# sourceMappingURL=detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detection.js","sourceRoot":"","sources":["../../src/polling/detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,4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CAAqC,CACtC,CAAC,uBAAuB,EAAE;IACzB,MAAM,EAAE,UAAU;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;IAC7C,+FAA+F;IAC/F,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAClD,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAC7D;CACF,CAAC;CAAG;AAEL,yFAAyF;AACzF,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,CACvD,iCAAiC,CAClC,CAAC,mBAAmB,EAAE;IACrB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;IAChC,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;IAC7C,+FAA+F;IAC/F,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAClD,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAC7D;CACF,CAAC;CAAG;AAEL,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** A repository label name as returned by GitHub, preserved without case conversion. */
|
|
3
|
+
export declare const RepositoryLabelName: Schema.brand<Schema.NonEmptyString, "GitHubRepositoryLabelName">;
|
|
4
|
+
export type RepositoryLabelName = typeof RepositoryLabelName.Type;
|
|
5
|
+
/** GitHub stores label colors as six hex digits without the leading hash. */
|
|
6
|
+
export declare const RepositoryLabelColor: Schema.brand<Schema.String, "GitHubRepositoryLabelColor">;
|
|
7
|
+
export type RepositoryLabelColor = typeof RepositoryLabelColor.Type;
|
|
8
|
+
declare const RepositoryLabel_base: Schema.Class<RepositoryLabel, Schema.Struct<{
|
|
9
|
+
readonly name: Schema.brand<Schema.NonEmptyString, "GitHubRepositoryLabelName">;
|
|
10
|
+
readonly color: Schema.brand<Schema.String, "GitHubRepositoryLabelColor">;
|
|
11
|
+
readonly description: Schema.OptionFromNullOr<Schema.String>;
|
|
12
|
+
}>, {}>;
|
|
13
|
+
/** One repository label as GitHub defines it. The name routes lanes, and color and description are presentation only. */
|
|
14
|
+
export declare class RepositoryLabel extends RepositoryLabel_base {
|
|
15
|
+
}
|
|
16
|
+
declare const RepositoryLabelCatalog_base: Schema.Class<RepositoryLabelCatalog, Schema.Struct<{
|
|
17
|
+
readonly entityTag: Schema.OptionFromNullOr<Schema.brand<Schema.NonEmptyString, "GitHubEntityTag">>;
|
|
18
|
+
readonly labels: Schema.$Array<typeof RepositoryLabel>;
|
|
19
|
+
}>, {}>;
|
|
20
|
+
/** A complete label catalog with the ETag of its canonical REST URL. */
|
|
21
|
+
export declare class RepositoryLabelCatalog extends RepositoryLabelCatalog_base {
|
|
22
|
+
}
|
|
23
|
+
declare const RepositoryLabelsNotModified_base: Schema.Class<RepositoryLabelsNotModified, Schema.TaggedStruct<"RepositoryLabelsNotModified", {}>, {}>;
|
|
24
|
+
/** GitHub confirmed the catalog named by its ETag has not changed. */
|
|
25
|
+
export declare class RepositoryLabelsNotModified extends RepositoryLabelsNotModified_base {
|
|
26
|
+
}
|
|
27
|
+
/** A complete label catalog or confirmation that the cached catalog is unchanged. */
|
|
28
|
+
export declare const RepositoryLabelDetection: Schema.Union<readonly [typeof RepositoryLabelCatalog, typeof RepositoryLabelsNotModified]>;
|
|
29
|
+
export type RepositoryLabelDetection = typeof RepositoryLabelDetection.Type;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +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,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,kEAE/B,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC;AAElE,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,2DAEiB,CAAC;AACnD,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAC;;;;;;AAEpE,yHAAyH;AACzH,qBAAa,eAAgB,SAAQ,oBAMpC;CAAG;;;;;AAOJ,wEAAwE;AACxE,qBAAa,sBAAuB,SAAQ,2BAK1C;CAAG;;AAEL,sEAAsE;AACtE,qBAAa,2BAA4B,SAAQ,gCAEb;CAAG;AAEvC,qFAAqF;AACrF,eAAO,MAAM,wBAAwB,4FAGnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { EntityTag } from "./detection.js";
|
|
3
|
+
/** A repository label name as returned by GitHub, preserved without case conversion. */
|
|
4
|
+
export const RepositoryLabelName = Schema.NonEmptyString.pipe(Schema.brand("GitHubRepositoryLabelName"));
|
|
5
|
+
/** GitHub stores label colors as six hex digits without the leading hash. */
|
|
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
|
+
/** One repository label as GitHub defines it. The name routes lanes, and color and description are presentation only. */
|
|
8
|
+
export class RepositoryLabel extends Schema.Class("@usine/github/RepositoryLabel")({
|
|
9
|
+
name: RepositoryLabelName,
|
|
10
|
+
color: RepositoryLabelColor,
|
|
11
|
+
description: Schema.OptionFromNullOr(Schema.String),
|
|
12
|
+
}) {
|
|
13
|
+
}
|
|
14
|
+
const uniqueLabelNames = Schema.makeFilter((labels) => new Set(labels.map(({ name }) => name)).size === labels.length, { message: "Expected unique label names" });
|
|
15
|
+
/** A complete label catalog with the ETag of its canonical REST URL. */
|
|
16
|
+
export class RepositoryLabelCatalog extends Schema.Class("@usine/github/RepositoryLabelCatalog")({
|
|
17
|
+
entityTag: Schema.OptionFromNullOr(EntityTag),
|
|
18
|
+
labels: Schema.Array(RepositoryLabel).check(uniqueLabelNames),
|
|
19
|
+
}) {
|
|
20
|
+
}
|
|
21
|
+
/** GitHub confirmed the catalog named by its ETag has not changed. */
|
|
22
|
+
export class RepositoryLabelsNotModified extends Schema.TaggedClass("@usine/github/RepositoryLabelsNotModified")("RepositoryLabelsNotModified", {}) {
|
|
23
|
+
}
|
|
24
|
+
/** A complete label catalog or confirmation that the cached catalog is unchanged. */
|
|
25
|
+
export const RepositoryLabelDetection = Schema.Union([
|
|
26
|
+
RepositoryLabelCatalog,
|
|
27
|
+
RepositoryLabelsNotModified,
|
|
28
|
+
]);
|
|
29
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/polling/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,wFAAwF;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAC3D,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAC1C,CAAC;AAGF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACrD,MAAM,CAAC,SAAS,CAA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