Entries are visible by kind: organization entries to the organization, account entries to the account, platform entries to admins. The built-in admin role gains the new audit.read permission. Refs #65 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
290 lines
5.3 KiB
Go
290 lines
5.3 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
|
|
package store
|
|
|
|
import (
|
|
"net/netip"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Agent struct {
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
Kind string
|
|
Name string
|
|
TokenHash []byte
|
|
Prefix string
|
|
LastSeenAt *time.Time
|
|
Release *string
|
|
CreatedAt time.Time
|
|
RegionID *uuid.UUID
|
|
}
|
|
|
|
type AgentStorage struct {
|
|
Owner string
|
|
Key string
|
|
Value []byte
|
|
Modified time.Time
|
|
}
|
|
|
|
type ApiToken struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
Name string
|
|
TokenHash []byte
|
|
Prefix string
|
|
Permissions []string
|
|
ExpiresAt *time.Time
|
|
LastUsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type AuditEvent struct {
|
|
ID uuid.UUID
|
|
Time time.Time
|
|
Kind string
|
|
OrgID *uuid.UUID
|
|
ActorUserID *uuid.UUID
|
|
ActorTokenID *uuid.UUID
|
|
Action string
|
|
TargetID *uuid.UUID
|
|
Details []byte
|
|
Status int32
|
|
Ip *netip.Addr
|
|
UserAgent *string
|
|
RequestID *string
|
|
}
|
|
|
|
type CheckResult struct {
|
|
Time time.Time
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
CheckerID uuid.UUID
|
|
Ok bool
|
|
LatencyMs *int32
|
|
StatusCode *int32
|
|
Error *string
|
|
}
|
|
|
|
type CheckResults1d struct {
|
|
Bucket interface{}
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
Total int64
|
|
OkCount int64
|
|
AvgLatencyMs float32
|
|
MaxLatencyMs interface{}
|
|
}
|
|
|
|
type CheckResults1h struct {
|
|
Bucket interface{}
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
Region string
|
|
Total int64
|
|
OkCount int64
|
|
AvgLatencyMs float32
|
|
MaxLatencyMs interface{}
|
|
}
|
|
|
|
type Incident struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
StartedAt time.Time
|
|
ResolvedAt *time.Time
|
|
Cause []byte
|
|
}
|
|
|
|
type Invitation struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Email string
|
|
RoleID uuid.UUID
|
|
TokenHash []byte
|
|
InvitedBy *uuid.UUID
|
|
ExpiresAt time.Time
|
|
AcceptedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Membership struct {
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
IsOwner bool
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Monitor struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Type string
|
|
Target string
|
|
IntervalSeconds int32
|
|
TimeoutMs int32
|
|
Config []byte
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
Confirmations int32
|
|
GroupID *uuid.UUID
|
|
}
|
|
|
|
type MonitorGroup struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
ParentID *uuid.UUID
|
|
Name string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type MonitorRegion struct {
|
|
MonitorID uuid.UUID
|
|
OrgID uuid.UUID
|
|
RegionID uuid.UUID
|
|
}
|
|
|
|
type Notification struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
ChannelID uuid.UUID
|
|
IncidentID uuid.UUID
|
|
Event string
|
|
Status string
|
|
Attempts int32
|
|
NextAttemptAt time.Time
|
|
LastError *string
|
|
CreatedAt time.Time
|
|
SentAt *time.Time
|
|
}
|
|
|
|
type NotificationChannel struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Type string
|
|
Config []byte
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type Org struct {
|
|
ID uuid.UUID
|
|
Slug string
|
|
Name string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
RequireTotp bool
|
|
RequireSso bool
|
|
ApiTokenMaxDays *int32
|
|
}
|
|
|
|
type RecoveryCode struct {
|
|
UserID uuid.UUID
|
|
CodeHash []byte
|
|
UsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Region struct {
|
|
Key string
|
|
Name string
|
|
CreatedAt time.Time
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
}
|
|
|
|
type Role struct {
|
|
ID uuid.UUID
|
|
OrgID *uuid.UUID
|
|
Key *string
|
|
Name string
|
|
Permissions []string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RoleAssignment struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
RoleID uuid.UUID
|
|
ResourceType *string
|
|
ResourceID *uuid.UUID
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type SsoProvider struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Name string
|
|
Issuer string
|
|
ClientID string
|
|
ClientSecret []byte
|
|
Scopes []string
|
|
AllowedDomains []string
|
|
AutoProvision bool
|
|
Enabled bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
DefaultRoleID *uuid.UUID
|
|
}
|
|
|
|
type StatusPage struct {
|
|
ID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Slug string
|
|
Title string
|
|
Description string
|
|
Published bool
|
|
CustomDomain *string
|
|
DomainToken string
|
|
DomainVerifiedAt *time.Time
|
|
Theme []byte
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type StatusPageMonitor struct {
|
|
PageID uuid.UUID
|
|
MonitorID uuid.UUID
|
|
OrgID uuid.UUID
|
|
Section string
|
|
Label string
|
|
Position int32
|
|
}
|
|
|
|
type User struct {
|
|
ID uuid.UUID
|
|
Email string
|
|
DisplayName string
|
|
PasswordHash *string
|
|
DisabledAt *time.Time
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
TotpSecret []byte
|
|
TotpEnabledAt *time.Time
|
|
Locale *string
|
|
IsAdmin bool
|
|
}
|
|
|
|
type UserIdentity struct {
|
|
ProviderID uuid.UUID
|
|
Subject string
|
|
OrgID uuid.UUID
|
|
UserID uuid.UUID
|
|
Email *string
|
|
CreatedAt time.Time
|
|
LastLoginAt time.Time
|
|
}
|