@shivaedev/github 0.10.0 → 0.11.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/CHANGELOG.md +18 -0
- package/README.md +20 -2
- package/dist/GitHub.d.ts +51 -50
- package/dist/GitHub.d.ts.map +1 -1
- package/dist/GitHub.js +8 -6
- package/dist/GitHub.js.map +1 -1
- package/dist/adapters/manualRedirects.d.ts +4 -0
- package/dist/adapters/manualRedirects.d.ts.map +1 -0
- package/dist/adapters/manualRedirects.js +6 -0
- package/dist/adapters/manualRedirects.js.map +1 -0
- package/dist/adapters/mergeResponseHeaders.d.ts +3 -0
- package/dist/adapters/mergeResponseHeaders.d.ts.map +1 -0
- package/dist/adapters/mergeResponseHeaders.js +5 -0
- package/dist/adapters/mergeResponseHeaders.js.map +1 -0
- package/dist/adapters/signAppJwt.d.ts +5 -0
- package/dist/adapters/signAppJwt.d.ts.map +1 -0
- package/dist/adapters/signAppJwt.js +15 -0
- package/dist/adapters/signAppJwt.js.map +1 -0
- package/dist/adapters/verifySignature.d.ts +4 -0
- package/dist/adapters/verifySignature.d.ts.map +1 -0
- package/dist/adapters/verifySignature.js +13 -0
- package/dist/adapters/verifySignature.js.map +1 -0
- package/dist/appJwt.d.ts +2 -3
- package/dist/appJwt.d.ts.map +1 -1
- package/dist/appJwt.js +3 -12
- package/dist/appJwt.js.map +1 -1
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +3 -2
- package/dist/artifacts.js.map +1 -1
- package/dist/authenticatedRequest.d.ts +5 -5
- package/dist/authenticatedRequest.d.ts.map +1 -1
- package/dist/authenticatedRequest.js +6 -5
- package/dist/authenticatedRequest.js.map +1 -1
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +2 -1
- package/dist/cache.js.map +1 -1
- package/dist/checkRuns.d.ts +4 -4
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -1
- package/dist/installationClients.d.ts +44 -44
- package/dist/markdown.d.ts +1 -0
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +3 -0
- package/dist/markdown.js.map +1 -1
- package/dist/markdownRows.d.ts +8 -1
- package/dist/markdownRows.d.ts.map +1 -1
- package/dist/markdownRows.js +39 -8
- package/dist/markdownRows.js.map +1 -1
- package/dist/pagedLists.d.ts +4 -4
- package/dist/pagedLists.d.ts.map +1 -1
- package/dist/pagedLists.js.map +1 -1
- package/dist/repositoryAddress.d.ts +11 -0
- package/dist/repositoryAddress.d.ts.map +1 -0
- package/dist/repositoryAddress.js +23 -0
- package/dist/repositoryAddress.js.map +1 -0
- package/dist/repositoryReads.d.ts +14 -13
- package/dist/repositoryReads.d.ts.map +1 -1
- package/dist/repositoryReads.js.map +1 -1
- package/dist/representations.d.ts +5 -5
- package/dist/representations.d.ts.map +1 -1
- package/dist/representations.js.map +1 -1
- package/dist/requests.d.ts +10 -6
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +11 -6
- package/dist/requests.js.map +1 -1
- package/dist/status.d.ts +2 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +2 -3
- package/dist/status.js.map +1 -1
- package/dist/stickyComments.d.ts +1 -1
- package/dist/verifyWebhook.d.ts +2 -2
- package/dist/verifyWebhook.d.ts.map +1 -1
- package/dist/verifyWebhook.js +3 -10
- package/dist/verifyWebhook.js.map +1 -1
- package/dist/viewerRepositoryAccess.d.ts +1 -1
- package/dist/viewerRepositoryAccess.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/GitHub.ts +21 -9
- package/src/adapters/manualRedirects.ts +6 -0
- package/src/adapters/mergeResponseHeaders.ts +8 -0
- package/src/adapters/signAppJwt.ts +16 -0
- package/src/adapters/verifySignature.ts +13 -0
- package/src/appJwt.ts +3 -12
- package/src/artifacts.ts +3 -5
- package/src/authenticatedRequest.ts +8 -9
- package/src/cache.ts +2 -1
- package/src/errors.ts +6 -0
- package/src/markdown.ts +4 -0
- package/src/markdownRows.ts +54 -9
- package/src/pagedLists.ts +4 -4
- package/src/repositoryAddress.ts +32 -0
- package/src/repositoryReads.ts +6 -5
- package/src/representations.ts +3 -3
- package/src/requests.ts +12 -14
- package/src/status.ts +3 -3
- package/src/verifyWebhook.ts +4 -10
package/dist/markdownRows.js
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
2
|
+
import { MarkdownBudgetTooSmall } from "./errors.js";
|
|
1
3
|
export function renderRows(rows, { byteLimit = 60_000, header = "" } = {}) {
|
|
4
|
+
return prepareRows({ header, rows }).render(byteLimit);
|
|
5
|
+
}
|
|
6
|
+
export function renderSections(sections, { byteLimit = 60_000 } = {}) {
|
|
7
|
+
const prepared = sections.filter(({ rows, header = "" }) => rows.length > 0 || header !== "").map(prepareRows);
|
|
8
|
+
let reserved = prepared.reduce((total, section) => total + section.minimumBytes, 0) + Math.max(0, prepared.length - 1) * 2;
|
|
9
|
+
let remaining = byteLimit;
|
|
10
|
+
const bodies = [];
|
|
11
|
+
for (const section of prepared) {
|
|
12
|
+
reserved -= section.minimumBytes;
|
|
13
|
+
const body = section.render(remaining - reserved);
|
|
14
|
+
if (Result.isFailure(body)) {
|
|
15
|
+
return Result.fail(new MarkdownBudgetTooSmall({ byteLimit }));
|
|
16
|
+
}
|
|
17
|
+
bodies.push(body.success);
|
|
18
|
+
remaining -= new TextEncoder().encode(body.success).byteLength + 2;
|
|
19
|
+
reserved -= 2;
|
|
20
|
+
}
|
|
21
|
+
return Result.succeed(bodies.join("\n\n"));
|
|
22
|
+
}
|
|
23
|
+
function prepareRows({ rows, header = "" }) {
|
|
2
24
|
const encoder = new TextEncoder();
|
|
3
25
|
const sizes = [0];
|
|
4
26
|
for (const row of rows) {
|
|
@@ -11,16 +33,25 @@ export function renderRows(rows, { byteLimit = 60_000, header = "" } = {}) {
|
|
|
11
33
|
function body(kept) {
|
|
12
34
|
return [...(header === "" ? [] : [header]), ...rows.slice(0, kept)].join("\n");
|
|
13
35
|
}
|
|
14
|
-
|
|
15
|
-
return body(rows.length);
|
|
16
|
-
}
|
|
17
|
-
for (let kept = rows.length - 1; kept >= 0; kept -= 1) {
|
|
36
|
+
function omitted(kept) {
|
|
18
37
|
const notice = `and ${rows.length - kept} more`;
|
|
19
38
|
const separator = kept > 0 || header !== "" ? "\n\n" : "";
|
|
20
|
-
|
|
21
|
-
return body(kept) + separator + notice;
|
|
22
|
-
}
|
|
39
|
+
return { bytes: bodySize(kept) + separator.length + encoder.encode(notice).byteLength, notice, separator };
|
|
23
40
|
}
|
|
24
|
-
|
|
41
|
+
return {
|
|
42
|
+
minimumBytes: rows.length === 0 ? headerBytes : Math.min(bodySize(rows.length), omitted(0).bytes),
|
|
43
|
+
render(byteLimit) {
|
|
44
|
+
if (bodySize(rows.length) <= byteLimit) {
|
|
45
|
+
return Result.succeed(body(rows.length));
|
|
46
|
+
}
|
|
47
|
+
for (let kept = rows.length - 1; kept >= 0; kept -= 1) {
|
|
48
|
+
const { notice, separator, bytes } = omitted(kept);
|
|
49
|
+
if (bytes <= byteLimit) {
|
|
50
|
+
return Result.succeed(body(kept) + separator + notice);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return Result.fail(new MarkdownBudgetTooSmall({ byteLimit }));
|
|
54
|
+
},
|
|
55
|
+
};
|
|
25
56
|
}
|
|
26
57
|
//# sourceMappingURL=markdownRows.js.map
|
package/dist/markdownRows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownRows.js","sourceRoot":"","sources":["../src/markdownRows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdownRows.js","sourceRoot":"","sources":["../src/markdownRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAYrD,MAAM,UAAU,UAAU,CACzB,IAAuB,E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,sBAAsB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAC/D,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/dist/pagedLists.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
2
|
import type { ServiceUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
3
3
|
import type { Representations } from "#representations.ts";
|
|
4
|
-
export interface ListOptions {
|
|
4
|
+
export interface ListOptions<E = ServiceUnavailable> {
|
|
5
5
|
readonly arrayKey?: string | undefined;
|
|
6
|
-
readonly beforeRequest?: (resource: string) => Effect.Effect<void,
|
|
6
|
+
readonly beforeRequest?: (resource: string) => Effect.Effect<void, E>;
|
|
7
7
|
readonly onDecodeError?: "fail" | "skip" | undefined;
|
|
8
8
|
readonly responseByteLimit?: number | undefined;
|
|
9
9
|
}
|
|
10
|
-
export declare function decodedPages<TSchema extends Schema.Constraint>(client: Representations, path: string, schema: TSchema, options?: ListOptions | number): Stream.Stream<{
|
|
10
|
+
export declare function decodedPages<TSchema extends Schema.Constraint, E = ServiceUnavailable>(client: Representations, path: string, schema: TSchema, options?: ListOptions<E> | number): Stream.Stream<{
|
|
11
11
|
hasNext: boolean;
|
|
12
12
|
items: TSchema["Type"][];
|
|
13
13
|
skipped: number;
|
|
14
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
14
|
+
}, E | import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | Schema.SchemaError, TSchema["DecodingServices"]>;
|
|
15
15
|
//# sourceMappingURL=pagedLists.d.ts.map
|
package/dist/pagedLists.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagedLists.d.ts","sourceRoot":"","sources":["../src/pagedLists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,WAAW;
|
|
1
|
+
{"version":3,"file":"pagedLists.d.ts","sourceRoot":"","sources":["../src/pagedLists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,kBAAkB;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACtE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED,wBAAgB,YAAY,CAAC,OAAO,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,kBAAkB,EACrF,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,WAAW,CAAC,CAAC,CAAC,GAAG,MAAW;;;;2vBAwBrC"}
|
package/dist/pagedLists.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagedLists.js","sourceRoot":"","sources":["../src/pagedLists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWxD,MAAM,UAAU,YAAY,CAC3B,MAAuB,EACvB,IAAY,EACZ,MAAe,EACf,OAAO,
|
|
1
|
+
{"version":3,"file":"pagedLists.js","sourceRoot":"","sources":["../src/pagedLists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWxD,MAAM,UAAU,YAAY,CAC3B,MAAuB,EACvB,IAAY,EACZ,MAAe,EACf,OAAO,GAA4B,EAAE;IAErC,MAAM,QAAQ,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACxF,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAC/F,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,E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CAAC,MAAM,EAAE,CAAC;IAChF,CAAC,CAAC,CACF,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
2
|
+
import { GitHubAddressInvalid } from "./errors.ts";
|
|
3
|
+
export interface RepositoryAddress {
|
|
4
|
+
readonly kind: "remote" | "shorthand" | "pull-request";
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly number: number | undefined;
|
|
7
|
+
readonly owner: string;
|
|
8
|
+
readonly repository: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseRepositoryAddress(address: string): Result.Result<RepositoryAddress, GitHubAddressInvalid>;
|
|
11
|
+
//# sourceMappingURL=repositoryAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repositoryAddress.d.ts","sourceRoot":"","sources":["../src/repositoryAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,cAAc,CAAC;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B;AAMD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAgB9G"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
2
|
+
import { GitHubAddressInvalid } from "./errors.js";
|
|
3
|
+
const REPOSITORY = /^(?:(?<remote>(?:git\+)?(?:https?:\/\/github\.com\/|ssh:\/\/git@github\.com\/|git:\/\/github\.com\/|git@github\.com:))|github:)?(?<owner>[A-Za-z0-9-]+)\/(?<name>[\w.-]+?)(?:\.git)?\/?$/u;
|
|
4
|
+
const PULL_REQUEST = /^https:\/\/github\.com\/(?<owner>[A-Za-z0-9-]+)\/(?<name>[\w.-]+)\/pull\/(?<number>[1-9]\d*)$/u;
|
|
5
|
+
export function parseRepositoryAddress(address) {
|
|
6
|
+
const input = address.trim();
|
|
7
|
+
const groups = (PULL_REQUEST.exec(input) ?? REPOSITORY.exec(input))?.groups;
|
|
8
|
+
const owner = groups?.owner;
|
|
9
|
+
const name = groups?.name;
|
|
10
|
+
const number = groups?.number === undefined ? undefined : Number(groups.number);
|
|
11
|
+
if (owner === undefined || name === undefined || name === "." || name === ".." || (number !== undefined && !Number.isSafeInteger(number))) {
|
|
12
|
+
return Result.fail(new GitHubAddressInvalid({}));
|
|
13
|
+
}
|
|
14
|
+
let kind = "shorthand";
|
|
15
|
+
if (number !== undefined) {
|
|
16
|
+
kind = "pull-request";
|
|
17
|
+
}
|
|
18
|
+
else if (groups?.remote !== undefined) {
|
|
19
|
+
kind = "remote";
|
|
20
|
+
}
|
|
21
|
+
return Result.succeed({ kind, name, number, owner, repository: `${owner}/${name}` });
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=repositoryAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repositoryAddress.js","sourceRoot":"","sources":["../src/repositoryAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAUnD,MAAM,UAAU,GACf,2LAA2L,CAAC;AAC7L,MAAM,YAAY,GAAG,gGAAgG,CAAC;AAEtH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACrD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;IAC5E,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,CAAC;IAC5B,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChF,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAC3I,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,IAAI,GAA8B,WAAW,CAAC;IAClD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,IAAI,GAAG,cAAc,CAAC;IACvB,CAAC;SAAM,IAAI,MAAM,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;QACzC,IAAI,GAAG,QAAQ,CAAC;IACjB,CAAC;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import type { ServiceUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
2
3
|
import { type ListOptions } from "#pagedLists.ts";
|
|
3
4
|
import type { Representations } from "#representations.ts";
|
|
4
|
-
export interface RepositoryListOptions extends ListOptions {
|
|
5
|
+
export interface RepositoryListOptions<E = ServiceUnavailable> extends ListOptions<E> {
|
|
5
6
|
readonly query?: Readonly<Record<string, string | number | boolean | undefined>>;
|
|
6
7
|
}
|
|
7
8
|
export declare function repositoryReads(client: Representations): {
|
|
@@ -59,7 +60,7 @@ export declare function repositoryReads(client: Representations): {
|
|
|
59
60
|
}[] | undefined;
|
|
60
61
|
readonly status: "ahead" | "behind" | "diverged" | "identical";
|
|
61
62
|
readonly totalCommits: number;
|
|
62
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
63
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>;
|
|
63
64
|
getCollaboratorPermission: (owner: string, repo: string, username: string, byteLimit?: number) => Effect.Effect<{
|
|
64
65
|
readonly permission: string;
|
|
65
66
|
readonly roleName: string;
|
|
@@ -70,7 +71,7 @@ export declare function repositoryReads(client: Representations): {
|
|
|
70
71
|
readonly login: string;
|
|
71
72
|
readonly type: string;
|
|
72
73
|
};
|
|
73
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
74
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>;
|
|
74
75
|
getCommit: (owner: string, repo: string, ref: string, byteLimit?: number) => Effect.Effect<{
|
|
75
76
|
readonly author: {
|
|
76
77
|
readonly avatarUrl: string;
|
|
@@ -124,7 +125,7 @@ export declare function repositoryReads(client: Representations): {
|
|
|
124
125
|
readonly deletions: number;
|
|
125
126
|
readonly total: number;
|
|
126
127
|
};
|
|
127
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
128
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>;
|
|
128
129
|
getIssue: (owner: string, repo: string, number: number, byteLimit?: number) => Effect.Effect<{
|
|
129
130
|
readonly body: string | null;
|
|
130
131
|
readonly closedAt: string | null;
|
|
@@ -148,7 +149,7 @@ export declare function repositoryReads(client: Representations): {
|
|
|
148
149
|
readonly login: string;
|
|
149
150
|
readonly type: string;
|
|
150
151
|
} | null;
|
|
151
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
152
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>;
|
|
152
153
|
getTree: (owner: string, repo: string, sha: string, options?: {
|
|
153
154
|
readonly recursive?: boolean;
|
|
154
155
|
readonly responseByteLimit?: number | undefined;
|
|
@@ -164,15 +165,15 @@ export declare function repositoryReads(client: Representations): {
|
|
|
164
165
|
}[];
|
|
165
166
|
readonly truncated: boolean;
|
|
166
167
|
readonly url: string;
|
|
167
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
168
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>;
|
|
168
169
|
getUser: (username?: string, byteLimit?: number) => Effect.Effect<{
|
|
169
170
|
readonly avatarUrl: string;
|
|
170
171
|
readonly htmlUrl: string;
|
|
171
172
|
readonly id: number;
|
|
172
173
|
readonly login: string;
|
|
173
174
|
readonly type: string;
|
|
174
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
175
|
-
listCommits: (owner: string, repo: string, options?: RepositoryListOptions) => Effect.Effect<import("effect/Stream").Stream<{
|
|
175
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>;
|
|
176
|
+
listCommits: <E = ServiceUnavailable>(owner: string, repo: string, options?: RepositoryListOptions<E>) => Effect.Effect<import("effect/Stream").Stream<{
|
|
176
177
|
hasNext: boolean;
|
|
177
178
|
items: {
|
|
178
179
|
readonly author: {
|
|
@@ -214,8 +215,8 @@ export declare function repositoryReads(client: Representations): {
|
|
|
214
215
|
readonly sha: string;
|
|
215
216
|
}[];
|
|
216
217
|
skipped: number;
|
|
217
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
218
|
-
listIssues: (owner: string, repo: string, options?: RepositoryListOptions) => Effect.Effect<import("effect/Stream").Stream<{
|
|
218
|
+
}, E | import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>, never, never>;
|
|
219
|
+
listIssues: <E = ServiceUnavailable>(owner: string, repo: string, options?: RepositoryListOptions<E>) => Effect.Effect<import("effect/Stream").Stream<{
|
|
219
220
|
hasNext: boolean;
|
|
220
221
|
items: {
|
|
221
222
|
readonly body: string | null;
|
|
@@ -242,8 +243,8 @@ export declare function repositoryReads(client: Representations): {
|
|
|
242
243
|
} | null;
|
|
243
244
|
}[];
|
|
244
245
|
skipped: number;
|
|
245
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
246
|
-
listPullRequestFiles: (owner: string, repo: string, number: number, options?: RepositoryListOptions) => Effect.Effect<import("effect/Stream").Stream<{
|
|
246
|
+
}, E | import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>, never, never>;
|
|
247
|
+
listPullRequestFiles: <E = ServiceUnavailable>(owner: string, repo: string, number: number, options?: RepositoryListOptions<E>) => Effect.Effect<import("effect/Stream").Stream<{
|
|
247
248
|
hasNext: boolean;
|
|
248
249
|
items: {
|
|
249
250
|
readonly additions: number;
|
|
@@ -256,6 +257,6 @@ export declare function repositoryReads(client: Representations): {
|
|
|
256
257
|
readonly status: string;
|
|
257
258
|
}[];
|
|
258
259
|
skipped: number;
|
|
259
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
260
|
+
}, E | import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | import("effect/Schema").SchemaError, never>, never, never>;
|
|
260
261
|
};
|
|
261
262
|
//# sourceMappingURL=repositoryReads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repositoryReads.d.ts","sourceRoot":"","sources":["../src/repositoryReads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"repositoryReads.d.ts","sourceRoot":"","sources":["../src/repositoryReads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,kBAAkB,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACpF,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC;CACjF;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe;IAcrD,cAAc,U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,OAAO,CAAC,CAAC;KAC3I,CAAC;AACH,CAAC"}
|
|
@@ -2,18 +2,18 @@ import { Effect, Stream } from "effect";
|
|
|
2
2
|
import { HttpClientRequest } from "effect/http";
|
|
3
3
|
import type { ServiceUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
4
4
|
import type { requests } from "#requests.ts";
|
|
5
|
-
export declare function representations(apiUrl: string, request: ReturnType<typeof requests
|
|
5
|
+
export declare function representations(apiUrl: string, request: Effect.Success<ReturnType<typeof requests>>, resource: (path: string) => string, responseByteLimit?: number): {
|
|
6
6
|
get: (path: string, accept?: string) => HttpClientRequest.HttpClientRequest;
|
|
7
|
-
list: (path: string, beforeRequest?: (resource: string) => Effect.Effect<void,
|
|
7
|
+
list: <E = ServiceUnavailable>(path: string, beforeRequest?: (resource: string) => Effect.Effect<void, E>, byteLimit?: number) => Effect.Effect<Stream.Stream<{
|
|
8
8
|
decode: <TSchema extends import("effect/Schema").Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], import("effect/Schema").SchemaError, TSchema["DecodingServices"]>;
|
|
9
9
|
hasNext: boolean;
|
|
10
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
10
|
+
}, E | import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge, never>, never, never>;
|
|
11
11
|
read: (path: string, byteLimit?: number) => Effect.Effect<{
|
|
12
12
|
decode: <TSchema extends import("effect/Schema").Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], import("effect/Schema").SchemaError, TSchema["DecodingServices"]>;
|
|
13
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
13
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge, never>;
|
|
14
14
|
write: (method: "POST" | "PATCH" | "PUT" | "DELETE", path: string, body?: unknown, byteLimit?: number) => Effect.Effect<{
|
|
15
15
|
decode: <TSchema extends import("effect/Schema").Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], import("effect/Schema").SchemaError, TSchema["DecodingServices"]>;
|
|
16
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("effect/http/HttpBody").HttpBodyError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
16
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("effect/http/HttpBody").HttpBodyError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge, never>;
|
|
17
17
|
};
|
|
18
18
|
export type Representations = Omit<ReturnType<typeof representations>, "get">;
|
|
19
19
|
//# sourceMappingURL=representations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"representations.d.ts","sourceRoot":"","sources":["../src/representations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAc,iBAAiB,EAA2B,MAAM,aAAa,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAMxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,wBAAgB,eAAe,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"representations.d.ts","sourceRoot":"","sources":["../src/representations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAc,iBAAiB,EAA2B,MAAM,aAAa,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAMxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,wBAAgB,eAAe,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,EACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAClC,iBAAiB,SAAc;gBAEZ,MAAM;WAMI,CAAC,6BACvB,MAAM,kBACI,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;;;;iBAL3B,MAAM;;;oBA6BH,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,QAAQ,MAAM,SAAS,OAAO;;;EAQtG;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"representations.js","sourceRoot":"","sources":["../src/representations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,MAAM,UAAU,eAAe,CAC9B,MAAc,EACd,
|
|
1
|
+
{"version":3,"file":"representations.js","sourceRoot":"","sources":["../src/representations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,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,CAAC;IACH,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;AACjG,CAAC"}
|
package/dist/requests.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { HttpClient, HttpClientRequest } from "effect/http";
|
|
3
3
|
import { ResponseBodyTooLarge } from "@shivaedev/http/errors.ts";
|
|
4
|
-
import { type CachedResponse } from "
|
|
5
|
-
import { GitHubTransportError } from "
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { type CachedResponse } from "#cache.ts";
|
|
5
|
+
import { GitHubTransportError } from "#errors.ts";
|
|
6
|
+
import { GitHubToken } from "#GitHubToken.ts";
|
|
7
|
+
export declare const requests: (rates: {
|
|
8
|
+
blocked: Map<string, import("#errors.ts").GitHubRateLimited>;
|
|
9
|
+
failures: Map<string, number>;
|
|
10
|
+
observations: Map<string, import("#rateLimits.ts").RateLimitObservation>;
|
|
11
|
+
observe(response: import("effect/http/HttpClientResponse").HttpClientResponse): string;
|
|
12
|
+
resource: (path: string) => string;
|
|
13
|
+
}) => Effect.Effect<(input: HttpClientRequest.HttpClientRequest, limit: number) => Effect.Effect<CachedResponse, import("#errors.ts").GitHubAppError | import("#errors.ts").GitHubConversationLocked | import("#errors.ts").GitHubPermissionDenied | import("#errors.ts").GitHubRateLimited | GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | ResponseBodyTooLarge, never>, never, GitHubToken | HttpClient.HttpClient>;
|
|
10
14
|
//# sourceMappingURL=requests.d.ts.map
|
package/dist/requests.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../src/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,KAAK,cAAc,EAAsC,MAAM,
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../src/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,KAAK,cAAc,EAAsC,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9C,eAAO,MAAM,QAAQ;;;;;;ksBA+BnB,CAAC"}
|
package/dist/requests.js
CHANGED
|
@@ -2,11 +2,16 @@ import { Effect } from "effect";
|
|
|
2
2
|
import { HttpClient, HttpClientRequest } from "effect/http";
|
|
3
3
|
import { readBoundedBody } from "@shivaedev/http/body.ts";
|
|
4
4
|
import { ResponseBodyTooLarge } from "@shivaedev/http/errors.ts";
|
|
5
|
-
import { authenticatedRequest } from "
|
|
6
|
-
import { responseCache, revalidatedResponse } from "
|
|
7
|
-
import { GitHubTransportError } from "
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import { authenticatedRequest } from "#authenticatedRequest.ts";
|
|
6
|
+
import { responseCache, revalidatedResponse } from "#cache.ts";
|
|
7
|
+
import { GitHubTransportError } from "#errors.ts";
|
|
8
|
+
import { GitHubToken } from "#GitHubToken.ts";
|
|
9
|
+
import { isUnchanged } from "#status.ts";
|
|
10
|
+
import { TokenRefresh } from "#TokenRefresh.ts";
|
|
11
|
+
export const requests = Effect.fnUntraced(function* (rates) {
|
|
12
|
+
const client = yield* HttpClient.HttpClient;
|
|
13
|
+
const token = yield* GitHubToken;
|
|
14
|
+
const refresh = yield* TokenRefresh;
|
|
10
15
|
const cache = responseCache();
|
|
11
16
|
const send = authenticatedRequest(HttpClient.withScope(client), token, rates, refresh);
|
|
12
17
|
return Effect.fn("GitHub.request")(function* (input, limit) {
|
|
@@ -32,5 +37,5 @@ export function requests(client, token, rates, refresh = undefined) {
|
|
|
32
37
|
}
|
|
33
38
|
return entry;
|
|
34
39
|
}, Effect.scoped);
|
|
35
|
-
}
|
|
40
|
+
});
|
|
36
41
|
//# sourceMappingURL=requests.js.map
|
package/dist/requests.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../src/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../src/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0B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AAE,CAAC;YACnE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
package/dist/status.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { HttpClientResponse } from "effect/http";
|
|
3
3
|
import { GitHubConversationLocked, GitHubPermissionDenied, GitHubRateLimited } from "#errors.ts";
|
|
4
4
|
export declare function isUnauthorized(response: HttpClientResponse.HttpClientResponse): boolean;
|
|
5
5
|
export declare function isUnchanged(response: HttpClientResponse.HttpClientResponse): boolean;
|
|
6
|
-
export declare const checkStatus: (response: HttpClientResponse.HttpClientResponse, resource: string, failures?: any) => Effect.Effect<HttpClientResponse.HttpClientResponse, GitHubConversationLocked | GitHubPermissionDenied | GitHubRateLimited | import("effect/http/HttpClientError").HttpClientError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").
|
|
6
|
+
export declare const checkStatus: (response: HttpClientResponse.HttpClientResponse, resource: string, failures?: any) => Effect.Effect<HttpClientResponse.HttpClientResponse, GitHubConversationLocked | GitHubPermissionDenied | GitHubRateLimited | import("effect/http/HttpClientError").HttpClientError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge, never>;
|
|
7
7
|
//# sourceMappingURL=status.d.ts.map
|
package/dist/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKtD,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,kBAAkB,CAAC,kBAAkB,WAE7E;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,kBAAkB,WAE1E;AAED,eAAO,MAAM,WAAW,kpBAgBtB,CAAC"}
|
package/dist/status.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { DateTime, Effect, Option, Schema } from "effect";
|
|
2
|
-
import { HttpClient } from "effect/http";
|
|
3
2
|
import * as HttpStatus from "effect/http/HttpStatus";
|
|
4
3
|
import { readBoundedText } from "@shivaedev/http/body.ts";
|
|
5
|
-
import {
|
|
4
|
+
import { checkStatus as checkResponseStatus } from "@shivaedev/http/checkStatus.ts";
|
|
6
5
|
import { parseRetryAfter } from "@shivaedev/http/parseRetryAfter.ts";
|
|
7
6
|
import { GitHubConversationLocked, GitHubPermissionDenied, GitHubRateLimited } from "#errors.ts";
|
|
8
7
|
export function isUnauthorized(response) {
|
|
@@ -25,7 +24,7 @@ export const checkStatus = Effect.fnUntraced(function* (response, resource, fail
|
|
|
25
24
|
return yield* refusal;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
|
-
return yield*
|
|
27
|
+
return yield* checkResponseStatus(response);
|
|
29
28
|
});
|
|
30
29
|
const Message = Schema.fromJsonString(Schema.Struct({ message: Schema.String }));
|
|
31
30
|
const responseMessage = Effect.fnUntraced(function* (response) {
|
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjG,MAAM,UAAU,cAAc,CAAC,QAA+C;IAC7E,OAAO,QAAQ,CAAC,MAAM,KAAK,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAA+C;IAC1E,OAAO,QAAQ,CAAC,MAAM,KAAK,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,QAA+C,EAAE,QAAgB,EAAE,QAAQ,GAAG,CAAC;IACtI,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;IACrC,IAAI,MAAM,KAAK,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,MAAM,KAAK,UAAU,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC5G,MAAM,gBAAgB,GACrB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AAI,QAAQ,CAAC,CAAC;IAChF,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9F,OAAO,KAAK,CAAC,CAAC,IAAI,iBAAiB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
|
package/dist/stickyComments.d.ts
CHANGED
|
@@ -41,6 +41,6 @@ export declare function stickyComments(client: Representations): {
|
|
|
41
41
|
readonly login: string;
|
|
42
42
|
readonly type?: string | undefined;
|
|
43
43
|
} | null;
|
|
44
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("effect/http/HttpBody").HttpBodyError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
44
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("effect/http/HttpBody").HttpBodyError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | Schema.SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable, never>;
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=stickyComments.d.ts.map
|
package/dist/verifyWebhook.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Effect, Redacted, Schema } from "effect";
|
|
2
|
-
import { GitHubWebhookSignatureError } from "#errors.ts";
|
|
1
|
+
import { Effect, type Redacted, Schema } from "effect";
|
|
2
|
+
import type { GitHubWebhookSignatureError } from "#errors.ts";
|
|
3
3
|
export declare function verifyWebhook(body: Uint8Array, signature: string | undefined, secret: Redacted.Redacted<string>): Effect.Effect<void, GitHubWebhookSignatureError>;
|
|
4
4
|
export declare function verifyWebhook<TSchema extends Schema.Constraint>(body: Uint8Array, signature: string | undefined, secret: Redacted.Redacted<string>, schema: TSchema): Effect.Effect<TSchema["Type"], GitHubWebhookSignatureError | Schema.SchemaError, TSchema["DecodingServices"]>;
|
|
5
5
|
//# sourceMappingURL=verifyWebhook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyWebhook.d.ts","sourceRoot":"","sources":["../src/verifyWebhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verifyWebhook.d.ts","sourceRoot":"","sources":["../src/verifyWebhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAe9D,wBAAgB,aAAa,CAC5B,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,GAC/B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAC;AACpD,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,CAAC,UAAU,EAC9D,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EACjC,MAAM,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,2BAA2B,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC"}
|
package/dist/verifyWebhook.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { GitHubWebhookSignatureError } from "#errors.ts";
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { verifySignature } from "#adapters/verifySignature.ts";
|
|
4
3
|
const verify = Effect.fnUntraced(function* (body, signature, secret, schema) {
|
|
5
|
-
|
|
6
|
-
return yield* new GitHubWebhookSignatureError();
|
|
7
|
-
}
|
|
8
|
-
const expected = createHmac("sha256", Redacted.value(secret)).update(body).digest();
|
|
9
|
-
if (!timingSafeEqual(expected, Buffer.from(signature.slice(7), "hex"))) {
|
|
10
|
-
return yield* new GitHubWebhookSignatureError();
|
|
11
|
-
}
|
|
4
|
+
yield* verifySignature(body, signature, secret);
|
|
12
5
|
if (schema === undefined) {
|
|
13
6
|
return;
|
|
14
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyWebhook.js","sourceRoot":"","sources":["../src/verifyWebhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"verifyWebhook.js","sourceRoot":"","sources":["../src/verifyWebhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EACzC,IAAgB,EAChB,SAA6B,EAC7B,MAAiC,EACjC,MAAgB;IAEhB,KAAK,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAChD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;IACR,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACzG,CAAC,CAAC,CAAC;AAaH,MAAM,UAAU,aAAa,CAC5B,IAAgB,EAChB,SAA6B,EAC7B,MAAiC,EACjC,MAAgB;IAEhB,OAAO,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -42,5 +42,5 @@ export declare function viewerRepositoryAccess(app: Representations, installatio
|
|
|
42
42
|
} & {
|
|
43
43
|
readonly installationId: number;
|
|
44
44
|
})[];
|
|
45
|
-
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").
|
|
45
|
+
}, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").RemoteGone | import("@shivaedev/http/errors.ts").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteNotFound | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | Schema.SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable, never>, never, never>;
|
|
46
46
|
//# sourceMappingURL=viewerRepositoryAccess.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewerRepositoryAccess.d.ts","sourceRoot":"","sources":["../src/viewerRepositoryAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAU,MAAM,QAAQ,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;;;;;;;;;EAMmB,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,OAAO,mBAAmB,CAAC,IAAI,GAAG;QAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IAC3G,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,OAAO,mBAAmB,CAAC,IAAI,GAAG;QAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACtG;AA6BD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;;;;;;;;;;iCA/BzB,MAAM;;;;;;;;;;;iCACX,MAAM;;
|
|
1
|
+
{"version":3,"file":"viewerRepositoryAccess.d.ts","sourceRoot":"","sources":["../src/viewerRepositoryAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAU,MAAM,QAAQ,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;;;;;;;;;EAMmB,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC,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