aboutsummaryrefslogtreecommitdiff
path: root/sourcehut_builds.d.luau
diff options
context:
space:
mode:
Diffstat (limited to 'sourcehut_builds.d.luau')
-rw-r--r--sourcehut_builds.d.luau47
1 files changed, 47 insertions, 0 deletions
diff --git a/sourcehut_builds.d.luau b/sourcehut_builds.d.luau
new file mode 100644
index 0000000..100e388
--- /dev/null
+++ b/sourcehut_builds.d.luau
@@ -0,0 +1,47 @@
+export type SourcehutBuildsState = {
+ successful: number,
+ failed: number,
+ inProgress: number,
+ user: string,
+ builds: { SourcehutBuild }
+}
+
+export type SourcehutBuild = {
+ id: number,
+ created: string,
+ updated: string,
+ status: SourcehutBuildStatus,
+ note: string,
+ tags: {[number]: string},
+ tasks: {[number]: SourcehutBuildTask}
+}
+
+export type SourcehutBuildStatus = "PENDING" | "QUEUED" | "RUNNING" | "FAILED" | "SUCCESS" | "TIMEOUT" | "CANCELLED"
+
+export type SourcehutBuildTask = {
+ name: string,
+ status: SourcehutBuildTaskStatus
+}
+export type SourcehutBuildTaskStatus = "PENDING" | "RUNNING" | "FAILED" | "SUCCESS" | "SKIPPED"
+
+type Err<E> = {type: "error", error: string}
+type Pending = {type: "pending"}
+type Ok = {type: "ok"}
+export type PollerStatus = Err<string> | Pending | Ok
+
+export type SourcehutBuildResponse = {
+ data: SourcehutBuildData
+}
+
+export type SourcehutBuildData = {
+ me: SourcehutUser,
+}
+
+export type SourcehutUser = {
+ canonicalName: string,
+ jobs: SourcehutUserJobs
+}
+
+export type SourcehutUserJobs = {
+ results: {[number]: SourcehutBuild},
+}