From 628406f0a50e040d4661629446c620a3a495441f Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Thu, 24 Sep 2026 21:01:06 +0200 Subject: Initial commit --- sourcehut_builds.d.luau | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sourcehut_builds.d.luau (limited to 'sourcehut_builds.d.luau') 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 = {type: "error", error: string} +type Pending = {type: "pending"} +type Ok = {type: "ok"} +export type PollerStatus = Err | 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}, +} -- cgit