aboutsummaryrefslogtreecommitdiff
path: root/sourcehut-builds/constants.luau
blob: 5133849f99af103a35fc7917498a50e68c98bfa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--------------------------------------------------------------------------------
-- Events
--------------------------------------------------------------------------------
local CONSTANTS = {
  events = {
    panel_state_updated = "sourcehut_panel_state_updated",
    builds_state_updated = "sourcehut_builds_state_updated",
    poller_state_updated = "sourcehut_poller_state_updated"
  },
  panel = {
    id = "rbdr/sourcehut-builds:panel",
    theme = {
      fontSize = {
        heading = 18
      },
      fontWeight = {
        heading = "bold"
      }
    }
  },
  bar = {
    update_interval = 2000
  },
  poller = {
    state = {
      pending = {type= "pending"},
      ok = {type= "ok"}
    },
    update_interval = 30000,
    errors = {
      request_failed = noctalia.tr("error.request_failed"),
      bad_response = noctalia.tr("error.bad_response"),
      unauthorized = noctalia.tr("error.unauthorized")
    },
    cutoff_configuration_key = "recent_cutoff",
    build_count_configuration_key = "build_count"
  },
  sourcehut = {
    builds_url = "https://builds.sr.ht/query",
    web_url = "https://builds.sr.ht/",
    query = "{\"query\": \"query { me { canonicalName jobs { results { id created updated status note tags tasks { name status } } } } }\"}",
    token_configuration_key = "sourcehut_api_token",
    errors = {
      unauthorized = "ERR_UNAUTHORIZED"
    }
  }
}

return CONSTANTS