303 lines
9.9 KiB
Go
303 lines
9.9 KiB
Go
package db
|
|
|
|
type state struct {
|
|
Admins []adminRow `json:"admins"`
|
|
Feedbacks []Feedback `json:"feedbacks"`
|
|
Sources []Source `json:"sources"`
|
|
SourceChecks []SourceCheck `json:"sourceChecks"`
|
|
SourceCalls []SourceCall `json:"sourceCalls"`
|
|
AuditLogs []AuditLog `json:"auditLogs"`
|
|
NextID map[string]int64 `json:"nextId"`
|
|
}
|
|
|
|
type adminRow struct {
|
|
ID int64 `json:"id"`
|
|
Username string `json:"username"`
|
|
PasswordHash string `json:"passwordHash"`
|
|
PasswordChanged bool `json:"passwordChanged"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type DatabaseStatus struct {
|
|
ActiveProvider string `json:"activeProvider"`
|
|
ConfigProvider string `json:"configProvider"`
|
|
SQLiteReady bool `json:"sqliteReady"`
|
|
RemoteReady bool `json:"remoteReady"`
|
|
FailoverActive bool `json:"failoverActive"`
|
|
LastError string `json:"lastError"`
|
|
LastFailoverAt string `json:"lastFailoverAt"`
|
|
LastRecoveredAt string `json:"lastRecoveredAt"`
|
|
LastSyncAt string `json:"lastSyncAt"`
|
|
LastSyncError string `json:"lastSyncError"`
|
|
}
|
|
|
|
type SyncResult struct {
|
|
Direction string `json:"direction"`
|
|
Status string `json:"status"`
|
|
Skipped bool `json:"skipped"`
|
|
Warnings []string `json:"warnings,omitempty"`
|
|
Tables map[string]int `json:"tables"`
|
|
FinishedAt string `json:"finishedAt"`
|
|
}
|
|
|
|
type AdminUser struct {
|
|
ID int64 `json:"id"`
|
|
Username string `json:"username"`
|
|
PasswordChanged bool `json:"passwordChanged"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type Feedback struct {
|
|
Code string `json:"code"`
|
|
Title string `json:"title"`
|
|
Type string `json:"type"`
|
|
Severity string `json:"severity"`
|
|
Category string `json:"category"`
|
|
Priority string `json:"priority"`
|
|
Contact string `json:"contact"`
|
|
Body string `json:"body"`
|
|
Status string `json:"status"`
|
|
StatusDetail string `json:"statusDetail"`
|
|
PublicReply string `json:"publicReply"`
|
|
Note string `json:"note"`
|
|
Assignee string `json:"assignee"`
|
|
HandledBy string `json:"handledBy"`
|
|
DueAt string `json:"dueAt"`
|
|
ResolvedAt string `json:"resolvedAt"`
|
|
ArchivedAt string `json:"archivedAt"`
|
|
SLALevel string `json:"slaLevel"`
|
|
SourceChannel string `json:"sourceChannel"`
|
|
RiskScore int `json:"riskScore"`
|
|
Resolution string `json:"resolution"`
|
|
Attachment string `json:"attachment"`
|
|
PackagePath string `json:"packagePath"`
|
|
EncryptedPackagePath string `json:"encryptedPackagePath"`
|
|
PackageSha256 string `json:"packageSha256"`
|
|
PlainPackageSha256 string `json:"plainPackageSha256"`
|
|
SummaryText string `json:"summaryText"`
|
|
IncludedFiles string `json:"includedFiles"`
|
|
MailSent bool `json:"mailSent"`
|
|
RemoteAddr string `json:"remoteAddr"`
|
|
Tags []string `json:"tags,omitempty"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
LastActivityAt string `json:"lastActivityAt"`
|
|
}
|
|
|
|
type FeedbackComment struct {
|
|
ID int64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Author string `json:"author"`
|
|
Body string `json:"body"`
|
|
Internal bool `json:"internal"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type FeedbackAttachment struct {
|
|
ID int64 `json:"id"`
|
|
FeedbackCode string `json:"feedbackCode"`
|
|
Kind string `json:"kind"`
|
|
Path string `json:"path"`
|
|
FileName string `json:"fileName"`
|
|
SHA256 string `json:"sha256"`
|
|
SizeBytes int64 `json:"sizeBytes"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type LegacyFeedbackEvent struct {
|
|
ID int64 `json:"id"`
|
|
FeedbackCode string `json:"feedbackCode"`
|
|
EventType string `json:"eventType"`
|
|
Actor string `json:"actor"`
|
|
FromValue string `json:"fromValue"`
|
|
ToValue string `json:"toValue"`
|
|
Message string `json:"message"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type LegacyMailRecord struct {
|
|
ID int64 `json:"id"`
|
|
FeedbackCode string `json:"feedbackCode"`
|
|
Kind string `json:"kind"`
|
|
Status string `json:"status"`
|
|
ToAddress string `json:"toAddress"`
|
|
Subject string `json:"subject"`
|
|
PlainBody string `json:"plainBody,omitempty"`
|
|
HTMLBody string `json:"htmlBody,omitempty"`
|
|
AttachmentPath string `json:"attachmentPath"`
|
|
AttachmentName string `json:"attachmentName"`
|
|
ErrorMessage string `json:"errorMessage"`
|
|
CreatedAt string `json:"createdAt"`
|
|
SentAt string `json:"sentAt"`
|
|
}
|
|
|
|
type LegacySyncJob struct {
|
|
ID int64 `json:"id"`
|
|
Status string `json:"status"`
|
|
Summary string `json:"summary"`
|
|
StatsJSON string `json:"statsJson"`
|
|
StartedAt string `json:"startedAt"`
|
|
FinishedAt string `json:"finishedAt"`
|
|
}
|
|
|
|
type FeedbackDetail struct {
|
|
Feedback
|
|
Comments []FeedbackComment `json:"comments"`
|
|
Attachments []FeedbackAttachment `json:"attachments"`
|
|
Events []AuditLog `json:"events"`
|
|
LegacyEvents []LegacyFeedbackEvent `json:"legacyEvents"`
|
|
MailRecords []LegacyMailRecord `json:"mailRecords"`
|
|
}
|
|
|
|
type FeedbackFilters struct {
|
|
Status string
|
|
Category string
|
|
Priority string
|
|
Query string
|
|
Assignee string
|
|
Tag string
|
|
Sort string
|
|
}
|
|
|
|
type FeedbackUpdate struct {
|
|
Status string `json:"status"`
|
|
Category string `json:"category"`
|
|
Priority string `json:"priority"`
|
|
StatusDetail string `json:"statusDetail"`
|
|
HandledBy string `json:"handledBy"`
|
|
Assignee string `json:"assignee"`
|
|
DueAt string `json:"dueAt"`
|
|
SLALevel string `json:"slaLevel"`
|
|
Resolution string `json:"resolution"`
|
|
Note string `json:"note"`
|
|
PublicReply string `json:"publicReply"`
|
|
Actor string `json:"actor"`
|
|
Tags []string `json:"tags"`
|
|
}
|
|
|
|
type ReleasePackage struct {
|
|
ID int64 `json:"id"`
|
|
Product string `json:"product"`
|
|
Version string `json:"version"`
|
|
Platform string `json:"platform"`
|
|
Arch string `json:"arch"`
|
|
FileName string `json:"fileName"`
|
|
URL string `json:"url"`
|
|
SHA256 string `json:"sha256"`
|
|
SizeBytes int64 `json:"sizeBytes"`
|
|
Enabled bool `json:"enabled"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type ReleaseNotice struct {
|
|
ID int64 `json:"id"`
|
|
Version string `json:"version"`
|
|
Build string `json:"build"`
|
|
Channel string `json:"channel"`
|
|
Title string `json:"title"`
|
|
Message string `json:"message"`
|
|
ReleaseNotes string `json:"releaseNotes"`
|
|
MessageMD string `json:"messageMd"`
|
|
ReleaseNotesMD string `json:"releaseNotesMd"`
|
|
DownloadURL string `json:"downloadUrl"`
|
|
NoticeFile string `json:"noticeFile"`
|
|
RawJSON string `json:"rawJson"`
|
|
PublishedAt string `json:"publishedAt"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type ReleaseNoticeRevision struct {
|
|
ID int64 `json:"id"`
|
|
Version string `json:"version"`
|
|
RawJSON string `json:"rawJson"`
|
|
Note string `json:"note"`
|
|
CreatedBy string `json:"createdBy"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type Source struct {
|
|
ID int64 `json:"id"`
|
|
CategoryID string `json:"categoryId"`
|
|
CategoryName string `json:"categoryName"`
|
|
SourceID string `json:"sourceId"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Method string `json:"method"`
|
|
APIURL string `json:"apiUrl"`
|
|
URLTemplate string `json:"urlTemplate"`
|
|
ThumbnailURL string `json:"thumbnailUrl"`
|
|
ProxyMode string `json:"proxyMode"`
|
|
TimeoutMS int `json:"timeoutMs"`
|
|
RetryCount int `json:"retryCount"`
|
|
CacheSeconds int `json:"cacheSeconds"`
|
|
CheckIntervalSec int `json:"checkIntervalSec"`
|
|
Enabled bool `json:"enabled"`
|
|
ClientVisible bool `json:"clientVisible"`
|
|
SupportedFormats string `json:"supportedFormats"`
|
|
LastStatus string `json:"lastStatus"`
|
|
LastLatencyMS int `json:"lastLatencyMs"`
|
|
LastCheckedAt string `json:"lastCheckedAt"`
|
|
LastError string `json:"lastError"`
|
|
ConsecutiveFailure int `json:"consecutiveFailure"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
}
|
|
|
|
type SourceCheck struct {
|
|
ID int64 `json:"id"`
|
|
SourceID int64 `json:"sourceDbId"`
|
|
Status string `json:"status"`
|
|
LatencyMS int `json:"latencyMs"`
|
|
Error string `json:"error"`
|
|
CheckedAt string `json:"checkedAt"`
|
|
}
|
|
|
|
type SourceCall struct {
|
|
ID int64 `json:"id"`
|
|
SourceID string `json:"sourceId"`
|
|
Status string `json:"status"`
|
|
LatencyMS int `json:"latencyMs"`
|
|
Error string `json:"error"`
|
|
Client string `json:"client"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type AuditLog struct {
|
|
ID int64 `json:"id"`
|
|
Actor string `json:"actor"`
|
|
Type string `json:"type"`
|
|
Target string `json:"target"`
|
|
Message string `json:"message"`
|
|
IP string `json:"ip"`
|
|
UserAgent string `json:"userAgent"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type AuditFilters struct {
|
|
Page int
|
|
PerPage int
|
|
Type string
|
|
Target string
|
|
Query string
|
|
}
|
|
|
|
type AuditPage struct {
|
|
Items []AuditLog `json:"items"`
|
|
Total int `json:"total"`
|
|
Page int `json:"page"`
|
|
PerPage int `json:"perPage"`
|
|
}
|
|
|
|
type LegacyJsonRevision struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Raw string `json:"raw"`
|
|
Note string `json:"note"`
|
|
CreatedBy string `json:"createdBy"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|