@shivaedev/github 0.9.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 +36 -0
- package/README.md +115 -7
- package/dist/GitHub.d.ts +279 -19
- package/dist/GitHub.d.ts.map +1 -1
- package/dist/GitHub.js +22 -10
- 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/resolveApiUrl.d.ts +2 -0
- package/dist/adapters/resolveApiUrl.d.ts.map +1 -0
- package/dist/adapters/resolveApiUrl.js +6 -0
- package/dist/adapters/resolveApiUrl.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/adapters/zipEntries.d.ts +17 -0
- package/dist/adapters/zipEntries.d.ts.map +1 -0
- package/dist/adapters/zipEntries.js +57 -0
- package/dist/adapters/zipEntries.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/appTokens.d.ts.map +1 -1
- package/dist/appTokens.js +2 -1
- package/dist/appTokens.js.map +1 -1
- package/dist/artifactErrors.d.ts +34 -0
- package/dist/artifactErrors.d.ts.map +1 -0
- package/dist/artifactErrors.js +27 -0
- package/dist/artifactErrors.js.map +1 -0
- package/dist/artifactExtraction.d.ts +12 -0
- package/dist/artifactExtraction.d.ts.map +1 -0
- package/dist/artifactExtraction.js +40 -0
- package/dist/artifactExtraction.js.map +1 -0
- package/dist/artifactPaths.d.ts +4 -0
- package/dist/artifactPaths.d.ts.map +1 -0
- package/dist/artifactPaths.js +35 -0
- package/dist/artifactPaths.js.map +1 -0
- package/dist/artifacts.d.ts +13 -8
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +18 -10
- 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/checkRuns.d.ts.map +1 -1
- package/dist/checkRuns.js +5 -3
- package/dist/checkRuns.js.map +1 -1
- 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/gitSchemas.d.ts +195 -0
- package/dist/gitSchemas.d.ts.map +1 -0
- package/dist/gitSchemas.js +45 -0
- package/dist/gitSchemas.js.map +1 -0
- package/dist/installationClients.d.ts +291 -15
- package/dist/installationClients.d.ts.map +1 -1
- package/dist/installationClients.js +14 -5
- package/dist/installationClients.js.map +1 -1
- 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 +15 -0
- package/dist/pagedLists.d.ts.map +1 -0
- package/dist/pagedLists.js +16 -0
- package/dist/pagedLists.js.map +1 -0
- 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 +262 -0
- package/dist/repositoryReads.d.ts.map +1 -0
- package/dist/repositoryReads.js +30 -0
- package/dist/repositoryReads.js.map +1 -0
- package/dist/repositorySchemas.d.ts +73 -0
- package/dist/repositorySchemas.d.ts.map +1 -0
- package/dist/repositorySchemas.js +38 -0
- package/dist/repositorySchemas.js.map +1 -0
- package/dist/representations.d.ts +5 -5
- package/dist/representations.d.ts.map +1 -1
- package/dist/representations.js +3 -2
- 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 +46 -0
- package/dist/viewerRepositoryAccess.d.ts.map +1 -0
- package/dist/viewerRepositoryAccess.js +54 -0
- package/dist/viewerRepositoryAccess.js.map +1 -0
- package/package.json +13 -6
- package/src/GitHub.ts +34 -15
- package/src/adapters/manualRedirects.ts +6 -0
- package/src/adapters/mergeResponseHeaders.ts +8 -0
- package/src/adapters/resolveApiUrl.ts +5 -0
- package/src/adapters/signAppJwt.ts +16 -0
- package/src/adapters/verifySignature.ts +13 -0
- package/src/adapters/zipEntries.ts +69 -0
- package/src/appJwt.ts +3 -12
- package/src/appTokens.ts +2 -1
- package/src/artifactErrors.ts +26 -0
- package/src/artifactExtraction.ts +62 -0
- package/src/artifactPaths.ts +36 -0
- package/src/artifacts.ts +35 -40
- package/src/authenticatedRequest.ts +8 -9
- package/src/cache.ts +2 -1
- package/src/checkRuns.ts +5 -5
- package/src/errors.ts +6 -0
- package/src/gitSchemas.ts +52 -0
- package/src/installationClients.ts +18 -12
- package/src/markdown.ts +4 -0
- package/src/markdownRows.ts +54 -9
- package/src/pagedLists.ts +40 -0
- package/src/repositoryAddress.ts +32 -0
- package/src/repositoryReads.ts +62 -0
- package/src/repositorySchemas.ts +43 -0
- package/src/representations.ts +6 -5
- package/src/requests.ts +12 -14
- package/src/status.ts +3 -3
- package/src/verifyWebhook.ts +4 -10
- package/src/viewerRepositoryAccess.ts +66 -0
package/dist/GitHub.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
2
|
import { HttpClient } from "effect/http";
|
|
3
|
+
import type { ServiceUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
3
4
|
import { GitHubToken } from "#GitHubToken.ts";
|
|
5
|
+
import { type ListOptions } from "#pagedLists.ts";
|
|
4
6
|
export declare const GitHub: import("effect/Context").Service<"@shivaedev/github/GitHub", Readonly<{
|
|
5
|
-
readonly downloadArtifactArchive: (options: import("#artifacts.ts").ArtifactArchiveOptions) => Effect.Effect<
|
|
6
|
-
readonly list: (path: string, beforeRequest?: ((resource: string) => Effect.Effect<void, import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable>) | undefined, byteLimit?: number | undefined) => Effect.Effect<Stream.Stream<{
|
|
7
|
-
decode: <TSchema extends Schema.Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], Schema.SchemaError, TSchema["DecodingServices"]>;
|
|
8
|
-
hasNext: boolean;
|
|
9
|
-
}, 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").ResponseBodyTooLarge | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>, never, never>;
|
|
7
|
+
readonly downloadArtifactArchive: (options: import("#artifacts.ts").ArtifactArchiveOptions) => Effect.Effect<import("./artifactExtraction.ts").ArtifactFile[], import("./errors.ts").GitHubAppError | import("./artifactErrors.ts").GitHubArtifactCompressionRatio | import("./artifactErrors.ts").GitHubArtifactDuplicateEntry | import("./errors.ts").GitHubArtifactError | import("./artifactErrors.ts").GitHubArtifactExtractedTooLarge | import("./artifactErrors.ts").GitHubArtifactExtractionError | import("./artifactErrors.ts").GitHubArtifactPathTraversal | import("./artifactErrors.ts").GitHubArtifactSymlink | import("./errors.ts").GitHubArtifactTooLarge | 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").RemoteHttpError | import("@shivaedev/http/errors.ts").RemoteRateLimited | import("@shivaedev/http/errors.ts").RemoteUnauthorized | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge, never>;
|
|
10
8
|
readonly read: (path: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
11
9
|
decode: <TSchema extends Schema.Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], Schema.SchemaError, TSchema["DecodingServices"]>;
|
|
12
|
-
}, 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").
|
|
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("@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>;
|
|
13
11
|
readonly write: (method: "DELETE" | "PATCH" | "POST" | "PUT", path: string, body?: unknown, byteLimit?: number | undefined) => Effect.Effect<{
|
|
14
12
|
decode: <TSchema extends Schema.Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], Schema.SchemaError, TSchema["DecodingServices"]>;
|
|
15
|
-
}, 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").
|
|
13
|
+
}, 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>;
|
|
16
14
|
readonly createCheckRun: (owner: string, repo: string, input: {
|
|
17
15
|
readonly detailsUrl?: string | undefined;
|
|
18
16
|
readonly headSha: string;
|
|
@@ -50,7 +48,7 @@ export declare const GitHub: import("effect/Context").Service<"@shivaedev/github
|
|
|
50
48
|
readonly title: string | null;
|
|
51
49
|
};
|
|
52
50
|
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
53
|
-
}, 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").
|
|
51
|
+
}, 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 | Schema.SchemaError, never>;
|
|
54
52
|
readonly findLatestCheckRun: (owner: string, repo: string, input: {
|
|
55
53
|
readonly appId?: number | undefined;
|
|
56
54
|
readonly headSha: string;
|
|
@@ -74,7 +72,7 @@ export declare const GitHub: import("effect/Context").Service<"@shivaedev/github
|
|
|
74
72
|
readonly title: string | null;
|
|
75
73
|
};
|
|
76
74
|
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
77
|
-
}>, 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").
|
|
75
|
+
}>, 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 | ServiceUnavailable, never>;
|
|
78
76
|
readonly updateCheckRun: (owner: string, repo: string, id: number, input: {
|
|
79
77
|
readonly detailsUrl?: string | undefined;
|
|
80
78
|
readonly output?: {
|
|
@@ -107,7 +105,7 @@ export declare const GitHub: import("effect/Context").Service<"@shivaedev/github
|
|
|
107
105
|
readonly title: string | null;
|
|
108
106
|
};
|
|
109
107
|
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
110
|
-
}, 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").
|
|
108
|
+
}, 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 | Schema.SchemaError, never>;
|
|
111
109
|
readonly upsertCheckRun: (owner: string, repo: string, input: {
|
|
112
110
|
readonly detailsUrl?: string | undefined;
|
|
113
111
|
readonly headSha: string;
|
|
@@ -145,7 +143,174 @@ export declare const GitHub: import("effect/Context").Service<"@shivaedev/github
|
|
|
145
143
|
readonly title: string | null;
|
|
146
144
|
};
|
|
147
145
|
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
148
|
-
}, 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").
|
|
146
|
+
}, 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 | ServiceUnavailable, never>;
|
|
147
|
+
readonly compareCommits: (owner: string, repo: string, base: string, head: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
148
|
+
readonly aheadBy: number;
|
|
149
|
+
readonly behindBy: number;
|
|
150
|
+
readonly commits: readonly {
|
|
151
|
+
readonly author: {
|
|
152
|
+
readonly avatarUrl: string;
|
|
153
|
+
readonly htmlUrl: string;
|
|
154
|
+
readonly id: number;
|
|
155
|
+
readonly login: string;
|
|
156
|
+
readonly type: string;
|
|
157
|
+
} | null;
|
|
158
|
+
readonly commit: {
|
|
159
|
+
readonly author: {
|
|
160
|
+
readonly date: string;
|
|
161
|
+
readonly email: string;
|
|
162
|
+
readonly name: string;
|
|
163
|
+
} | null;
|
|
164
|
+
readonly committer: {
|
|
165
|
+
readonly date: string;
|
|
166
|
+
readonly email: string;
|
|
167
|
+
readonly name: string;
|
|
168
|
+
} | null;
|
|
169
|
+
readonly message: string;
|
|
170
|
+
readonly tree: {
|
|
171
|
+
readonly sha: string;
|
|
172
|
+
readonly url: string;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
readonly committer: {
|
|
176
|
+
readonly avatarUrl: string;
|
|
177
|
+
readonly htmlUrl: string;
|
|
178
|
+
readonly id: number;
|
|
179
|
+
readonly login: string;
|
|
180
|
+
readonly type: string;
|
|
181
|
+
} | null;
|
|
182
|
+
readonly htmlUrl: string;
|
|
183
|
+
readonly parents: readonly {
|
|
184
|
+
readonly sha: string;
|
|
185
|
+
readonly url: string;
|
|
186
|
+
}[];
|
|
187
|
+
readonly sha: string;
|
|
188
|
+
}[];
|
|
189
|
+
readonly files?: readonly {
|
|
190
|
+
readonly additions: number;
|
|
191
|
+
readonly changes: number;
|
|
192
|
+
readonly deletions: number;
|
|
193
|
+
readonly filename: string;
|
|
194
|
+
readonly patch?: string | undefined;
|
|
195
|
+
readonly previousFilename?: string | undefined;
|
|
196
|
+
readonly sha: string;
|
|
197
|
+
readonly status: string;
|
|
198
|
+
}[] | undefined;
|
|
199
|
+
readonly status: "ahead" | "behind" | "diverged" | "identical";
|
|
200
|
+
readonly totalCommits: number;
|
|
201
|
+
}, 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 | Schema.SchemaError, never>;
|
|
202
|
+
readonly getCollaboratorPermission: (owner: string, repo: string, username: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
203
|
+
readonly permission: string;
|
|
204
|
+
readonly roleName: string;
|
|
205
|
+
readonly user: {
|
|
206
|
+
readonly avatarUrl: string;
|
|
207
|
+
readonly htmlUrl: string;
|
|
208
|
+
readonly id: number;
|
|
209
|
+
readonly login: string;
|
|
210
|
+
readonly type: string;
|
|
211
|
+
};
|
|
212
|
+
}, 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 | Schema.SchemaError, never>;
|
|
213
|
+
readonly getCommit: (owner: string, repo: string, ref: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
214
|
+
readonly author: {
|
|
215
|
+
readonly avatarUrl: string;
|
|
216
|
+
readonly htmlUrl: string;
|
|
217
|
+
readonly id: number;
|
|
218
|
+
readonly login: string;
|
|
219
|
+
readonly type: string;
|
|
220
|
+
} | null;
|
|
221
|
+
readonly commit: {
|
|
222
|
+
readonly author: {
|
|
223
|
+
readonly date: string;
|
|
224
|
+
readonly email: string;
|
|
225
|
+
readonly name: string;
|
|
226
|
+
} | null;
|
|
227
|
+
readonly committer: {
|
|
228
|
+
readonly date: string;
|
|
229
|
+
readonly email: string;
|
|
230
|
+
readonly name: string;
|
|
231
|
+
} | null;
|
|
232
|
+
readonly message: string;
|
|
233
|
+
readonly tree: {
|
|
234
|
+
readonly sha: string;
|
|
235
|
+
readonly url: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
readonly committer: {
|
|
239
|
+
readonly avatarUrl: string;
|
|
240
|
+
readonly htmlUrl: string;
|
|
241
|
+
readonly id: number;
|
|
242
|
+
readonly login: string;
|
|
243
|
+
readonly type: string;
|
|
244
|
+
} | null;
|
|
245
|
+
readonly htmlUrl: string;
|
|
246
|
+
readonly parents: readonly {
|
|
247
|
+
readonly sha: string;
|
|
248
|
+
readonly url: string;
|
|
249
|
+
}[];
|
|
250
|
+
readonly sha: string;
|
|
251
|
+
readonly files?: readonly {
|
|
252
|
+
readonly additions: number;
|
|
253
|
+
readonly changes: number;
|
|
254
|
+
readonly deletions: number;
|
|
255
|
+
readonly filename: string;
|
|
256
|
+
readonly patch?: string | undefined;
|
|
257
|
+
readonly previousFilename?: string | undefined;
|
|
258
|
+
readonly sha: string;
|
|
259
|
+
readonly status: string;
|
|
260
|
+
}[] | undefined;
|
|
261
|
+
readonly stats: {
|
|
262
|
+
readonly additions: number;
|
|
263
|
+
readonly deletions: number;
|
|
264
|
+
readonly total: number;
|
|
265
|
+
};
|
|
266
|
+
}, 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 | Schema.SchemaError, never>;
|
|
267
|
+
readonly getIssue: (owner: string, repo: string, number: number, byteLimit?: number | undefined) => Effect.Effect<{
|
|
268
|
+
readonly body: string | null;
|
|
269
|
+
readonly closedAt: string | null;
|
|
270
|
+
readonly createdAt: string;
|
|
271
|
+
readonly htmlUrl: string;
|
|
272
|
+
readonly id: number;
|
|
273
|
+
readonly labels: readonly (string | {
|
|
274
|
+
readonly name?: string | undefined;
|
|
275
|
+
})[];
|
|
276
|
+
readonly number: number;
|
|
277
|
+
readonly pullRequest?: {
|
|
278
|
+
readonly url: string;
|
|
279
|
+
} | undefined;
|
|
280
|
+
readonly state: "closed" | "open";
|
|
281
|
+
readonly title: string;
|
|
282
|
+
readonly updatedAt: string;
|
|
283
|
+
readonly user: {
|
|
284
|
+
readonly avatarUrl: string;
|
|
285
|
+
readonly htmlUrl: string;
|
|
286
|
+
readonly id: number;
|
|
287
|
+
readonly login: string;
|
|
288
|
+
readonly type: string;
|
|
289
|
+
} | null;
|
|
290
|
+
}, 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 | Schema.SchemaError, never>;
|
|
291
|
+
readonly getTree: (owner: string, repo: string, sha: string, options?: {
|
|
292
|
+
readonly recursive?: boolean;
|
|
293
|
+
readonly responseByteLimit?: number | undefined;
|
|
294
|
+
} | undefined) => Effect.Effect<{
|
|
295
|
+
readonly sha: string;
|
|
296
|
+
readonly tree: readonly {
|
|
297
|
+
readonly mode: string;
|
|
298
|
+
readonly path: string;
|
|
299
|
+
readonly sha: string;
|
|
300
|
+
readonly size?: number | undefined;
|
|
301
|
+
readonly type: "blob" | "commit" | "tree";
|
|
302
|
+
readonly url?: string | undefined;
|
|
303
|
+
}[];
|
|
304
|
+
readonly truncated: boolean;
|
|
305
|
+
readonly url: string;
|
|
306
|
+
}, 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 | Schema.SchemaError, never>;
|
|
307
|
+
readonly getUser: (username?: string | undefined, byteLimit?: number | undefined) => Effect.Effect<{
|
|
308
|
+
readonly avatarUrl: string;
|
|
309
|
+
readonly htmlUrl: string;
|
|
310
|
+
readonly id: number;
|
|
311
|
+
readonly login: string;
|
|
312
|
+
readonly type: string;
|
|
313
|
+
}, 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 | Schema.SchemaError, never>;
|
|
149
314
|
readonly upsertStickyComment: (input: {
|
|
150
315
|
readonly appId?: number | undefined;
|
|
151
316
|
readonly author?: string | undefined;
|
|
@@ -164,23 +329,118 @@ export declare const GitHub: import("effect/Context").Service<"@shivaedev/github
|
|
|
164
329
|
readonly login: string;
|
|
165
330
|
readonly type?: string | undefined;
|
|
166
331
|
} | null;
|
|
167
|
-
}, 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").
|
|
168
|
-
readonly bytes: (path: string, accept: string, limit: number) => Effect.Effect<Uint8Array<ArrayBufferLike>, 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").
|
|
332
|
+
}, 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 | ServiceUnavailable, never>;
|
|
333
|
+
readonly bytes: (path: string, accept: string, limit: number) => Effect.Effect<Uint8Array<ArrayBufferLike>, 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>;
|
|
334
|
+
readonly list: <E = ServiceUnavailable>(path: string, beforeRequest?: (resource: string) => Effect.Effect<void, E>, byteLimit?: number) => Effect.Effect<Stream.Stream<{
|
|
335
|
+
decode: <TSchema extends Schema.Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], Schema.SchemaError, TSchema["DecodingServices"]>;
|
|
336
|
+
hasNext: boolean;
|
|
337
|
+
}, 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>;
|
|
338
|
+
readonly listCommits: <E = ServiceUnavailable>(owner: string, repo: string, options?: import("#repositoryReads.ts").RepositoryListOptions<E>) => Effect.Effect<Stream.Stream<{
|
|
339
|
+
hasNext: boolean;
|
|
340
|
+
items: {
|
|
341
|
+
readonly author: {
|
|
342
|
+
readonly avatarUrl: string;
|
|
343
|
+
readonly htmlUrl: string;
|
|
344
|
+
readonly id: number;
|
|
345
|
+
readonly login: string;
|
|
346
|
+
readonly type: string;
|
|
347
|
+
} | null;
|
|
348
|
+
readonly commit: {
|
|
349
|
+
readonly author: {
|
|
350
|
+
readonly date: string;
|
|
351
|
+
readonly email: string;
|
|
352
|
+
readonly name: string;
|
|
353
|
+
} | null;
|
|
354
|
+
readonly committer: {
|
|
355
|
+
readonly date: string;
|
|
356
|
+
readonly email: string;
|
|
357
|
+
readonly name: string;
|
|
358
|
+
} | null;
|
|
359
|
+
readonly message: string;
|
|
360
|
+
readonly tree: {
|
|
361
|
+
readonly sha: string;
|
|
362
|
+
readonly url: string;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
readonly committer: {
|
|
366
|
+
readonly avatarUrl: string;
|
|
367
|
+
readonly htmlUrl: string;
|
|
368
|
+
readonly id: number;
|
|
369
|
+
readonly login: string;
|
|
370
|
+
readonly type: string;
|
|
371
|
+
} | null;
|
|
372
|
+
readonly htmlUrl: string;
|
|
373
|
+
readonly parents: readonly {
|
|
374
|
+
readonly sha: string;
|
|
375
|
+
readonly url: string;
|
|
376
|
+
}[];
|
|
377
|
+
readonly sha: string;
|
|
378
|
+
}[];
|
|
379
|
+
skipped: number;
|
|
380
|
+
}, 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, never>, never, never>;
|
|
381
|
+
readonly listIssues: <E = ServiceUnavailable>(owner: string, repo: string, options?: import("#repositoryReads.ts").RepositoryListOptions<E>) => Effect.Effect<Stream.Stream<{
|
|
382
|
+
hasNext: boolean;
|
|
383
|
+
items: {
|
|
384
|
+
readonly body: string | null;
|
|
385
|
+
readonly closedAt: string | null;
|
|
386
|
+
readonly createdAt: string;
|
|
387
|
+
readonly htmlUrl: string;
|
|
388
|
+
readonly id: number;
|
|
389
|
+
readonly labels: readonly (string | {
|
|
390
|
+
readonly name?: string | undefined;
|
|
391
|
+
})[];
|
|
392
|
+
readonly number: number;
|
|
393
|
+
readonly pullRequest?: {
|
|
394
|
+
readonly url: string;
|
|
395
|
+
} | undefined;
|
|
396
|
+
readonly state: "closed" | "open";
|
|
397
|
+
readonly title: string;
|
|
398
|
+
readonly updatedAt: string;
|
|
399
|
+
readonly user: {
|
|
400
|
+
readonly avatarUrl: string;
|
|
401
|
+
readonly htmlUrl: string;
|
|
402
|
+
readonly id: number;
|
|
403
|
+
readonly login: string;
|
|
404
|
+
readonly type: string;
|
|
405
|
+
} | null;
|
|
406
|
+
}[];
|
|
407
|
+
skipped: number;
|
|
408
|
+
}, 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, never>, never, never>;
|
|
409
|
+
readonly listPullRequestFiles: <E = ServiceUnavailable>(owner: string, repo: string, number: number, options?: import("#repositoryReads.ts").RepositoryListOptions<E>) => Effect.Effect<Stream.Stream<{
|
|
410
|
+
hasNext: boolean;
|
|
411
|
+
items: {
|
|
412
|
+
readonly additions: number;
|
|
413
|
+
readonly changes: number;
|
|
414
|
+
readonly deletions: number;
|
|
415
|
+
readonly filename: string;
|
|
416
|
+
readonly patch?: string | undefined;
|
|
417
|
+
readonly previousFilename?: string | undefined;
|
|
418
|
+
readonly sha: string;
|
|
419
|
+
readonly status: string;
|
|
420
|
+
}[];
|
|
421
|
+
skipped: number;
|
|
422
|
+
}, 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, never>, never, never>;
|
|
169
423
|
readonly observations: () => Effect.Effect<import("#rateLimits.ts").RateLimitObservation[], never, never>;
|
|
170
424
|
readonly resource: (path: string) => Effect.Effect<string, never, never>;
|
|
171
|
-
readonly text: (path: string, accept: string, limit: number) => Effect.Effect<string, 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").
|
|
425
|
+
readonly text: (path: string, accept: string, limit: number) => Effect.Effect<string, 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>;
|
|
172
426
|
}>> & {
|
|
173
427
|
readonly layer: import("effect/Layer").Layer<"@shivaedev/github/GitHub", never, GitHubToken | HttpClient.HttpClient>;
|
|
174
428
|
};
|
|
175
|
-
export declare function read<TSchema extends Schema.Constraint>(path: string, schema: TSchema, responseByteLimit?: number): Effect.Effect<TSchema["Type"], 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").
|
|
176
|
-
export declare function
|
|
177
|
-
|
|
429
|
+
export declare function read<TSchema extends Schema.Constraint>(path: string, schema: TSchema, responseByteLimit?: number): Effect.Effect<TSchema["Type"], 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 | Schema.SchemaError, "@shivaedev/github/GitHub" | TSchema["DecodingServices"]>;
|
|
430
|
+
export declare function listPages<TSchema extends Schema.Constraint, E = ServiceUnavailable>(path: string, schema: TSchema, options?: ListOptions<E> | number): Stream.Stream<{
|
|
431
|
+
hasNext: boolean;
|
|
432
|
+
items: TSchema["Type"][];
|
|
433
|
+
skipped: number;
|
|
434
|
+
}, 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, "@shivaedev/github/GitHub" | TSchema["DecodingServices"]>;
|
|
435
|
+
export declare function list<TSchema extends Schema.Constraint, E = ServiceUnavailable>(path: string, schema: TSchema, options?: ListOptions<E> | number): Stream.Stream<TSchema["Type"], 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, "@shivaedev/github/GitHub" | TSchema["DecodingServices"]>;
|
|
436
|
+
export declare function listBounded<TSchema extends Schema.Constraint, E = ServiceUnavailable>(path: string, schema: TSchema, pageCap: number, options?: ListOptions<E> | number): Effect.Effect<{
|
|
178
437
|
items: TSchema["Type"][];
|
|
438
|
+
skipped: number;
|
|
179
439
|
truncated: boolean;
|
|
180
|
-
}, 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").
|
|
440
|
+
}, 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, "@shivaedev/github/GitHub" | TSchema["DecodingServices"]>;
|
|
181
441
|
type WriteMethod = "POST" | "PATCH" | "PUT" | "DELETE";
|
|
182
442
|
export declare function write<TSchema extends Schema.Constraint>(method: WriteMethod, path: string, body: unknown, schema: TSchema, responseByteLimit?: number): ReturnType<typeof writeDecoded<TSchema>>;
|
|
183
443
|
export declare function write(method: WriteMethod, path: string, body?: unknown): ReturnType<typeof writeDecoded<typeof Schema.Void>>;
|
|
184
|
-
declare function writeDecoded<TSchema extends Schema.Constraint>(method: WriteMethod, path: string, body: unknown, schema: TSchema, responseByteLimit?: number): Effect.Effect<TSchema["Type"], 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").
|
|
444
|
+
declare function writeDecoded<TSchema extends Schema.Constraint>(method: WriteMethod, path: string, body: unknown, schema: TSchema, responseByteLimit?: number): Effect.Effect<TSchema["Type"], 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 | Schema.SchemaError, "@shivaedev/github/GitHub" | TSchema["DecodingServices"]>;
|
|
185
445
|
export {};
|
|
186
446
|
//# sourceMappingURL=GitHub.d.ts.map
|
package/dist/GitHub.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHub.d.ts","sourceRoot":"","sources":["../src/GitHub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"GitHub.d.ts","sourceRoot":"","sources":["../src/GitHub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAMxE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOhE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AEvD,wBAAgB,KAAK,CAAC,OAAO,SAAS,MAAM,CAAC,UAAU,EACtD,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,OAAO,EACf,iBAAiB,CAAC,EAAE,MAAM,GACxB,UAAU,CAAC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAK9H,iBAAS,YAAY,CAAC,OAAO,SAAS,MAAM,CAAC,UAAU,EACtD,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,OAAO,EACf,iBAAiB,CAAC,EAAE,MAAM,4vBAK1B"}
|
package/dist/GitHub.js
CHANGED
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
import { Effect, Schema, Stream } from "effect";
|
|
2
2
|
import { HttpClient } from "effect/http";
|
|
3
3
|
import { defineService } from "@shivaedev/service/defineService.ts";
|
|
4
|
+
import { genericMethod } from "@shivaedev/service/genericMethod.ts";
|
|
4
5
|
import { artifacts } from "#artifacts.ts";
|
|
5
6
|
import { checkRuns } from "#checkRuns.ts";
|
|
6
7
|
import { GitHubConfig } from "#GitHubConfig.ts";
|
|
7
8
|
import { GitHubToken } from "#GitHubToken.ts";
|
|
9
|
+
import { decodedPages } from "#pagedLists.ts";
|
|
8
10
|
import { rateLimits } from "#rateLimits.ts";
|
|
11
|
+
import { repositoryReads } from "#repositoryReads.ts";
|
|
9
12
|
import { representations } from "#representations.ts";
|
|
10
13
|
import { requests } from "#requests.ts";
|
|
11
14
|
import { stickyComments } from "#stickyComments.ts";
|
|
12
|
-
import { TokenRefresh } from "#TokenRefresh.ts";
|
|
13
15
|
export const GitHub = defineService({
|
|
14
16
|
id: "@shivaedev/github/GitHub",
|
|
15
17
|
initialize: Effect.gen(function* () {
|
|
16
18
|
const config = yield* GitHubConfig;
|
|
17
19
|
const rates = rateLimits();
|
|
18
|
-
const client = yield* HttpClient.HttpClient;
|
|
19
|
-
const token = yield* GitHubToken;
|
|
20
|
-
const refresh = yield* TokenRefresh;
|
|
21
20
|
return {
|
|
22
21
|
apiUrl: config.apiUrl,
|
|
23
|
-
archive: artifacts(config.apiUrl,
|
|
22
|
+
archive: yield* artifacts(config.apiUrl, rates),
|
|
24
23
|
rates,
|
|
25
|
-
request: requests(
|
|
24
|
+
request: yield* requests(rates),
|
|
26
25
|
responseByteLimit: config.responseByteLimit,
|
|
27
26
|
};
|
|
28
27
|
}),
|
|
29
28
|
methods: ({ apiUrl, archive, rates, request, responseByteLimit }) => {
|
|
30
29
|
const { get, ...client } = representations(apiUrl, request, rates.resource, responseByteLimit);
|
|
30
|
+
const reads = repositoryReads(client);
|
|
31
31
|
return {
|
|
32
32
|
bytes: (path, accept, limit) => Effect.map(request(get(path, accept), limit), (entry) => entry.bytes),
|
|
33
33
|
...client,
|
|
34
|
+
list: genericMethod(client.list),
|
|
34
35
|
...archive,
|
|
35
36
|
...stickyComments(client),
|
|
36
37
|
...checkRuns(client),
|
|
38
|
+
...reads,
|
|
39
|
+
listCommits: genericMethod(reads.listCommits),
|
|
40
|
+
listIssues: genericMethod(reads.listIssues),
|
|
41
|
+
listPullRequestFiles: genericMethod(reads.listPullRequestFiles),
|
|
37
42
|
observations: () => Effect.sync(() => [...rates.observations.values()]),
|
|
38
43
|
resource: (path) => Effect.sync(() => rates.resource(new URL(path, apiUrl).pathname)),
|
|
39
44
|
text: (path, accept, limit) => Effect.map(request(get(path, accept), limit), (entry) => new TextDecoder().decode(entry.bytes)),
|
|
@@ -44,11 +49,18 @@ export const GitHub = defineService({
|
|
|
44
49
|
export function read(path, schema, responseByteLimit) {
|
|
45
50
|
return Effect.flatMap(GitHub, (github) => Effect.flatMap(github.read(path, responseByteLimit), (response) => response.decode(schema)));
|
|
46
51
|
}
|
|
47
|
-
export function
|
|
48
|
-
return Stream.unwrap(Effect.
|
|
52
|
+
export function listPages(path, schema, options) {
|
|
53
|
+
return Stream.unwrap(Effect.map(GitHub, (github) => decodedPages(github, path, schema, options)));
|
|
49
54
|
}
|
|
50
|
-
export function
|
|
51
|
-
return
|
|
55
|
+
export function list(path, schema, options) {
|
|
56
|
+
return listPages(path, schema, options).pipe(Stream.flatMap((page) => Stream.fromIterable(page.items)));
|
|
57
|
+
}
|
|
58
|
+
export function listBounded(path, schema, pageCap, options) {
|
|
59
|
+
return listPages(path, schema, options).pipe(Stream.take(pageCap), Stream.runCollect, Effect.map((pages) => ({
|
|
60
|
+
items: pages.flatMap((page) => page.items),
|
|
61
|
+
skipped: pages.reduce((count, page) => count + page.skipped, 0),
|
|
62
|
+
truncated: pages.at(-1)?.hasNext ?? false,
|
|
63
|
+
})));
|
|
52
64
|
}
|
|
53
65
|
export function write(method, path, body, schema = Schema.Void, responseByteLimit) {
|
|
54
66
|
return writeDecoded(method, path, body, schema, responseByteLimit);
|
package/dist/GitHub.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHub.js","sourceRoot":"","sources":["../src/GitHub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"GitHub.js","sourceRoot":"","sources":["../src/GitHub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE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,KAAK,EAAE,EAAE,CAAC,CAAC;QACtB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;QAC1C,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/D,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,KAAK;KACzC,CAAC,CAAC,CACH,CAAC;AACH,CAAC;AAYD,MAAM,UAAU,KAAK,CAAC,MAAmB,EAAE,IAAY,EAAE,IAAc,EAAE,MAAM,GAAsB,MAAM,CAAC,IAAI,EAAE,iBAA0B;IAC3I,OAAO,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,YAAY,CACpB,MAAmB,EACnB,IAAY,EACZ,IAAa,EACb,MAAe,EACf,iBAA0B;IAE1B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CACxC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAC1G,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { FetchHttpClient } from "effect/http";
|
|
3
|
+
export declare function manualRedirects<A, E, R>(request: Effect.Effect<A, E, R>): Effect.Effect<A, E, Exclude<R, FetchHttpClient.RequestInit>>;
|
|
4
|
+
//# sourceMappingURL=manualRedirects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manualRedirects.d.ts","sourceRoot":"","sources":["../../src/adapters/manualRedirects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,gEAEvE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { FetchHttpClient } from "effect/http";
|
|
3
|
+
export function manualRedirects(request) {
|
|
4
|
+
return request.pipe(Effect.provideService(FetchHttpClient.RequestInit, { credentials: "omit", redirect: "manual" }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=manualRedirects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manualRedirects.js","sourceRoot":"","sources":["../../src/adapters/manualRedirects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,UAAU,eAAe,CAAU,OAA+B;IACvE,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACtH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { HttpClientResponse } from "effect/http";
|
|
2
|
+
export declare function mergeResponseHeaders(cached: HttpClientResponse.HttpClientResponse, response: HttpClientResponse.HttpClientResponse): HttpClientResponse.HttpClientResponse;
|
|
3
|
+
//# sourceMappingURL=mergeResponseHeaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeResponseHeaders.d.ts","sourceRoot":"","sources":["../../src/adapters/mergeResponseHeaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,CAAC,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB,CAAC,kBAAkB,yCAKlI"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HttpClientResponse } from "effect/http";
|
|
2
|
+
export function mergeResponseHeaders(cached, response) {
|
|
3
|
+
return HttpClientResponse.fromWeb(response.request, new Response(null, { headers: { ...cached.headers, ...response.headers }, status: response.status }));
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=mergeResponseHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeResponseHeaders.js","sourceRoot":"","sources":["../../src/adapters/mergeResponseHeaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,oBAAoB,CAAC,MAA6C,EAAE,QAA+C;IAClI,OAAO,kBAAkB,CAAC,OAAO,CAChC,QAAQ,CAAC,OAAO,EAChB,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CACpG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveApiUrl.d.ts","sourceRoot":"","sources":["../../src/adapters/resolveApiUrl.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAIzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveApiUrl.js","sourceRoot":"","sources":["../../src/adapters/resolveApiUrl.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,IAAY;IACzD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC;IACxD,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Effect, Redacted } from "effect";
|
|
2
|
+
import type { AppCredentials } from "#appJwt.ts";
|
|
3
|
+
import { GitHubAppError } from "#errors.ts";
|
|
4
|
+
export declare function signAppJwt(options: AppCredentials, now: number): Effect.Effect<Redacted.Redacted<string>, GitHubAppError, never>;
|
|
5
|
+
//# sourceMappingURL=signAppJwt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signAppJwt.d.ts","sourceRoot":"","sources":["../../src/adapters/signAppJwt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,mEAU9D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { sign } from "node:crypto";
|
|
2
|
+
import { Effect, Redacted } from "effect";
|
|
3
|
+
import { GitHubAppError } from "#errors.ts";
|
|
4
|
+
export function signAppJwt(options, now) {
|
|
5
|
+
return Effect.try({
|
|
6
|
+
catch: (cause) => new GitHubAppError({ reason: "sign" }, { cause }),
|
|
7
|
+
try: () => {
|
|
8
|
+
const header = Buffer.from(JSON.stringify({ alg: "RS256", typ: "JWT" })).toString("base64url");
|
|
9
|
+
const payload = Buffer.from(JSON.stringify({ exp: now + 600, iat: now - 60, iss: options.appId })).toString("base64url");
|
|
10
|
+
const input = `${header}.${payload}`;
|
|
11
|
+
return Redacted.make(`${input}.${sign("RSA-SHA256", Buffer.from(input), Redacted.value(options.privateKey)).toString("base64url")}`);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=signAppJwt.js.map
|