models

package
v0.0.0-...-677aae0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminProjectsWithMembers

type AdminProjectsWithMembers struct {
	Projects
	Members []ProjectMembersWithUserData `json:"members"`
}

type Audit

type Audit struct {
	bun.BaseModel `bun:"table:audit"`

	ID        uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ProjectID string    `bun:"project_id,type:text,notnull" json:"project_id"`
	UserID    string    `bun:"user_id,type:text,notnull" json:"user_id"`
	Operation string    `bun:"operation,type:text,notnull" json:"operation"`
	Details   string    `bun:"details,type:text,default:''" json:"details"`
	CreatedAt time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
}

type AuditWithUser

type AuditWithUser struct {
	bun.BaseModel `bun:"table:audit"`

	ID        uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ProjectID string    `bun:"project_id,type:text,notnull" json:"project_id"`
	UserID    string    `bun:"user_id,type:text,notnull" json:"user_id"`
	Operation string    `bun:"operation,type:text,notnull" json:"operation"`
	Details   string    `bun:"details,type:text,default:''" json:"details"`
	CreatedAt time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	Username  string    `bun:"username,type:text" json:"username"`
	Email     string    `bun:"email,type:text" json:"email"`
	Role      string    `bun:"role,type:text" json:"role"`
}

type ExecutionSteps

type ExecutionSteps struct {
	shared_models.ExecutionSteps
}

type ExecutionWithSteps

type ExecutionWithSteps struct {
	Executions
	Steps []ExecutionSteps `json:"steps"`
}

type Executions

type Executions struct {
	shared_models.Executions

	ScheduledAt time.Time `bun:"scheduled_at,type:timestamptz" json:"scheduled_at"`
	TriggeredBy string    `bun:"triggered_by,type:text,default:'user'" json:"triggered_by"`
}

type Flows

type Flows struct {
	shared_models.Flows

	FolderID           string `bun:"folder_id,type:text,default:''" json:"folder_id"`
	ScheduleEveryValue int    `bun:"schedule_every_value,type:integer,default:0" json:"schedule_every_value"`
	ScheduleEveryUnit  string `bun:"schedule_every_unit,type:text,default:''" json:"schedule_every_unit"`
}

type Folders

type Folders struct {
	bun.BaseModel `bun:"table:folders"`

	ID          uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name        string    `bun:"name,type:text,notnull" json:"name"`
	Description string    `bun:"description,type:text,default:''" json:"description"`
	ParentID    string    `bun:"parent_id,type:text,default:''" json:"parent_id"`
	ProjectID   string    `bun:"project_id,type:text,default:''" json:"project_id"`
	CreatedAt   time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
}

type IncExpireTokenRequest

type IncExpireTokenRequest struct {
	ExpiresIn   int    `json:"expires_in"`
	Description string `json:"description"`
}

type JWTClaim

type JWTClaim struct {
	ID   uuid.UUID `json:"id"`
	Type string    `json:"type"`
	jwt.RegisteredClaims
}

type JWTProjectClaim

type JWTProjectClaim struct {
	ProjectID string    `json:"project_id"`
	ID        uuid.UUID `json:"id"`
	Type      string    `json:"type"`
	jwt.RegisteredClaims
}

type JWTProjectRunnerClaim

type JWTProjectRunnerClaim struct {
	RunnerID  string    `json:"runner_id"`
	ProjectID string    `json:"project_id"`
	ID        uuid.UUID `json:"id"`
	Type      string    `json:"type"`
	jwt.RegisteredClaims
}

type Notifications

type Notifications struct {
	bun.BaseModel `bun:"table:notifications"`

	ID         uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	UserID     string    `bun:"user_id,type:text,notnull" json:"user_id"`
	Title      string    `bun:"title,type:text,notnull" json:"title"`
	Body       string    `bun:"body,type:text,default:''" json:"body"`
	IsRead     bool      `bun:"is_read,type:bool,default:false" json:"is_read"`
	IsArchived bool      `bun:"is_archived,type:bool,default:false" json:"is_archived"`
	Icon       string    `bun:"icon,type:text,default:''" json:"icon"`
	Color      string    `bun:"color,type:text,default:'primary'" json:"color"`
	Link       string    `bun:"link,type:text,default:''" json:"link"`
	LinkText   string    `bun:"link_text,type:text,default:''" json:"link_text"`
	CreatedAt  time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
}

type PlanCountStats

type PlanCountStats struct {
	Plan  string `json:"plan"`
	Count int    `json:"count"`
}

type ProjectMembers

type ProjectMembers struct {
	bun.BaseModel `bun:"table:project_members"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	UserID         string    `bun:"user_id,type:text,notnull" json:"user_id"`
	ProjectID      string    `bun:"project_id,type:text,notnull" json:"project_id"`
	Role           string    `bun:"role,type:text,notnull" json:"role"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	InvitePending  bool      `bun:"invite_pending,type:bool,default:false" json:"invite_pending"`
	InvitedAt      time.Time `bun:"invited_at,type:timestamptz,default:now()" json:"invited_at"`
}

type ProjectMembersWithUserData

type ProjectMembersWithUserData struct {
	bun.BaseModel `bun:"table:project_members"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	UserID         string    `bun:"user_id,type:text,notnull" json:"user_id"`
	ProjectID      string    `bun:"project_id,type:text,notnull" json:"project_id"`
	Role           string    `bun:"role,type:text,notnull" json:"role"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	InvitePending  bool      `bun:"invite_pending,type:bool,default:false" json:"invite_pending"`
	InvitedAt      time.Time `bun:"invited_at,type:timestamptz,default:now()" json:"invited_at"`
	Username       string    `bun:"username,type:text" json:"username"`
	Email          string    `bun:"email,type:text" json:"email"`
}

type Projects

type Projects struct {
	bun.BaseModel `bun:"table:projects"`

	ID                  uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Name                string    `bun:"name,type:text,notnull" json:"name"`
	Description         string    `bun:"description,type:text,default:''" json:"description"`
	SharedRunners       bool      `bun:"shared_runners,type:bool,default:false" json:"shared_runners"`
	Color               string    `bun:"color,type:text,default:''" json:"color"`
	Icon                string    `bun:"icon,type:text,default:''" json:"icon"`
	Disabled            bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason      string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt           time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	EnableAutoRunners   bool      `bun:"enable_auto_runners,type:bool,default:false" json:"enable_auto_runners"`
	DisableRunnerJoin   bool      `bun:"disable_runner_join,type:bool,default:false" json:"disable_runner_join"`
	RunnerAutoJoinToken string    `bun:"runner_auto_join_token,type:text,notnull" json:"runner_auto_join_token"`
}

type ProjectsWithMembers

type ProjectsWithMembers struct {
	Projects
	Members []ProjectMembers `json:"members"`
}

type RoleCountStats

type RoleCountStats struct {
	Role  string `json:"role"`
	Count int    `json:"count"`
}

type Runners

type Runners struct {
	shared_models.Runners
}

type Settings

type Settings struct {
	bun.BaseModel `bun:"table:settings"`

	ID                        int    `bun:"id,type:integer,pk,default:1" json:"id"`
	Maintenance               bool   `bun:"maintenance,type:bool,default:false" json:"maintenance"`
	SignUp                    bool   `bun:"signup,type:bool,default:true" json:"signup"`
	CreateProjects            bool   `bun:"create_projects,type:bool,default:true" json:"create_projects"`
	CreateFlows               bool   `bun:"create_flows,type:bool,default:true" json:"create_flows"`
	CreateRunners             bool   `bun:"create_runners,type:bool,default:true" json:"create_runners"`
	CreateApiKeys             bool   `bun:"create_api_keys,type:bool,default:true" json:"create_api_keys"`
	AddProjectMembers         bool   `bun:"add_project_members,type:bool,default:true" json:"add_project_members"`
	AddFlowActions            bool   `bun:"add_flow_actions,type:bool,default:true" json:"add_flow_actions"`
	StartExecutions           bool   `bun:"start_executions,type:bool,default:true" json:"start_executions"`
	AllowSharedRunnerAutoJoin bool   `bun:"allow_shared_runner_auto_join,type:bool,default:true" json:"allow_shared_runner_auto_join"`
	AllowSharedRunnerJoin     bool   `bun:"allow_shared_runner_join,type:bool,default:true" json:"allow_shared_runner_join"`
	SharedRunnerAutoJoinToken string `bun:"shared_runner_auto_join_token,type:text,default:''" json:"shared_runner_auto_join_token"`
}

type Stats

type Stats struct {
	Key   string `json:"key"`
	Value int    `json:"value"`
}

type StatsExecutions

type StatsExecutions struct {
	Key        string `json:"key"`
	Executions int    `json:"executions"`
}

type StatsExecutionsTotals

type StatsExecutionsTotals struct {
	ExecutionCount int   `json:"total_executions"`
	ExecutionTrend Trend `json:"execution_trend"`
}

type Tokens

type Tokens struct {
	bun.BaseModel `bun:"table:tokens"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	ProjectID      string    `bun:"project_id,type:text,default:''" json:"project_id"`
	Key            string    `bun:"key,type:text,notnull" json:"key"`
	Description    string    `bun:"description,type:text,default:''" json:"description"`
	Type           string    `bun:"type,type:text,notnull" json:"type"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt      time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	ExpiresAt      time.Time `bun:"expires_at,type:timestamptz" json:"expires_at"`
	UserID         string    `bun:"user_id,type:text,default:''" json:"user_id"`
}

type Trend

type Trend struct {
	Direction  string  `json:"direction"`
	Percentage float64 `json:"percentage"`
}

type Users

type Users struct {
	bun.BaseModel `bun:"table:users"`

	ID             uuid.UUID `bun:",pk,type:uuid,default:gen_random_uuid()" json:"id"`
	Username       string    `bun:"username,type:text,notnull" json:"username"`
	Email          string    `bun:"email,type:text,notnull" json:"email"`
	EmailVerified  bool      `bun:"email_verified,type:bool,default:false" json:"email_verified"`
	Welcomed       bool      `bun:"welcomed,type:bool,default:false" json:"welcomed"`
	Password       string    `bun:"password,type:text,notnull" json:"password"`
	Role           string    `bun:"role,type:text,notnull,default:'user'" json:"role"`
	Disabled       bool      `bun:"disabled,type:bool,default:false" json:"disabled"`
	DisabledReason string    `bun:"disabled_reason,type:text,default:''" json:"disabled_reason"`
	CreatedAt      time.Time `bun:"created_at,type:timestamptz,default:now()" json:"created_at"`
	UpdatedAt      time.Time `bun:"updated_at,type:timestamptz" json:"updated_at"`
}

func (*Users) CheckPassword

func (user *Users) CheckPassword(providedPassword string) error

func (*Users) HashPassword

func (user *Users) HashPassword(password string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL