@shivaedev/github 0.9.0 → 0.10.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 +95 -5
- package/dist/GitHub.d.ts +262 -3
- package/dist/GitHub.d.ts.map +1 -1
- package/dist/GitHub.js +15 -5
- package/dist/GitHub.js.map +1 -1
- 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/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/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 +15 -8
- package/dist/artifacts.js.map +1 -1
- package/dist/checkRuns.d.ts.map +1 -1
- package/dist/checkRuns.js +5 -3
- package/dist/checkRuns.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 +278 -2
- package/dist/installationClients.d.ts.map +1 -1
- package/dist/installationClients.js +14 -5
- package/dist/installationClients.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/repositoryReads.d.ts +261 -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.map +1 -1
- package/dist/representations.js +3 -2
- package/dist/representations.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 +11 -4
- package/src/GitHub.ts +17 -10
- package/src/adapters/resolveApiUrl.ts +5 -0
- package/src/adapters/zipEntries.ts +69 -0
- 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 +36 -39
- package/src/checkRuns.ts +5 -5
- package/src/gitSchemas.ts +52 -0
- package/src/installationClients.ts +18 -12
- package/src/pagedLists.ts +40 -0
- package/src/repositoryReads.ts +61 -0
- package/src/repositorySchemas.ts +43 -0
- package/src/representations.ts +3 -2
- package/src/viewerRepositoryAccess.ts +66 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const Commit: Schema.encodeKeys<Schema.Struct<{
|
|
3
|
+
author: Schema.NullOr<Schema.encodeKeys<Schema.Struct<{
|
|
4
|
+
readonly avatarUrl: Schema.String;
|
|
5
|
+
readonly htmlUrl: Schema.String;
|
|
6
|
+
readonly id: Schema.Number;
|
|
7
|
+
readonly login: Schema.String;
|
|
8
|
+
readonly type: Schema.String;
|
|
9
|
+
}>, {
|
|
10
|
+
readonly avatarUrl: "avatar_url";
|
|
11
|
+
readonly htmlUrl: "html_url";
|
|
12
|
+
}>>;
|
|
13
|
+
commit: Schema.Struct<{
|
|
14
|
+
readonly author: Schema.NullOr<Schema.Struct<{
|
|
15
|
+
readonly date: Schema.String;
|
|
16
|
+
readonly email: Schema.String;
|
|
17
|
+
readonly name: Schema.String;
|
|
18
|
+
}>>;
|
|
19
|
+
readonly committer: Schema.NullOr<Schema.Struct<{
|
|
20
|
+
readonly date: Schema.String;
|
|
21
|
+
readonly email: Schema.String;
|
|
22
|
+
readonly name: Schema.String;
|
|
23
|
+
}>>;
|
|
24
|
+
readonly message: Schema.String;
|
|
25
|
+
readonly tree: Schema.Struct<{
|
|
26
|
+
readonly sha: Schema.String;
|
|
27
|
+
readonly url: Schema.String;
|
|
28
|
+
}>;
|
|
29
|
+
}>;
|
|
30
|
+
committer: Schema.NullOr<Schema.encodeKeys<Schema.Struct<{
|
|
31
|
+
readonly avatarUrl: Schema.String;
|
|
32
|
+
readonly htmlUrl: Schema.String;
|
|
33
|
+
readonly id: Schema.Number;
|
|
34
|
+
readonly login: Schema.String;
|
|
35
|
+
readonly type: Schema.String;
|
|
36
|
+
}>, {
|
|
37
|
+
readonly avatarUrl: "avatar_url";
|
|
38
|
+
readonly htmlUrl: "html_url";
|
|
39
|
+
}>>;
|
|
40
|
+
htmlUrl: Schema.String;
|
|
41
|
+
parents: Schema.$Array<Schema.Struct<{
|
|
42
|
+
readonly sha: Schema.String;
|
|
43
|
+
readonly url: Schema.String;
|
|
44
|
+
}>>;
|
|
45
|
+
sha: Schema.String;
|
|
46
|
+
}>, {
|
|
47
|
+
readonly htmlUrl: "html_url";
|
|
48
|
+
}>;
|
|
49
|
+
export declare const CommitDetail: Schema.encodeKeys<Schema.Struct<{
|
|
50
|
+
readonly author: Schema.NullOr<Schema.encodeKeys<Schema.Struct<{
|
|
51
|
+
readonly avatarUrl: Schema.String;
|
|
52
|
+
readonly htmlUrl: Schema.String;
|
|
53
|
+
readonly id: Schema.Number;
|
|
54
|
+
readonly login: Schema.String;
|
|
55
|
+
readonly type: Schema.String;
|
|
56
|
+
}>, {
|
|
57
|
+
readonly avatarUrl: "avatar_url";
|
|
58
|
+
readonly htmlUrl: "html_url";
|
|
59
|
+
}>>;
|
|
60
|
+
readonly commit: Schema.Struct<{
|
|
61
|
+
readonly author: Schema.NullOr<Schema.Struct<{
|
|
62
|
+
readonly date: Schema.String;
|
|
63
|
+
readonly email: Schema.String;
|
|
64
|
+
readonly name: Schema.String;
|
|
65
|
+
}>>;
|
|
66
|
+
readonly committer: Schema.NullOr<Schema.Struct<{
|
|
67
|
+
readonly date: Schema.String;
|
|
68
|
+
readonly email: Schema.String;
|
|
69
|
+
readonly name: Schema.String;
|
|
70
|
+
}>>;
|
|
71
|
+
readonly message: Schema.String;
|
|
72
|
+
readonly tree: Schema.Struct<{
|
|
73
|
+
readonly sha: Schema.String;
|
|
74
|
+
readonly url: Schema.String;
|
|
75
|
+
}>;
|
|
76
|
+
}>;
|
|
77
|
+
readonly committer: Schema.NullOr<Schema.encodeKeys<Schema.Struct<{
|
|
78
|
+
readonly avatarUrl: Schema.String;
|
|
79
|
+
readonly htmlUrl: Schema.String;
|
|
80
|
+
readonly id: Schema.Number;
|
|
81
|
+
readonly login: Schema.String;
|
|
82
|
+
readonly type: Schema.String;
|
|
83
|
+
}>, {
|
|
84
|
+
readonly avatarUrl: "avatar_url";
|
|
85
|
+
readonly htmlUrl: "html_url";
|
|
86
|
+
}>>;
|
|
87
|
+
readonly htmlUrl: Schema.String;
|
|
88
|
+
readonly parents: Schema.$Array<Schema.Struct<{
|
|
89
|
+
readonly sha: Schema.String;
|
|
90
|
+
readonly url: Schema.String;
|
|
91
|
+
}>>;
|
|
92
|
+
readonly sha: Schema.String;
|
|
93
|
+
readonly files: Schema.optional<Schema.$Array<Schema.encodeKeys<Schema.Struct<{
|
|
94
|
+
readonly additions: Schema.Number;
|
|
95
|
+
readonly changes: Schema.Number;
|
|
96
|
+
readonly deletions: Schema.Number;
|
|
97
|
+
readonly filename: Schema.String;
|
|
98
|
+
readonly patch: Schema.optional<Schema.String>;
|
|
99
|
+
readonly previousFilename: Schema.optional<Schema.String>;
|
|
100
|
+
readonly sha: Schema.String;
|
|
101
|
+
readonly status: Schema.String;
|
|
102
|
+
}>, {
|
|
103
|
+
readonly previousFilename: "previous_filename";
|
|
104
|
+
}>>>;
|
|
105
|
+
readonly stats: Schema.Struct<{
|
|
106
|
+
readonly additions: Schema.Number;
|
|
107
|
+
readonly deletions: Schema.Number;
|
|
108
|
+
readonly total: Schema.Number;
|
|
109
|
+
}>;
|
|
110
|
+
}>, {
|
|
111
|
+
readonly htmlUrl: "html_url";
|
|
112
|
+
}>;
|
|
113
|
+
export declare const Comparison: Schema.encodeKeys<Schema.Struct<{
|
|
114
|
+
readonly aheadBy: Schema.Number;
|
|
115
|
+
readonly behindBy: Schema.Number;
|
|
116
|
+
readonly commits: Schema.$Array<Schema.encodeKeys<Schema.Struct<{
|
|
117
|
+
author: Schema.NullOr<Schema.encodeKeys<Schema.Struct<{
|
|
118
|
+
readonly avatarUrl: Schema.String;
|
|
119
|
+
readonly htmlUrl: Schema.String;
|
|
120
|
+
readonly id: Schema.Number;
|
|
121
|
+
readonly login: Schema.String;
|
|
122
|
+
readonly type: Schema.String;
|
|
123
|
+
}>, {
|
|
124
|
+
readonly avatarUrl: "avatar_url";
|
|
125
|
+
readonly htmlUrl: "html_url";
|
|
126
|
+
}>>;
|
|
127
|
+
commit: Schema.Struct<{
|
|
128
|
+
readonly author: Schema.NullOr<Schema.Struct<{
|
|
129
|
+
readonly date: Schema.String;
|
|
130
|
+
readonly email: Schema.String;
|
|
131
|
+
readonly name: Schema.String;
|
|
132
|
+
}>>;
|
|
133
|
+
readonly committer: Schema.NullOr<Schema.Struct<{
|
|
134
|
+
readonly date: Schema.String;
|
|
135
|
+
readonly email: Schema.String;
|
|
136
|
+
readonly name: Schema.String;
|
|
137
|
+
}>>;
|
|
138
|
+
readonly message: Schema.String;
|
|
139
|
+
readonly tree: Schema.Struct<{
|
|
140
|
+
readonly sha: Schema.String;
|
|
141
|
+
readonly url: Schema.String;
|
|
142
|
+
}>;
|
|
143
|
+
}>;
|
|
144
|
+
committer: Schema.NullOr<Schema.encodeKeys<Schema.Struct<{
|
|
145
|
+
readonly avatarUrl: Schema.String;
|
|
146
|
+
readonly htmlUrl: Schema.String;
|
|
147
|
+
readonly id: Schema.Number;
|
|
148
|
+
readonly login: Schema.String;
|
|
149
|
+
readonly type: Schema.String;
|
|
150
|
+
}>, {
|
|
151
|
+
readonly avatarUrl: "avatar_url";
|
|
152
|
+
readonly htmlUrl: "html_url";
|
|
153
|
+
}>>;
|
|
154
|
+
htmlUrl: Schema.String;
|
|
155
|
+
parents: Schema.$Array<Schema.Struct<{
|
|
156
|
+
readonly sha: Schema.String;
|
|
157
|
+
readonly url: Schema.String;
|
|
158
|
+
}>>;
|
|
159
|
+
sha: Schema.String;
|
|
160
|
+
}>, {
|
|
161
|
+
readonly htmlUrl: "html_url";
|
|
162
|
+
}>>;
|
|
163
|
+
readonly files: Schema.optional<Schema.$Array<Schema.encodeKeys<Schema.Struct<{
|
|
164
|
+
readonly additions: Schema.Number;
|
|
165
|
+
readonly changes: Schema.Number;
|
|
166
|
+
readonly deletions: Schema.Number;
|
|
167
|
+
readonly filename: Schema.String;
|
|
168
|
+
readonly patch: Schema.optional<Schema.String>;
|
|
169
|
+
readonly previousFilename: Schema.optional<Schema.String>;
|
|
170
|
+
readonly sha: Schema.String;
|
|
171
|
+
readonly status: Schema.String;
|
|
172
|
+
}>, {
|
|
173
|
+
readonly previousFilename: "previous_filename";
|
|
174
|
+
}>>>;
|
|
175
|
+
readonly status: Schema.Literals<readonly ["diverged", "ahead", "behind", "identical"]>;
|
|
176
|
+
readonly totalCommits: Schema.Number;
|
|
177
|
+
}>, {
|
|
178
|
+
readonly aheadBy: "ahead_by";
|
|
179
|
+
readonly behindBy: "behind_by";
|
|
180
|
+
readonly totalCommits: "total_commits";
|
|
181
|
+
}>;
|
|
182
|
+
export declare const GitTree: Schema.Struct<{
|
|
183
|
+
readonly sha: Schema.String;
|
|
184
|
+
readonly tree: Schema.$Array<Schema.Struct<{
|
|
185
|
+
readonly mode: Schema.String;
|
|
186
|
+
readonly path: Schema.String;
|
|
187
|
+
readonly sha: Schema.String;
|
|
188
|
+
readonly size: Schema.optional<Schema.Number>;
|
|
189
|
+
readonly type: Schema.Literals<readonly ["blob", "tree", "commit"]>;
|
|
190
|
+
readonly url: Schema.optional<Schema.String>;
|
|
191
|
+
}>>;
|
|
192
|
+
readonly truncated: Schema.Boolean;
|
|
193
|
+
readonly url: Schema.String;
|
|
194
|
+
}>;
|
|
195
|
+
//# sourceMappingURL=gitSchemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitSchemas.d.ts","sourceRoot":"","sources":["../src/gitSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAoBhC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA+E,CAAC;AAEnG,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI0B,CAAC;AAEpD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOkF,CAAC;AAE1G,eAAO,MAAM,OAAO;;;;;;;;;;;;EAclB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { PullRequestFile, User } from "#repositorySchemas.ts";
|
|
3
|
+
const CommitIdentity = Schema.Struct({ date: Schema.String, email: Schema.String, name: Schema.String });
|
|
4
|
+
const CommitData = Schema.Struct({
|
|
5
|
+
author: Schema.NullOr(CommitIdentity),
|
|
6
|
+
committer: Schema.NullOr(CommitIdentity),
|
|
7
|
+
message: Schema.String,
|
|
8
|
+
tree: Schema.Struct({ sha: Schema.String, url: Schema.String }),
|
|
9
|
+
});
|
|
10
|
+
const commitFields = {
|
|
11
|
+
author: Schema.NullOr(User),
|
|
12
|
+
commit: CommitData,
|
|
13
|
+
committer: Schema.NullOr(User),
|
|
14
|
+
htmlUrl: Schema.String,
|
|
15
|
+
parents: Schema.Array(Schema.Struct({ sha: Schema.String, url: Schema.String })),
|
|
16
|
+
sha: Schema.String,
|
|
17
|
+
};
|
|
18
|
+
export const Commit = Schema.Struct(commitFields).pipe(Schema.encodeKeys({ htmlUrl: "html_url" }));
|
|
19
|
+
export const CommitDetail = Schema.Struct({
|
|
20
|
+
...commitFields,
|
|
21
|
+
files: Schema.optional(Schema.Array(PullRequestFile)),
|
|
22
|
+
stats: Schema.Struct({ additions: Schema.Number, deletions: Schema.Number, total: Schema.Number }),
|
|
23
|
+
}).pipe(Schema.encodeKeys({ htmlUrl: "html_url" }));
|
|
24
|
+
export const Comparison = Schema.Struct({
|
|
25
|
+
aheadBy: Schema.Number,
|
|
26
|
+
behindBy: Schema.Number,
|
|
27
|
+
commits: Schema.Array(Commit),
|
|
28
|
+
files: Schema.optional(Schema.Array(PullRequestFile)),
|
|
29
|
+
status: Schema.Literals(["diverged", "ahead", "behind", "identical"]),
|
|
30
|
+
totalCommits: Schema.Number,
|
|
31
|
+
}).pipe(Schema.encodeKeys({ aheadBy: "ahead_by", behindBy: "behind_by", totalCommits: "total_commits" }));
|
|
32
|
+
export const GitTree = Schema.Struct({
|
|
33
|
+
sha: Schema.String,
|
|
34
|
+
tree: Schema.Array(Schema.Struct({
|
|
35
|
+
mode: Schema.String,
|
|
36
|
+
path: Schema.String,
|
|
37
|
+
sha: Schema.String,
|
|
38
|
+
size: Schema.optional(Schema.Number),
|
|
39
|
+
type: Schema.Literals(["blob", "tree", "commit"]),
|
|
40
|
+
url: Schema.optional(Schema.String),
|
|
41
|
+
})),
|
|
42
|
+
truncated: Schema.Boolean,
|
|
43
|
+
url: Schema.String,
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=gitSchemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitSchemas.js","sourceRoot":"","sources":["../src/gitSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AACzG,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC3B,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,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CAAC,CAAC,CAAC;AAE1G,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC,MAAM;IAClB,IAAI,EAAE,MAAM,CAAC,KAAK,CACjB,MAAM,CAAC,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC,MAAM;QACnB,IAAI,EAAE,MAAM,CAAC,MAAM;QACnB,GAAG,EAAE,MAAM,CAAC,MAAM;QAClB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACpC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACjD,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;KACnC,CAAC,CACF;IACD,SAAS,EAAE,MAAM,CAAC,OAAO;IACzB,GAAG,EAAE,MAAM,CAAC,MAAM;CAClB,CAAC,CAAC"}
|
|
@@ -7,8 +7,8 @@ export declare const GitHubAppCredentials: Context.Service<{
|
|
|
7
7
|
readonly credentials: AppCredentials;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const GitHubApp: Context.Service<"@shivaedev/github/GitHubApp", Readonly<{
|
|
10
|
-
readonly installation: (
|
|
11
|
-
readonly downloadArtifactArchive: (options: import("./artifacts.ts").ArtifactArchiveOptions) => Effect.Effect<
|
|
10
|
+
readonly installation: (id: number) => Effect.Effect<Readonly<{
|
|
11
|
+
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>;
|
|
12
12
|
readonly list: (path: string, beforeRequest?: ((resource: string) => Effect.Effect<void, import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable>) | undefined, byteLimit?: number | undefined) => Effect.Effect<import("effect/Stream").Stream<{
|
|
13
13
|
decode: <TSchema extends import("effect/Schema").Constraint>(schema: TSchema) => Effect.Effect<TSchema["Type"], import("effect/Schema").SchemaError, TSchema["DecodingServices"]>;
|
|
14
14
|
hasNext: boolean;
|
|
@@ -152,6 +152,258 @@ export declare const GitHubApp: Context.Service<"@shivaedev/github/GitHubApp", R
|
|
|
152
152
|
};
|
|
153
153
|
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
154
154
|
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
155
|
+
readonly compareCommits: (owner: string, repo: string, base: string, head: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
156
|
+
readonly aheadBy: number;
|
|
157
|
+
readonly behindBy: number;
|
|
158
|
+
readonly commits: readonly {
|
|
159
|
+
readonly author: {
|
|
160
|
+
readonly avatarUrl: string;
|
|
161
|
+
readonly htmlUrl: string;
|
|
162
|
+
readonly id: number;
|
|
163
|
+
readonly login: string;
|
|
164
|
+
readonly type: string;
|
|
165
|
+
} | null;
|
|
166
|
+
readonly commit: {
|
|
167
|
+
readonly author: {
|
|
168
|
+
readonly date: string;
|
|
169
|
+
readonly email: string;
|
|
170
|
+
readonly name: string;
|
|
171
|
+
} | null;
|
|
172
|
+
readonly committer: {
|
|
173
|
+
readonly date: string;
|
|
174
|
+
readonly email: string;
|
|
175
|
+
readonly name: string;
|
|
176
|
+
} | null;
|
|
177
|
+
readonly message: string;
|
|
178
|
+
readonly tree: {
|
|
179
|
+
readonly sha: string;
|
|
180
|
+
readonly url: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
readonly committer: {
|
|
184
|
+
readonly avatarUrl: string;
|
|
185
|
+
readonly htmlUrl: string;
|
|
186
|
+
readonly id: number;
|
|
187
|
+
readonly login: string;
|
|
188
|
+
readonly type: string;
|
|
189
|
+
} | null;
|
|
190
|
+
readonly htmlUrl: string;
|
|
191
|
+
readonly parents: readonly {
|
|
192
|
+
readonly sha: string;
|
|
193
|
+
readonly url: string;
|
|
194
|
+
}[];
|
|
195
|
+
readonly sha: string;
|
|
196
|
+
}[];
|
|
197
|
+
readonly files?: readonly {
|
|
198
|
+
readonly additions: number;
|
|
199
|
+
readonly changes: number;
|
|
200
|
+
readonly deletions: number;
|
|
201
|
+
readonly filename: string;
|
|
202
|
+
readonly patch?: string | undefined;
|
|
203
|
+
readonly previousFilename?: string | undefined;
|
|
204
|
+
readonly sha: string;
|
|
205
|
+
readonly status: string;
|
|
206
|
+
}[] | undefined;
|
|
207
|
+
readonly status: "ahead" | "behind" | "diverged" | "identical";
|
|
208
|
+
readonly totalCommits: number;
|
|
209
|
+
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
210
|
+
readonly getCollaboratorPermission: (owner: string, repo: string, username: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
211
|
+
readonly permission: string;
|
|
212
|
+
readonly roleName: string;
|
|
213
|
+
readonly user: {
|
|
214
|
+
readonly avatarUrl: string;
|
|
215
|
+
readonly htmlUrl: string;
|
|
216
|
+
readonly id: number;
|
|
217
|
+
readonly login: string;
|
|
218
|
+
readonly type: string;
|
|
219
|
+
};
|
|
220
|
+
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
221
|
+
readonly getCommit: (owner: string, repo: string, ref: string, byteLimit?: number | undefined) => Effect.Effect<{
|
|
222
|
+
readonly author: {
|
|
223
|
+
readonly avatarUrl: string;
|
|
224
|
+
readonly htmlUrl: string;
|
|
225
|
+
readonly id: number;
|
|
226
|
+
readonly login: string;
|
|
227
|
+
readonly type: string;
|
|
228
|
+
} | null;
|
|
229
|
+
readonly commit: {
|
|
230
|
+
readonly author: {
|
|
231
|
+
readonly date: string;
|
|
232
|
+
readonly email: string;
|
|
233
|
+
readonly name: string;
|
|
234
|
+
} | null;
|
|
235
|
+
readonly committer: {
|
|
236
|
+
readonly date: string;
|
|
237
|
+
readonly email: string;
|
|
238
|
+
readonly name: string;
|
|
239
|
+
} | null;
|
|
240
|
+
readonly message: string;
|
|
241
|
+
readonly tree: {
|
|
242
|
+
readonly sha: string;
|
|
243
|
+
readonly url: string;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
readonly committer: {
|
|
247
|
+
readonly avatarUrl: string;
|
|
248
|
+
readonly htmlUrl: string;
|
|
249
|
+
readonly id: number;
|
|
250
|
+
readonly login: string;
|
|
251
|
+
readonly type: string;
|
|
252
|
+
} | null;
|
|
253
|
+
readonly htmlUrl: string;
|
|
254
|
+
readonly parents: readonly {
|
|
255
|
+
readonly sha: string;
|
|
256
|
+
readonly url: string;
|
|
257
|
+
}[];
|
|
258
|
+
readonly sha: string;
|
|
259
|
+
readonly files?: readonly {
|
|
260
|
+
readonly additions: number;
|
|
261
|
+
readonly changes: number;
|
|
262
|
+
readonly deletions: number;
|
|
263
|
+
readonly filename: string;
|
|
264
|
+
readonly patch?: string | undefined;
|
|
265
|
+
readonly previousFilename?: string | undefined;
|
|
266
|
+
readonly sha: string;
|
|
267
|
+
readonly status: string;
|
|
268
|
+
}[] | undefined;
|
|
269
|
+
readonly stats: {
|
|
270
|
+
readonly additions: number;
|
|
271
|
+
readonly deletions: number;
|
|
272
|
+
readonly total: number;
|
|
273
|
+
};
|
|
274
|
+
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
275
|
+
readonly getIssue: (owner: string, repo: string, number: number, byteLimit?: number | undefined) => Effect.Effect<{
|
|
276
|
+
readonly body: string | null;
|
|
277
|
+
readonly closedAt: string | null;
|
|
278
|
+
readonly createdAt: string;
|
|
279
|
+
readonly htmlUrl: string;
|
|
280
|
+
readonly id: number;
|
|
281
|
+
readonly labels: readonly (string | {
|
|
282
|
+
readonly name?: string | undefined;
|
|
283
|
+
})[];
|
|
284
|
+
readonly number: number;
|
|
285
|
+
readonly pullRequest?: {
|
|
286
|
+
readonly url: string;
|
|
287
|
+
} | undefined;
|
|
288
|
+
readonly state: "closed" | "open";
|
|
289
|
+
readonly title: string;
|
|
290
|
+
readonly updatedAt: string;
|
|
291
|
+
readonly user: {
|
|
292
|
+
readonly avatarUrl: string;
|
|
293
|
+
readonly htmlUrl: string;
|
|
294
|
+
readonly id: number;
|
|
295
|
+
readonly login: string;
|
|
296
|
+
readonly type: string;
|
|
297
|
+
} | null;
|
|
298
|
+
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
299
|
+
readonly getTree: (owner: string, repo: string, sha: string, options?: {
|
|
300
|
+
readonly recursive?: boolean;
|
|
301
|
+
readonly responseByteLimit?: number | undefined;
|
|
302
|
+
} | undefined) => Effect.Effect<{
|
|
303
|
+
readonly sha: string;
|
|
304
|
+
readonly tree: readonly {
|
|
305
|
+
readonly mode: string;
|
|
306
|
+
readonly path: string;
|
|
307
|
+
readonly sha: string;
|
|
308
|
+
readonly size?: number | undefined;
|
|
309
|
+
readonly type: "blob" | "commit" | "tree";
|
|
310
|
+
readonly url?: string | undefined;
|
|
311
|
+
}[];
|
|
312
|
+
readonly truncated: boolean;
|
|
313
|
+
readonly url: string;
|
|
314
|
+
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
315
|
+
readonly getUser: (username?: string | undefined, byteLimit?: number | undefined) => Effect.Effect<{
|
|
316
|
+
readonly avatarUrl: string;
|
|
317
|
+
readonly htmlUrl: string;
|
|
318
|
+
readonly id: number;
|
|
319
|
+
readonly login: string;
|
|
320
|
+
readonly type: string;
|
|
321
|
+
}, 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").ResponseBodyTooLarge | import("effect/Schema").SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
322
|
+
readonly listCommits: (owner: string, repo: string, options?: import("./repositoryReads.ts").RepositoryListOptions | undefined) => Effect.Effect<import("effect/Stream").Stream<{
|
|
323
|
+
hasNext: boolean;
|
|
324
|
+
items: {
|
|
325
|
+
readonly author: {
|
|
326
|
+
readonly avatarUrl: string;
|
|
327
|
+
readonly htmlUrl: string;
|
|
328
|
+
readonly id: number;
|
|
329
|
+
readonly login: string;
|
|
330
|
+
readonly type: string;
|
|
331
|
+
} | null;
|
|
332
|
+
readonly commit: {
|
|
333
|
+
readonly author: {
|
|
334
|
+
readonly date: string;
|
|
335
|
+
readonly email: string;
|
|
336
|
+
readonly name: string;
|
|
337
|
+
} | null;
|
|
338
|
+
readonly committer: {
|
|
339
|
+
readonly date: string;
|
|
340
|
+
readonly email: string;
|
|
341
|
+
readonly name: string;
|
|
342
|
+
} | null;
|
|
343
|
+
readonly message: string;
|
|
344
|
+
readonly tree: {
|
|
345
|
+
readonly sha: string;
|
|
346
|
+
readonly url: string;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
readonly committer: {
|
|
350
|
+
readonly avatarUrl: string;
|
|
351
|
+
readonly htmlUrl: string;
|
|
352
|
+
readonly id: number;
|
|
353
|
+
readonly login: string;
|
|
354
|
+
readonly type: string;
|
|
355
|
+
} | null;
|
|
356
|
+
readonly htmlUrl: string;
|
|
357
|
+
readonly parents: readonly {
|
|
358
|
+
readonly sha: string;
|
|
359
|
+
readonly url: string;
|
|
360
|
+
}[];
|
|
361
|
+
readonly sha: string;
|
|
362
|
+
}[];
|
|
363
|
+
skipped: number;
|
|
364
|
+
}, 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("effect/Schema").SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>, never, never>;
|
|
365
|
+
readonly listIssues: (owner: string, repo: string, options?: import("./repositoryReads.ts").RepositoryListOptions | undefined) => Effect.Effect<import("effect/Stream").Stream<{
|
|
366
|
+
hasNext: boolean;
|
|
367
|
+
items: {
|
|
368
|
+
readonly body: string | null;
|
|
369
|
+
readonly closedAt: string | null;
|
|
370
|
+
readonly createdAt: string;
|
|
371
|
+
readonly htmlUrl: string;
|
|
372
|
+
readonly id: number;
|
|
373
|
+
readonly labels: readonly (string | {
|
|
374
|
+
readonly name?: string | undefined;
|
|
375
|
+
})[];
|
|
376
|
+
readonly number: number;
|
|
377
|
+
readonly pullRequest?: {
|
|
378
|
+
readonly url: string;
|
|
379
|
+
} | undefined;
|
|
380
|
+
readonly state: "closed" | "open";
|
|
381
|
+
readonly title: string;
|
|
382
|
+
readonly updatedAt: string;
|
|
383
|
+
readonly user: {
|
|
384
|
+
readonly avatarUrl: string;
|
|
385
|
+
readonly htmlUrl: string;
|
|
386
|
+
readonly id: number;
|
|
387
|
+
readonly login: string;
|
|
388
|
+
readonly type: string;
|
|
389
|
+
} | null;
|
|
390
|
+
}[];
|
|
391
|
+
skipped: number;
|
|
392
|
+
}, 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("effect/Schema").SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>, never, never>;
|
|
393
|
+
readonly listPullRequestFiles: (owner: string, repo: string, number: number, options?: import("./repositoryReads.ts").RepositoryListOptions | undefined) => Effect.Effect<import("effect/Stream").Stream<{
|
|
394
|
+
hasNext: boolean;
|
|
395
|
+
items: {
|
|
396
|
+
readonly additions: number;
|
|
397
|
+
readonly changes: number;
|
|
398
|
+
readonly deletions: number;
|
|
399
|
+
readonly filename: string;
|
|
400
|
+
readonly patch?: string | undefined;
|
|
401
|
+
readonly previousFilename?: string | undefined;
|
|
402
|
+
readonly sha: string;
|
|
403
|
+
readonly status: string;
|
|
404
|
+
}[];
|
|
405
|
+
skipped: number;
|
|
406
|
+
}, 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("effect/Schema").SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>, never, never>;
|
|
155
407
|
readonly upsertStickyComment: (input: {
|
|
156
408
|
readonly appId?: number | undefined;
|
|
157
409
|
readonly author?: string | undefined;
|
|
@@ -176,6 +428,30 @@ export declare const GitHubApp: Context.Service<"@shivaedev/github/GitHubApp", R
|
|
|
176
428
|
readonly resource: (path: string) => Effect.Effect<string, never, never>;
|
|
177
429
|
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").ResponseBodyTooLarge | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
178
430
|
}>, never, never>;
|
|
431
|
+
readonly viewerRepositories: (account: string | number) => Effect.Effect<{
|
|
432
|
+
administrable: ({
|
|
433
|
+
readonly htmlUrl: string;
|
|
434
|
+
readonly id: number;
|
|
435
|
+
readonly name: string;
|
|
436
|
+
readonly owner: {
|
|
437
|
+
readonly login: string;
|
|
438
|
+
};
|
|
439
|
+
readonly private: boolean;
|
|
440
|
+
} & {
|
|
441
|
+
readonly installationId: number;
|
|
442
|
+
})[];
|
|
443
|
+
readable: ({
|
|
444
|
+
readonly htmlUrl: string;
|
|
445
|
+
readonly id: number;
|
|
446
|
+
readonly name: string;
|
|
447
|
+
readonly owner: {
|
|
448
|
+
readonly login: string;
|
|
449
|
+
};
|
|
450
|
+
readonly private: boolean;
|
|
451
|
+
} & {
|
|
452
|
+
readonly installationId: number;
|
|
453
|
+
})[];
|
|
454
|
+
}, 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("effect/Schema").SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
179
455
|
}>> & {
|
|
180
456
|
readonly layer: Layer.Layer<"@shivaedev/github/GitHubApp", never, HttpClient.HttpClient | {
|
|
181
457
|
readonly credentials: AppCredentials;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installationClients.d.ts","sourceRoot":"","sources":["../src/installationClients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"installationClients.d.ts","sourceRoot":"","sources":["../src/installationClients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,eAAO,MAAM,oBAAoB;0BAA2C,cAAc;;;EAAuC,CAAC;AAElI,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAFsD,cAAc;;CAkCxF,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,+FAI/F"}
|
|
@@ -4,21 +4,30 @@ import { defineService } from "@shivaedev/service/defineService.ts";
|
|
|
4
4
|
import { appTokens } from "#appTokens.ts";
|
|
5
5
|
import { GitHub } from "#GitHub.ts";
|
|
6
6
|
import { GitHubConfig } from "#GitHubConfig.ts";
|
|
7
|
+
import { viewerRepositoryAccess } from "#viewerRepositoryAccess.ts";
|
|
7
8
|
export const GitHubAppCredentials = Context.Service("@shivaedev/github/AppCredentials");
|
|
8
9
|
export const GitHubApp = defineService({
|
|
9
10
|
id: "@shivaedev/github/GitHubApp",
|
|
10
11
|
initialize: Effect.gen(function* () {
|
|
11
|
-
const { credentials } = yield* GitHubAppCredentials;
|
|
12
|
+
const { credentials: supplied } = yield* GitHubAppCredentials;
|
|
13
|
+
const credentials = { appId: supplied.appId, privateKey: supplied.privateKey };
|
|
12
14
|
const http = yield* HttpClient.HttpClient;
|
|
13
15
|
const config = yield* GitHubConfig;
|
|
14
|
-
|
|
16
|
+
const environment = Layer.mergeAll(Layer.succeed(HttpClient.HttpClient)(http), Layer.succeed(GitHubConfig)(config));
|
|
17
|
+
const app = yield* Layer.build(GitHub.layer.pipe(Layer.provide(appTokens(credentials)), Layer.provide(environment))).pipe(Effect.scoped, Effect.map((context) => Context.get(context, GitHub)));
|
|
18
|
+
const clients = yield* Cache.make({
|
|
15
19
|
capacity: 100,
|
|
16
|
-
lookup: (installationId) => Layer.build(GitHub.layer.pipe(Layer.provide(appTokens({ ...credentials, installationId })), Layer.provide(
|
|
20
|
+
lookup: (installationId) => Layer.build(GitHub.layer.pipe(Layer.provide(appTokens({ ...credentials, installationId })), Layer.provide(environment))).pipe(Effect.scoped, Effect.map((context) => Context.get(context, GitHub))),
|
|
17
21
|
timeToLive: "30 minutes",
|
|
18
22
|
});
|
|
23
|
+
function installation(id) {
|
|
24
|
+
return Cache.get(clients, id).pipe(Effect.tap((client) => Cache.set(clients, id, client)));
|
|
25
|
+
}
|
|
26
|
+
return { installation, viewers: yield* viewerRepositoryAccess(app, installation) };
|
|
19
27
|
}),
|
|
20
|
-
methods: (
|
|
21
|
-
installation
|
|
28
|
+
methods: ({ installation, viewers }) => ({
|
|
29
|
+
installation,
|
|
30
|
+
viewerRepositories: (account) => Cache.get(viewers, typeof account === "number" ? `id:${account}` : `login:${account.toLowerCase()}`),
|
|
22
31
|
}),
|
|
23
32
|
requires: [GitHubAppCredentials, HttpClient.HttpClient, GitHubConfig],
|
|
24
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installationClients.js","sourceRoot":"","sources":["../src/installationClients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"installationClients.js","sourceRoot":"","sources":["../src/installationClients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,M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EAAE,CAAC;KACrG,CAAC;IACF,QAAQ,EAAE,CAAC,oBAAoB,EAAE,UAAU,CAAC,UAAU,EAAE,YAAY,CAAC;CACrE,CAAC,CAAC;AAEH,MAAM,UAAU,gBAAgB,CAAU,cAAsB,EAAE,MAA8B;IAC/F,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACxC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAC3G,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Effect, Schema, Stream } from "effect";
|
|
2
|
+
import type { ServiceUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
3
|
+
import type { Representations } from "#representations.ts";
|
|
4
|
+
export interface ListOptions {
|
|
5
|
+
readonly arrayKey?: string | undefined;
|
|
6
|
+
readonly beforeRequest?: (resource: string) => Effect.Effect<void, ServiceUnavailable>;
|
|
7
|
+
readonly onDecodeError?: "fail" | "skip" | undefined;
|
|
8
|
+
readonly responseByteLimit?: number | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function decodedPages<TSchema extends Schema.Constraint>(client: Representations, path: string, schema: TSchema, options?: ListOptions | number): Stream.Stream<{
|
|
11
|
+
hasNext: boolean;
|
|
12
|
+
items: TSchema["Type"][];
|
|
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").ResponseBodyTooLarge | Schema.SchemaError | ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, TSchema["DecodingServices"]>;
|
|
15
|
+
//# sourceMappingURL=pagedLists.d.ts.map
|
|
@@ -0,0 +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;IAC3B,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,kBAAkB,CAAC,CAAC;IACvF,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,EAC7D,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,WAAW,GAAG,MAAW;;;;ujBAwBlC"}
|