@shivaedev/github 0.8.6 → 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 +47 -0
- package/README.md +142 -8
- package/dist/GitHub.d.ts +360 -18
- package/dist/GitHub.d.ts.map +1 -1
- package/dist/GitHub.js +19 -6
- package/dist/GitHub.js.map +1 -1
- package/dist/GitHubToken.d.ts +2 -2
- package/dist/GitHubToken.d.ts.map +1 -1
- package/dist/GitHubToken.js +1 -1
- package/dist/GitHubToken.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 +6 -0
- package/dist/appTokens.d.ts.map +1 -0
- package/dist/appTokens.js +65 -0
- package/dist/appTokens.js.map +1 -0
- 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/authenticatedRequest.d.ts +1 -1
- package/dist/authenticatedRequest.d.ts.map +1 -1
- package/dist/authenticatedRequest.js +3 -2
- package/dist/authenticatedRequest.js.map +1 -1
- package/dist/cache.d.ts +2 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +3 -0
- package/dist/cache.js.map +1 -1
- package/dist/checkRuns.d.ts +116 -11
- package/dist/checkRuns.d.ts.map +1 -1
- package/dist/checkRuns.js +41 -18
- 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/githubApp.d.ts +2 -4
- package/dist/githubApp.d.ts.map +1 -1
- package/dist/githubApp.js +5 -55
- package/dist/githubApp.js.map +1 -1
- package/dist/installationClients.d.ts +461 -0
- package/dist/installationClients.d.ts.map +1 -0
- package/dist/installationClients.js +37 -0
- package/dist/installationClients.js.map +1 -0
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +4 -0
- package/dist/json.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 +4 -4
- 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 +2 -2
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +11 -9
- package/dist/requests.js.map +1 -1
- package/dist/status.d.ts +1 -1
- package/dist/status.d.ts.map +1 -1
- package/dist/stickyComments.d.ts +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 +14 -7
- package/src/GitHub.ts +32 -11
- package/src/GitHubToken.ts +4 -2
- package/src/adapters/resolveApiUrl.ts +5 -0
- package/src/adapters/zipEntries.ts +69 -0
- package/src/appTokens.ts +93 -0
- 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/authenticatedRequest.ts +3 -1
- package/src/cache.ts +5 -0
- package/src/checkRuns.ts +58 -18
- package/src/gitSchemas.ts +52 -0
- package/src/githubApp.ts +6 -80
- package/src/installationClients.ts +50 -0
- package/src/json.ts +4 -0
- package/src/pagedLists.ts +40 -0
- package/src/repositoryReads.ts +61 -0
- package/src/repositorySchemas.ts +43 -0
- package/src/representations.ts +5 -4
- package/src/requests.ts +11 -9
- package/src/viewerRepositoryAccess.ts +66 -0
package/dist/checkRuns.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
1
|
+
import { Effect, Option, Schema } from "effect";
|
|
2
2
|
import type { Representations } from "#representations.ts";
|
|
3
3
|
export declare const CheckRunOutput: Schema.Struct<{
|
|
4
4
|
readonly summary: Schema.String;
|
|
@@ -6,9 +6,22 @@ export declare const CheckRunOutput: Schema.Struct<{
|
|
|
6
6
|
readonly title: Schema.String;
|
|
7
7
|
}>;
|
|
8
8
|
export declare const CheckRunConclusion: Schema.Literals<readonly ["action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out"]>;
|
|
9
|
-
export declare const CheckRunStatus: Schema.Literals<readonly ["queued", "in_progress", "completed"]>;
|
|
10
|
-
export declare const CreateCheckRun: Schema.encodeKeys<Schema.Struct<{
|
|
9
|
+
export declare const CheckRunStatus: Schema.Literals<readonly ["queued", "in_progress", "completed", "waiting", "requested", "pending"]>;
|
|
10
|
+
export declare const CreateCheckRun: Schema.Union<readonly [Schema.encodeKeys<Schema.Struct<{
|
|
11
|
+
readonly detailsUrl: Schema.optional<Schema.String>;
|
|
12
|
+
readonly headSha: Schema.String;
|
|
13
|
+
readonly name: Schema.String;
|
|
14
|
+
readonly output: Schema.optional<Schema.Struct<{
|
|
15
|
+
readonly summary: Schema.String;
|
|
16
|
+
readonly text: Schema.optional<Schema.String>;
|
|
17
|
+
readonly title: Schema.String;
|
|
18
|
+
}>>;
|
|
11
19
|
readonly conclusion: Schema.optional<Schema.Literals<readonly ["action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out"]>>;
|
|
20
|
+
readonly status: Schema.Literals<readonly ["queued", "in_progress"]>;
|
|
21
|
+
}>, {
|
|
22
|
+
readonly detailsUrl: "details_url";
|
|
23
|
+
readonly headSha: "head_sha";
|
|
24
|
+
}>, Schema.encodeKeys<Schema.Struct<{
|
|
12
25
|
readonly detailsUrl: Schema.optional<Schema.String>;
|
|
13
26
|
readonly headSha: Schema.String;
|
|
14
27
|
readonly name: Schema.String;
|
|
@@ -17,11 +30,12 @@ export declare const CreateCheckRun: Schema.encodeKeys<Schema.Struct<{
|
|
|
17
30
|
readonly text: Schema.optional<Schema.String>;
|
|
18
31
|
readonly title: Schema.String;
|
|
19
32
|
}>>;
|
|
20
|
-
readonly
|
|
33
|
+
readonly conclusion: Schema.Literals<readonly ["action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out"]>;
|
|
34
|
+
readonly status: Schema.Literal<"completed">;
|
|
21
35
|
}>, {
|
|
22
36
|
readonly detailsUrl: "details_url";
|
|
23
37
|
readonly headSha: "head_sha";
|
|
24
|
-
}>;
|
|
38
|
+
}>]>;
|
|
25
39
|
export declare const UpdateCheckRun: Schema.Union<readonly [Schema.encodeKeys<Schema.Struct<{
|
|
26
40
|
readonly detailsUrl: Schema.optional<Schema.String>;
|
|
27
41
|
readonly output: Schema.optional<Schema.Struct<{
|
|
@@ -45,6 +59,9 @@ export declare const UpdateCheckRun: Schema.Union<readonly [Schema.encodeKeys<Sc
|
|
|
45
59
|
readonly detailsUrl: "details_url";
|
|
46
60
|
}>]>;
|
|
47
61
|
export declare const CheckRun: Schema.encodeKeys<Schema.Struct<{
|
|
62
|
+
readonly app: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
63
|
+
readonly id: Schema.Number;
|
|
64
|
+
}>>>;
|
|
48
65
|
readonly conclusion: Schema.NullOr<Schema.Literals<readonly ["action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out"]>>;
|
|
49
66
|
readonly detailsUrl: Schema.NullOr<Schema.String>;
|
|
50
67
|
readonly headSha: Schema.String;
|
|
@@ -55,14 +72,33 @@ export declare const CheckRun: Schema.encodeKeys<Schema.Struct<{
|
|
|
55
72
|
readonly text: Schema.NullOr<Schema.String>;
|
|
56
73
|
readonly title: Schema.NullOr<Schema.String>;
|
|
57
74
|
}>;
|
|
58
|
-
readonly status: Schema.Literals<readonly ["queued", "in_progress", "completed"]>;
|
|
75
|
+
readonly status: Schema.Literals<readonly ["queued", "in_progress", "completed", "waiting", "requested", "pending"]>;
|
|
59
76
|
}>, {
|
|
60
77
|
readonly detailsUrl: "details_url";
|
|
61
78
|
readonly headSha: "head_sha";
|
|
62
79
|
}>;
|
|
80
|
+
export declare const FindCheckRun: Schema.Union<readonly [Schema.Struct<{
|
|
81
|
+
readonly appId: Schema.optional<Schema.Number>;
|
|
82
|
+
readonly headSha: Schema.String;
|
|
83
|
+
readonly name: Schema.String;
|
|
84
|
+
}>, Schema.Struct<{
|
|
85
|
+
readonly appId: Schema.Number;
|
|
86
|
+
readonly headSha: Schema.String;
|
|
87
|
+
readonly name: Schema.optional<Schema.String>;
|
|
88
|
+
}>]>;
|
|
63
89
|
export declare function checkRuns(client: Representations): {
|
|
64
90
|
createCheckRun: (owner: string, repo: string, input: {
|
|
91
|
+
readonly detailsUrl?: string | undefined;
|
|
92
|
+
readonly headSha: string;
|
|
93
|
+
readonly name: string;
|
|
94
|
+
readonly output?: {
|
|
95
|
+
readonly summary: string;
|
|
96
|
+
readonly text?: string | undefined;
|
|
97
|
+
readonly title: string;
|
|
98
|
+
} | undefined;
|
|
65
99
|
readonly conclusion?: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | undefined;
|
|
100
|
+
readonly status: "in_progress" | "queued";
|
|
101
|
+
} | {
|
|
66
102
|
readonly detailsUrl?: string | undefined;
|
|
67
103
|
readonly headSha: string;
|
|
68
104
|
readonly name: string;
|
|
@@ -71,8 +107,36 @@ export declare function checkRuns(client: Representations): {
|
|
|
71
107
|
readonly text?: string | undefined;
|
|
72
108
|
readonly title: string;
|
|
73
109
|
} | undefined;
|
|
74
|
-
readonly
|
|
110
|
+
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out";
|
|
111
|
+
readonly status: "completed";
|
|
75
112
|
}) => Effect.Effect<{
|
|
113
|
+
readonly app?: {
|
|
114
|
+
readonly id: number;
|
|
115
|
+
} | null | undefined;
|
|
116
|
+
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | null;
|
|
117
|
+
readonly detailsUrl: string | null;
|
|
118
|
+
readonly headSha: string;
|
|
119
|
+
readonly id: number;
|
|
120
|
+
readonly name: string;
|
|
121
|
+
readonly output: {
|
|
122
|
+
readonly summary: string | null;
|
|
123
|
+
readonly text: string | null;
|
|
124
|
+
readonly title: string | null;
|
|
125
|
+
};
|
|
126
|
+
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
127
|
+
}, 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").ResponseBodyTooLarge | Schema.SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
128
|
+
findLatestCheckRun: (owner: string, repo: string, input: {
|
|
129
|
+
readonly appId?: number | undefined;
|
|
130
|
+
readonly headSha: string;
|
|
131
|
+
readonly name: string;
|
|
132
|
+
} | {
|
|
133
|
+
readonly appId: number;
|
|
134
|
+
readonly headSha: string;
|
|
135
|
+
readonly name?: string | undefined;
|
|
136
|
+
}) => Effect.Effect<Option.Option<{
|
|
137
|
+
readonly app?: {
|
|
138
|
+
readonly id: number;
|
|
139
|
+
} | null | undefined;
|
|
76
140
|
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | null;
|
|
77
141
|
readonly detailsUrl: string | null;
|
|
78
142
|
readonly headSha: string;
|
|
@@ -83,8 +147,8 @@ export declare function checkRuns(client: Representations): {
|
|
|
83
147
|
readonly text: string | null;
|
|
84
148
|
readonly title: string | null;
|
|
85
149
|
};
|
|
86
|
-
readonly status: "completed" | "in_progress" | "queued";
|
|
87
|
-
}
|
|
150
|
+
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
151
|
+
}>, import("./errors.ts").GitHubAppError | import("./errors.ts").GitHubConversationLocked | import("./errors.ts").GitHubPermissionDenied | import("./errors.ts").GitHubRateLimited | import("./errors.ts").GitHubTransportError | import("@shivaedev/http/errors.ts").InvalidBodyLimit | import("effect/Cause").NoSuchElementError | import("@shivaedev/http/errors.ts").PaginationLinkError | import("@shivaedev/http/errors.ts").ResponseBodyTooLarge | Schema.SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
88
152
|
updateCheckRun: (owner: string, repo: string, id: number, input: {
|
|
89
153
|
readonly detailsUrl?: string | undefined;
|
|
90
154
|
readonly output?: {
|
|
@@ -103,6 +167,47 @@ export declare function checkRuns(client: Representations): {
|
|
|
103
167
|
} | undefined;
|
|
104
168
|
readonly status: "completed";
|
|
105
169
|
}) => Effect.Effect<{
|
|
170
|
+
readonly app?: {
|
|
171
|
+
readonly id: number;
|
|
172
|
+
} | null | undefined;
|
|
173
|
+
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | null;
|
|
174
|
+
readonly detailsUrl: string | null;
|
|
175
|
+
readonly headSha: string;
|
|
176
|
+
readonly id: number;
|
|
177
|
+
readonly name: string;
|
|
178
|
+
readonly output: {
|
|
179
|
+
readonly summary: string | null;
|
|
180
|
+
readonly text: string | null;
|
|
181
|
+
readonly title: string | null;
|
|
182
|
+
};
|
|
183
|
+
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
184
|
+
}, 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").ResponseBodyTooLarge | Schema.SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
185
|
+
upsertCheckRun: (owner: string, repo: string, input: {
|
|
186
|
+
readonly detailsUrl?: string | undefined;
|
|
187
|
+
readonly headSha: string;
|
|
188
|
+
readonly name: string;
|
|
189
|
+
readonly output?: {
|
|
190
|
+
readonly summary: string;
|
|
191
|
+
readonly text?: string | undefined;
|
|
192
|
+
readonly title: string;
|
|
193
|
+
} | undefined;
|
|
194
|
+
readonly conclusion?: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | undefined;
|
|
195
|
+
readonly status: "in_progress" | "queued";
|
|
196
|
+
} | {
|
|
197
|
+
readonly detailsUrl?: string | undefined;
|
|
198
|
+
readonly headSha: string;
|
|
199
|
+
readonly name: string;
|
|
200
|
+
readonly output?: {
|
|
201
|
+
readonly summary: string;
|
|
202
|
+
readonly text?: string | undefined;
|
|
203
|
+
readonly title: string;
|
|
204
|
+
} | undefined;
|
|
205
|
+
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out";
|
|
206
|
+
readonly status: "completed";
|
|
207
|
+
}, appId?: number | undefined) => Effect.Effect<{
|
|
208
|
+
readonly app?: {
|
|
209
|
+
readonly id: number;
|
|
210
|
+
} | null | undefined;
|
|
106
211
|
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | null;
|
|
107
212
|
readonly detailsUrl: string | null;
|
|
108
213
|
readonly headSha: string;
|
|
@@ -113,7 +218,7 @@ export declare function checkRuns(client: Representations): {
|
|
|
113
218
|
readonly text: string | null;
|
|
114
219
|
readonly title: string | null;
|
|
115
220
|
};
|
|
116
|
-
readonly status: "completed" | "in_progress" | "queued";
|
|
117
|
-
}, 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").ResponseBodyTooLarge | Schema.SchemaError | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
221
|
+
readonly status: "completed" | "in_progress" | "pending" | "queued" | "requested" | "waiting";
|
|
222
|
+
}, 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 | Schema.SchemaError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | import("@shivaedev/http/errors.ts").RemoteStatusError, never>;
|
|
118
223
|
};
|
|
119
224
|
//# sourceMappingURL=checkRuns.d.ts.map
|
package/dist/checkRuns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkRuns.d.ts","sourceRoot":"","sources":["../src/checkRuns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"checkRuns.d.ts","sourceRoot":"","sources":["../src/checkRuns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,eAAO,MAAM,cAAc;;;;EAIzB,CAAC;AAEH,eAAO,MAAM,kBAAkB,8HAAsH,CAAC;AACtJ,eAAO,MAAM,cAAc,qGAA6F,CAAC;AAQzH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;IAYzB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;EASyD,CAAC;AAE/E,eAAO,MAAM,YAAY;;;;;;;;IAGvB,CAAC;AAEH,wBAAgB,SAAS,CAAC,MAAM,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwChD"}
|
package/dist/checkRuns.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
1
|
+
import { Effect, Option, Schema, Stream } from "effect";
|
|
2
|
+
import { decodedPages } from "#pagedLists.ts";
|
|
2
3
|
export const CheckRunOutput = Schema.Struct({
|
|
3
4
|
summary: Schema.String,
|
|
4
5
|
text: Schema.optional(Schema.String),
|
|
5
6
|
title: Schema.String,
|
|
6
7
|
});
|
|
7
8
|
export const CheckRunConclusion = Schema.Literals(["action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out"]);
|
|
8
|
-
export const CheckRunStatus = Schema.Literals(["queued", "in_progress", "completed"]);
|
|
9
|
-
|
|
10
|
-
conclusion: Schema.optional(CheckRunConclusion),
|
|
9
|
+
export const CheckRunStatus = Schema.Literals(["queued", "in_progress", "completed", "waiting", "requested", "pending"]);
|
|
10
|
+
const createFields = {
|
|
11
11
|
detailsUrl: Schema.optional(Schema.String),
|
|
12
12
|
headSha: Schema.String,
|
|
13
13
|
name: Schema.String,
|
|
14
14
|
output: Schema.optional(CheckRunOutput),
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
};
|
|
16
|
+
export const CreateCheckRun = Schema.Union([
|
|
17
|
+
Schema.Struct({ ...createFields, conclusion: Schema.optional(CheckRunConclusion), status: Schema.Literals(["queued", "in_progress"]) }).pipe(Schema.encodeKeys({ detailsUrl: "details_url", headSha: "head_sha" })),
|
|
18
|
+
Schema.Struct({ ...createFields, conclusion: CheckRunConclusion, status: Schema.Literal("completed") }).pipe(Schema.encodeKeys({ detailsUrl: "details_url", headSha: "head_sha" })),
|
|
19
|
+
]);
|
|
17
20
|
export const UpdateCheckRun = Schema.Union([
|
|
18
21
|
Schema.Struct({
|
|
19
22
|
detailsUrl: Schema.optional(Schema.String),
|
|
@@ -28,6 +31,7 @@ export const UpdateCheckRun = Schema.Union([
|
|
|
28
31
|
}).pipe(Schema.encodeKeys({ detailsUrl: "details_url" })),
|
|
29
32
|
]);
|
|
30
33
|
export const CheckRun = Schema.Struct({
|
|
34
|
+
app: Schema.optional(Schema.NullOr(Schema.Struct({ id: Schema.Number }))),
|
|
31
35
|
conclusion: Schema.NullOr(CheckRunConclusion),
|
|
32
36
|
detailsUrl: Schema.NullOr(Schema.String),
|
|
33
37
|
headSha: Schema.String,
|
|
@@ -36,18 +40,37 @@ export const CheckRun = Schema.Struct({
|
|
|
36
40
|
output: Schema.Struct({ summary: Schema.NullOr(Schema.String), text: Schema.NullOr(Schema.String), title: Schema.NullOr(Schema.String) }),
|
|
37
41
|
status: CheckRunStatus,
|
|
38
42
|
}).pipe(Schema.encodeKeys({ detailsUrl: "details_url", headSha: "head_sha" }));
|
|
43
|
+
export const FindCheckRun = Schema.Union([
|
|
44
|
+
Schema.Struct({ appId: Schema.optional(Schema.Number), headSha: Schema.String, name: Schema.String }),
|
|
45
|
+
Schema.Struct({ appId: Schema.Number, headSha: Schema.String, name: Schema.optional(Schema.String) }),
|
|
46
|
+
]);
|
|
39
47
|
export function checkRuns(client) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const createCheckRun = Effect.fn("GitHub.createCheckRun")(function* (owner, repo, input) {
|
|
49
|
+
const body = yield* Schema.encodeEffect(CreateCheckRun)(input);
|
|
50
|
+
const response = yield* client.write("POST", `/repos/${owner}/${repo}/check-runs`, body);
|
|
51
|
+
return yield* response.decode(CheckRun);
|
|
52
|
+
});
|
|
53
|
+
const updateCheckRun = Effect.fn("GitHub.updateCheckRun")(function* (owner, repo, id, input) {
|
|
54
|
+
const body = yield* Schema.encodeEffect(UpdateCheckRun)(input);
|
|
55
|
+
const response = yield* client.write("PATCH", `/repos/${owner}/${repo}/check-runs/${id}`, body);
|
|
56
|
+
return yield* response.decode(CheckRun);
|
|
57
|
+
});
|
|
58
|
+
const findLatestCheckRun = Effect.fn("GitHub.findLatestCheckRun")(function* (owner, repo, input) {
|
|
59
|
+
const { headSha, name, appId } = yield* Schema.decodeUnknownEffect(FindCheckRun)(input);
|
|
60
|
+
const query = new URLSearchParams({ filter: "all", "per_page": "100" });
|
|
61
|
+
if (name !== undefined) {
|
|
62
|
+
query.set("check_name", name);
|
|
63
|
+
}
|
|
64
|
+
const pages = decodedPages(client, `/repos/${owner}/${repo}/commits/${encodeURIComponent(headSha)}/check-runs?${query}`, CheckRun, {
|
|
65
|
+
arrayKey: "check_runs",
|
|
66
|
+
});
|
|
67
|
+
return yield* pages.pipe(Stream.flatMap((page) => Stream.fromIterable(page.items)), Stream.filter((run) => (name === undefined || run.name === name) && (appId === undefined || run.app?.id === appId)), Stream.runFold(() => Option.none(), (latest, run) => (Option.isNone(latest) || run.id > latest.value.id ? Option.some(run) : latest)));
|
|
68
|
+
});
|
|
69
|
+
const upsertCheckRun = Effect.fn("GitHub.upsertCheckRun")(function* (owner, repo, input, appId) {
|
|
70
|
+
yield* Schema.encodeEffect(CreateCheckRun)(input);
|
|
71
|
+
const existing = yield* findLatestCheckRun(owner, repo, { appId, headSha: input.headSha, name: input.name });
|
|
72
|
+
return yield* Option.isSome(existing) ? updateCheckRun(owner, repo, existing.value.id, input) : createCheckRun(owner, repo, input);
|
|
73
|
+
});
|
|
74
|
+
return { createCheckRun, findLatestCheckRun, updateCheckRun, upsertCheckRun };
|
|
52
75
|
}
|
|
53
76
|
//# sourceMappingURL=checkRuns.js.map
|
package/dist/checkRuns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkRuns.js","sourceRoot":"","sources":["../src/checkRuns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"checkRuns.js","sourceRoot":"","sources":["../src/checkRuns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,IAAI,EAAE,MAAM,CAAC,QAAQ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,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACpI,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC/E,CAAC"}
|
|
@@ -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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
|
2
|
-
import {
|
|
3
|
-
import { type AppCredentials } from "#appJwt.ts";
|
|
4
|
-
import { GitHubToken } from "#GitHubToken.ts";
|
|
2
|
+
import type { AppCredentials } from "#appJwt.ts";
|
|
5
3
|
export interface InstallationScope {
|
|
6
4
|
readonly permissions?: Readonly<Record<string, "read" | "write" | "admin">>;
|
|
7
5
|
readonly repositories?: readonly string[];
|
|
@@ -20,5 +18,5 @@ export type GitHubAppOptions = AppCredentials & ({
|
|
|
20
18
|
readonly repository?: never;
|
|
21
19
|
readonly scope?: never;
|
|
22
20
|
});
|
|
23
|
-
export declare function githubApp(options: GitHubAppOptions): Layer.Layer<GitHubToken, never, HttpClient.HttpClient>;
|
|
21
|
+
export declare function githubApp(options: GitHubAppOptions): Layer.Layer<"@shivaedev/github/GitHubApp" | import("./GitHubToken.ts").GitHubToken, never, import("effect/http/HttpClient").HttpClient>;
|
|
24
22
|
//# sourceMappingURL=githubApp.d.ts.map
|
package/dist/githubApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubApp.d.ts","sourceRoot":"","sources":["../src/githubApp.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"githubApp.d.ts","sourceRoot":"","sources":["../src/githubApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAC5E,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAC5C,CACG;IAAE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAAE,GACvE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAAE,GAC3F;IAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAClH,CAAC;AAEH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,2IAGlD"}
|