models

package
v0.49.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package models provides custom object definitions for the core api

Index

Constants

View Source
const (
	// DefaultRevision is the default revision to be used for new records
	DefaultRevision = "v0.0.1"
)
View Source
const (
	// MaxRunsInBetween defines how much time each job must have between runs
	// Maybe make this configurable or maybe we need to take this down to like
	// 5/10 minutes
	MaxRunsInBetween = 30 * time.Minute
)

Variables

View Source
var (
	ErrUnsupportedDateTimeType = errors.New("unsupported time format")
	ErrInvalidTimeType         = errors.New("invalid date format, expected YYYY-MM-DD or full ISO8601")
)
View Source
var (
	// ErrInvalidURL defines an invalid url
	ErrInvalidURL = errors.New("invalid url provided")
	// ErrLocalHostNotAllowed defines an error where a user tries to run ssl checks on a localhost address
	ErrLocalHostNotAllowed = errors.New("cannot use localhost url")
	// ErrNoLoopbackAddressAllowed defines an error when a user tries to use loopback address
	ErrNoLoopbackAddressAllowed = errors.New("no loopback address acceptable")
	// ErrUnsupportedJobConfig defines an error for a job type we do not support at the moment
	ErrUnsupportedJobConfig = errors.New("we do not support this job type")
	// ErrHTTPSOnlyURL defines an error where a non https url is being used for a ssl check
	ErrHTTPSOnlyURL = errors.New("you can only check ssl of a domain with https")
)

AllAuditLogOrderField contains all valid AuditLogOrderField values.

View Source
var (
	// ErrComputeNextRunInvalid is used to define an error when a weekly run cannot be
	// computed
	ErrComputeNextRunInvalid = errors.New("could not compute next run time in weekly cadence")
)
View Source
var ErrUnsupportedDataType = errors.New("unsupported aaguid format")

Functions

func BumpMajor added in v0.7.5

func BumpMajor(v string) (string, error)

BumpMajor increments the major version by 1 It resets the minor and patch versions to 0 For example if the version is v1.7.1 the new version will be v2.0.0 It resets the pre-release version to empty

func BumpMinor added in v0.7.5

func BumpMinor(v string) (string, error)

BumpMinor increments the minor version by 1 It resets the patch version to 0 For example if the version is v1.7.1 the new version will be v1.8.0 It resets the pre-release version to empty

func BumpPatch added in v0.7.5

func BumpPatch(v string) (string, error)

BumpPatch increments the patch version by 1 For example if the version is v1.7.1 the new version will be v1.7.2 If the version has a pre-release version, it clears the pre-release version

func SetPreRelease added in v0.7.5

func SetPreRelease(v string) (string, error)

SetPreRelease sets the pre-release version to "draft" For example if the version is v1.7.1 the new version will be v1.7.2-draft

func Sort added in v0.34.3

func Sort[T Sortable](items []T) []T

Sort a slice of Sortable items by their sort field

func ValidateIP added in v0.14.1

func ValidateIP(s string) error

ValidateIP takes in an ip address and checks if it is usable for a job runner node

func ValidateURL added in v0.15.0

func ValidateURL(s string) (string, error)

ValidateURL takes in url and makes sure it is a valid url - it must be https - it must not be localhost - it must not be a loopback address to our machine

func WithSSOAuthorizations added in v0.22.0

func WithSSOAuthorizations(ctx context.Context, auth *SSOAuthorizationMap) context.Context

WithSSOAuthorizations stores the SSOAuthorizations in the context

func WithVersionBumpContext added in v0.7.5

func WithVersionBumpContext(ctx context.Context, v *VersionBump) context.Context

WithVersionBumpContext adds the VersionBump to the context

func WithVersionBumpRequestContext added in v0.7.5

func WithVersionBumpRequestContext(ctx context.Context, v *VersionBump)

WithVersionBumpContext adds the VersionBump to the context

Types

type AAGUID added in v0.10.9

type AAGUID []byte

AAGUID is a custom type representing an authenticator attestation uuid.

func ToAAGUID added in v0.10.9

func ToAAGUID(b []byte) *AAGUID

func (AAGUID) MarshalGQL added in v0.10.9

func (a AAGUID) MarshalGQL(w io.Writer)

func (*AAGUID) Scan added in v0.10.9

func (a *AAGUID) Scan(value interface{}) error

func (AAGUID) String added in v0.10.9

func (a AAGUID) String() string

func (*AAGUID) UnmarshalGQL added in v0.10.9

func (a *AAGUID) UnmarshalGQL(v any) error

func (AAGUID) Value added in v0.10.9

func (a AAGUID) Value() (driver.Value, error)

type Address added in v0.6.6

type Address struct {
	// Line1 is the first line of the address
	Line1 string `json:"line1"`
	// Line2 is the second line of the address
	Line2 string `json:"line2"`
	// City is the city of the address
	City string `json:"city"`
	// State is the state of the address
	State string `json:"state"`
	// PostalCode is the postal code of the address
	PostalCode string `json:"postalCode"`
	// Country is the country of the address
	Country string `json:"country"`
}

Address is a custom type for Address

func (Address) MarshalGQL added in v0.6.6

func (a Address) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Address) String added in v0.6.6

func (a Address) String() string

String returns a string representation of the address

func (*Address) UnmarshalGQL added in v0.6.6

func (a *Address) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type AssessmentMethod added in v0.7.3

type AssessmentMethod struct {
	// ID is the unique identifier for the assessment method
	ID string `json:"id,omitempty"`
	// Type is the type of assessment being performed, e.g. Interview, Test, etc.
	Type string `json:"type,omitempty"`
	// Method is the associated language describing the assessment method
	Method string `json:"method,omitempty"`
}

AssessmentMethod are methods that can be used during the audit to assess the control implementation

func (AssessmentMethod) GetSortField added in v0.34.3

func (a AssessmentMethod) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (AssessmentMethod) MarshalGQL added in v0.7.3

func (a AssessmentMethod) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*AssessmentMethod) UnmarshalGQL added in v0.7.3

func (a *AssessmentMethod) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type AssessmentObjective added in v0.7.3

type AssessmentObjective struct {
	// Class is the class of the assessment objective which is typically what framework it origins from
	Class string `json:"class,omitempty"`
	// ID is the unique identifier for the assessment objective
	ID string `json:"id,omitempty"`
	// Objective is the associated language describing the assessment objective
	Objective string `json:"objective,omitempty" `
}

AssessmentObjective are objectives that are validated during the audit to ensure the control is implemented

func (AssessmentObjective) GetSortField added in v0.34.3

func (a AssessmentObjective) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (AssessmentObjective) MarshalGQL added in v0.7.3

func (a AssessmentObjective) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*AssessmentObjective) UnmarshalGQL added in v0.7.3

func (a *AssessmentObjective) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type AuditLogOrderField added in v0.17.0

type AuditLogOrderField string

Properties by which AuditLog connections can be ordered.

const (
	AuditLogOrderFieldHistoryTime AuditLogOrderField = "history_time"
)

func (AuditLogOrderField) IsValid added in v0.17.0

func (e AuditLogOrderField) IsValid() bool

IsValid checks if the AuditLogOrderField is valid.

func (AuditLogOrderField) MarshalGQL added in v0.17.0

func (e AuditLogOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (AuditLogOrderField) MarshalJSON added in v0.17.0

func (e AuditLogOrderField) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for AuditLogOrderField.

func (AuditLogOrderField) String added in v0.17.0

func (e AuditLogOrderField) String() string

String returns the string representation of the AuditLogOrderField.

func (*AuditLogOrderField) UnmarshalGQL added in v0.17.0

func (e *AuditLogOrderField) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

func (*AuditLogOrderField) UnmarshalJSON added in v0.17.0

func (e *AuditLogOrderField) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AuditLogOrderField.

type Change added in v0.17.0

type Change struct {
	// FieldName is the name of the field that changed.
	FieldName string
	// Old is the old value of the field.
	Old any
	// New is the new value of the field.
	New any
}

Change represents a change in an entity's field.

func (Change) MarshalGQL added in v0.17.0

func (c Change) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (*Change) UnmarshalGQL added in v0.17.0

func (c *Change) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type CredentialSet added in v0.33.3

type CredentialSet struct {
	// AccessKeyID for cloud providers
	AccessKeyID string `json:"accessKeyID"`
	// SecretAccessKey for cloud providers
	SecretAccessKey string `json:"secretAccessKey"`
	// ProjectID for GCS
	ProjectID string `json:"projectID"`
	// AccountID for Cloudflare R2
	AccountID string `json:"accountID"`
	// APIToken for Cloudflare R2
	APIToken string `json:"apiToken"`
	// ProviderData stores provider-specific metadata or attributes
	ProviderData map[string]any `json:"providerData,omitempty"`
	// OAuthAccessToken holds the OAuth access token when applicable
	OAuthAccessToken string `json:"oauthAccessToken,omitempty"`
	// OAuthRefreshToken holds the OAuth refresh token when applicable
	OAuthRefreshToken string `json:"oauthRefreshToken,omitempty"`
	// OAuthTokenType stores the OAuth token type (e.g., Bearer)
	OAuthTokenType string `json:"oauthTokenType,omitempty"`
	// OAuthExpiry stores the token expiry timestamp
	OAuthExpiry *time.Time `json:"oauthExpiry,omitempty"`
	// Claims stores serialized ID token claims if available
	Claims map[string]any `json:"claims,omitempty"`
}

CredentialSet is a custom type for pricing data

func (CredentialSet) MarshalGQL added in v0.33.3

func (c CredentialSet) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (CredentialSet) String added in v0.33.3

func (c CredentialSet) String() string

String returns a string representation of the CredentialSet with sensitive fields masked for logging

func (*CredentialSet) UnmarshalGQL added in v0.33.3

func (c *CredentialSet) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type Cron added in v0.15.0

type Cron string

Cron defines the syntax for the job execution

func (Cron) MarshalGQL added in v0.15.0

func (c Cron) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Cron) Next added in v0.15.0

func (c Cron) Next(from time.Time) (time.Time, error)

Next returns the next scheduled time after `from` based on the cron expression.

func (*Cron) Scan added in v0.15.0

func (c *Cron) Scan(value interface{}) error

func (Cron) String added in v0.15.0

func (c Cron) String() string

String returns a string representation of the cron

func (*Cron) UnmarshalGQL added in v0.15.0

func (c *Cron) UnmarshalGQL(v any) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (Cron) Validate added in v0.15.0

func (c Cron) Validate() error

Validate checks a cron to make sure it is valid . It also limits concurrent runs to 30 minutes interval of the last run so it parses the cron - look at next few executions and check the elapsed time

func (Cron) Value added in v0.15.0

func (c Cron) Value() (driver.Value, error)

Value returns human readable cron from the database

type DateTime added in v0.10.2

type DateTime time.Time

DateTime is a custom GraphQL scalar that converts to/from time.Time

func ToDateTime added in v0.10.2

func ToDateTime(s string) (*DateTime, error)

ToDateTime converts a string to a DateTime pointer. It accepts both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ" formats. Returns an error if the string is empty or in an invalid format.

func (DateTime) IsZero added in v0.15.1

func (d DateTime) IsZero() bool

IsZero checks if the DateTime is zero (equivalent to time.Time.IsZero)

func (DateTime) MarshalGQL added in v0.10.2

func (d DateTime) MarshalGQL(w io.Writer)

MarshalGQL writes the datetime as "YYYY-MM-DD"

func (DateTime) MarshalJSON added in v0.15.1

func (d DateTime) MarshalJSON() ([]byte, error)

MarshalJSON formats the DateTime as a JSON string

func (DateTime) MarshalText added in v0.15.1

func (d DateTime) MarshalText() ([]byte, error)

MarshalText formats the DateTime as "YYYY-MM-DD" for text representation this function is used by the cursor pagination to correctly format the date into the cursor string

func (*DateTime) Scan added in v0.10.2

func (d *DateTime) Scan(value interface{}) error

Scan implements the sql.Scanner interface for DateTime

func (DateTime) String added in v0.10.2

func (d DateTime) String() string

String formats the given datetime into a human readable version

func (*DateTime) UnmarshalCSV added in v0.10.2

func (d *DateTime) UnmarshalCSV(s string) error

UnmarshalCSV allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"

func (*DateTime) UnmarshalGQL added in v0.10.2

func (d *DateTime) UnmarshalGQL(v any) error

UnmarshalGQL allows the DateTime to accept both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ"

func (*DateTime) UnmarshalJSON added in v0.15.1

func (d *DateTime) UnmarshalJSON(b []byte) error

UnmarshalJSON parses the DateTime from a JSON string it accepts both "YYYY-MM-DD" and "YYYY-MM-DDTHH:MM:SSZ" formats and returns an error if the format is invalid

func (*DateTime) UnmarshalText added in v0.15.1

func (d *DateTime) UnmarshalText(b []byte) error

UnmarshalText parses the DateTime from a byte slice this function is used by the cursor pagination to correctly parse the date from the cursor string

func (DateTime) Value added in v0.10.2

func (d DateTime) Value() (driver.Value, error)

Value implements the driver.Valuer interface for DateTime

type Days added in v0.15.0

type Days []enums.JobWeekday

Days is used to provide a human readable version of weekdays

type ExampleEvidence added in v0.7.3

type ExampleEvidence struct {
	// DocumentationType is the documentation artifact type for the example evidence
	DocumentationType string `json:"documentationType,omitempty"`
	// Description is the description of the example documentation artifact for the evidence
	Description string `json:"description,omitempty"`
}

ExampleEvidence is example evidence that can be used to satisfy the control

func (ExampleEvidence) GetSortField added in v0.34.3

func (e ExampleEvidence) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (ExampleEvidence) MarshalGQL added in v0.7.3

func (e ExampleEvidence) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*ExampleEvidence) UnmarshalGQL added in v0.7.3

func (e *ExampleEvidence) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type ImplementationGuidance added in v0.7.3

type ImplementationGuidance struct {
	// ReferenceID is the unique identifier for where the guidance was sourced from
	ReferenceID string `json:"referenceId,omitempty"`
	// Guidance are the steps to take to implement the control
	Guidance []string `json:"guidance,omitempty"`
}

ImplementationGuidance is the steps to take to implement the control they can come directly from the control source or pulled from external sources if the reference id matches the control ref code, the guidance is directly from the control if the reference id is different, the guidance is from an external source

func (ImplementationGuidance) GetSortField added in v0.34.3

func (i ImplementationGuidance) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (ImplementationGuidance) MarshalGQL added in v0.7.3

func (i ImplementationGuidance) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*ImplementationGuidance) UnmarshalGQL added in v0.7.3

func (i *ImplementationGuidance) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type JobCadence added in v0.15.0

type JobCadence struct {
	Days      Days                      `json:"days,omitempty"`
	Time      string                    `json:"time,omitempty"`
	Frequency enums.JobCadenceFrequency `json:"frequency,omitempty"`
}

JobCadence defines the logic for the execution of a job

func (JobCadence) IsZero added in v0.15.0

func (c JobCadence) IsZero() bool

IsZero checks if the cadence is not set yet

func (JobCadence) MarshalGQL added in v0.15.0

func (c JobCadence) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (JobCadence) Next added in v0.15.0

func (c JobCadence) Next(from time.Time) (time.Time, error)

Next calculates the next execution time for a JobCadence

func (JobCadence) String added in v0.15.0

func (c JobCadence) String() string

String marshals the cadence into a human readable version

func (*JobCadence) UnmarshalGQL added in v0.15.0

func (c *JobCadence) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (*JobCadence) Validate added in v0.15.0

func (c *JobCadence) Validate() error

Validate makes sure we have a usable job cadence setting

type JobConfiguration added in v0.15.0

type JobConfiguration json.RawMessage

JobConfiguration allows users configure the parameters that will be templated into their scripts that runs in the automated jobs

func (JobConfiguration) MarshalGQL added in v0.15.0

func (job JobConfiguration) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (JobConfiguration) MarshalJSON added in v0.23.4

func (job JobConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*JobConfiguration) UnmarshalGQL added in v0.15.0

func (job *JobConfiguration) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (*JobConfiguration) UnmarshalJSON added in v0.23.4

func (job *JobConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type OrgModule added in v0.23.0

type OrgModule string

OrgModule identifies a purchasable module

const (
	CatalogBaseModule                    OrgModule = "base_module"
	CatalogComplianceModule              OrgModule = "compliance_module"
	CatalogDomainScanningAddon           OrgModule = "domain_scanning_addon"
	CatalogEntityManagementModule        OrgModule = "entity_management_module"
	CatalogExtraEvidenceStorageAddon     OrgModule = "extra_evidence_storage_addon"
	CatalogPolicyManagementAddon         OrgModule = "policy_management_addon"
	CatalogRiskManagementAddon           OrgModule = "risk_management_addon"
	CatalogTrustCenterModule             OrgModule = "trust_center_module"
	CatalogVulnerabilityManagementModule OrgModule = "vulnerability_management_module"
)

func (OrgModule) IsValid added in v0.23.0

func (m OrgModule) IsValid() bool

IsValid reports whether m is a known module constant

func (OrgModule) MarshalGQL added in v0.23.0

func (m OrgModule) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (OrgModule) MarshalText added in v0.23.0

func (m OrgModule) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (OrgModule) String added in v0.23.0

func (m OrgModule) String() string

String returns the string representation of the OrgModule

func (*OrgModule) UnmarshalGQL added in v0.23.0

func (m *OrgModule) UnmarshalGQL(v any) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*OrgModule) UnmarshalText added in v0.23.0

func (m *OrgModule) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type Price added in v0.6.7

type Price struct {
	// Amount is the dollar amount of the price (e.g 100)
	Amount float64 `json:"amount"`
	// Interval is the interval of the price (e.g monthly, yearly)
	Interval string `json:"interval"`
	// Currency is the currency of the price that is being charged (e.g USD)
	Currency string `json:"currency"`
}

Price is a custom type for pricing data

func (Price) MarshalGQL added in v0.6.7

func (p Price) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (Price) String added in v0.6.7

func (p Price) String() string

String returns a string representation of the price

func (*Price) UnmarshalGQL added in v0.6.7

func (p *Price) UnmarshalGQL(v interface{}) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

type Reference added in v0.7.3

type Reference struct {
	// Name is the name of the reference
	Name string `json:"name,omitempty"`
	// URL is the link to the reference
	URL string `json:"url,omitempty"`
}

Reference are links to external sources that can be used to gain more information about the control

func (Reference) GetSortField added in v0.34.3

func (r Reference) GetSortField() string

GetSortField returns the field to sort on for the Sortable interface

func (Reference) MarshalGQL added in v0.7.3

func (r Reference) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen

func (*Reference) UnmarshalGQL added in v0.7.3

func (r *Reference) UnmarshalGQL(v any) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen

type SSOAuthorizationMap added in v0.22.0

type SSOAuthorizationMap map[string]time.Time

SSOAuthorizationMap tracks SSO verification timestamps per organization ID.

func SSOAuthorizationsFromContext added in v0.22.0

func SSOAuthorizationsFromContext(ctx context.Context) (*SSOAuthorizationMap, bool)

SSOAuthorizationsFromContext retrieves SSOAuthorizations from the context

func (SSOAuthorizationMap) MarshalGQL added in v0.22.0

func (m SSOAuthorizationMap) MarshalGQL(w io.Writer)

MarshalGQL implements the gqlgen Marshaler interface.

func (*SSOAuthorizationMap) UnmarshalGQL added in v0.22.0

func (m *SSOAuthorizationMap) UnmarshalGQL(v any) error

UnmarshalGQL implements the gqlgen Unmarshaler interface.

type SearchContext added in v0.38.1

type SearchContext struct {
	EntityID      string           `json:"entityID"`
	EntityType    string           `json:"entityType"`
	MatchedFields []string         `json:"matchedFields"`
	Snippets      []*SearchSnippet `json:"snippets,omitempty"`
}

SearchContext provides information about why a particular entity matched the search query

type SearchSnippet added in v0.38.1

type SearchSnippet struct {
	Field string `json:"field"`
	Text  string `json:"text"`
}

SearchSnippet represents a piece of matched content with surrounding context

type SemverVersion added in v0.7.5

type SemverVersion struct {
	// Major is the major version
	Major int `json:"major,omitempty"`
	// Minor is the minor version
	Minor int `json:"minor,omitempty"`
	// Patch is the patch version
	Patch int `json:"patch,omitempty"`
	// PreRelease is the pre-release version (used for draft versions)
	PreRelease string `json:"preRelease,omitempty"`
}

SemverVersion is a custom type for semantic versioning It is used to represent the version of objects stored in the database

func ToSemverVersion added in v0.7.5

func ToSemverVersion(version *string) (*SemverVersion, error)

ToSemverVersion converts a string to a SemverVersion It parses the string and returns a SemverVersion object It supports the following formats: - v1.0.0 - 1.0.0 - v1.0.0-alpha - 1.0.0-alpha anything after the first "-" is considered a pre-release version

func (*SemverVersion) BumpPatchSemver added in v0.7.5

func (s *SemverVersion) BumpPatchSemver()

BumpPatch increments the patch version by 1 For example if the version is v1.7.1 the new version will be v1.7.2 It resets the pre-release version to empty

func (SemverVersion) String added in v0.7.5

func (s SemverVersion) String() string

String returns a string representation of the version

type Sortable added in v0.34.3

type Sortable interface {
	GetSortField() string
}

type VersionBump added in v0.7.5

type VersionBump string

VersionBump is a custom type for version bumping It is used to represent the type of version bumping

var (
	// Major is the major version
	Major VersionBump = "MAJOR"
	// Minor is the minor version
	Minor VersionBump = "MINOR"
	// Patch is the patch version
	Patch VersionBump = "PATCH"
	// PreRelease is the pre-release version
	PreRelease VersionBump = "DRAFT"
)

func ToVersionBump added in v0.8.3

func ToVersionBump(r string) *VersionBump

ToVersionBump returns the version bump enum based on string input

func VersionBumpFromContext added in v0.7.5

func VersionBumpFromContext(ctx context.Context) (*VersionBump, bool)

VersionBumpFromContext returns the VersionBump from the context

func VersionBumpFromRequestContext added in v0.7.5

func VersionBumpFromRequestContext(ctx context.Context) (*VersionBump, bool)

VersionBumpFromContext returns the VersionBump from the context

func (VersionBump) MarshalGQL added in v0.7.5

func (v VersionBump) MarshalGQL(w io.Writer)

MarshalGQL implement the Marshaler interface for gqlgen

func (VersionBump) String added in v0.7.5

func (v VersionBump) String() string

String returns the role as a string

func (*VersionBump) UnmarshalGQL added in v0.7.5

func (v *VersionBump) UnmarshalGQL(a any) error

UnmarshalGQL implement the Unmarshaler interface for gqlgen

func (VersionBump) Values added in v0.7.5

func (VersionBump) Values() (kinds []string)

Values returns a slice of strings that represents all the possible values of the VersionBump enum. Possible default values are "MAJOR", "MINOR", "PATCH", "DRAFT"

type WorkflowAction added in v0.46.3

type WorkflowAction struct {
	Key         string          `json:"key,omitempty"`    // unique key within the workflow
	Type        string          `json:"type,omitempty"`   // action type, e.g. REQUEST_APPROVAL, NOTIFY
	Params      json.RawMessage `json:"params,omitempty"` // opaque config for the action
	Description string          `json:"description,omitempty"`
}

WorkflowAction represents an action performed by the workflow.

type WorkflowAssignmentContext added in v0.46.3

type WorkflowAssignmentContext struct {
	AssignmentKey string                         `json:"assignmentKey,omitempty"`
	Status        enums.WorkflowAssignmentStatus `json:"status,omitempty"`
	ActorUserID   string                         `json:"actorUserId,omitempty"`
	ActorGroupID  string                         `json:"actorGroupId,omitempty"`
	DecidedAt     *time.Time                     `json:"decidedAt,omitempty"`
	Notes         string                         `json:"notes,omitempty"`
}

WorkflowAssignmentContext tracks an assignment decision within an instance.

type WorkflowCondition added in v0.46.3

type WorkflowCondition struct {
	Expression  string `json:"expression,omitempty"`
	Description string `json:"description,omitempty"`
}

WorkflowCondition describes a CEL condition that must pass.

type WorkflowDefinitionDocument added in v0.46.3

type WorkflowDefinitionDocument struct {
	Name         string                 `json:"name,omitempty"`
	Description  string                 `json:"description,omitempty"`
	SchemaType   string                 `json:"schemaType,omitempty"`
	WorkflowKind enums.WorkflowKind     `json:"workflowKind,omitempty"`
	Version      string                 `json:"version,omitempty"`
	Targets      WorkflowSelector       `json:"targets,omitempty"`
	Triggers     []WorkflowTrigger      `json:"triggers,omitempty"`
	Conditions   []WorkflowCondition    `json:"conditions,omitempty"`
	Actions      []WorkflowAction       `json:"actions,omitempty"`
	Metadata     map[string]interface{} `json:"metadata,omitempty"`
}

WorkflowDefinitionDocument represents the stored workflow definition with typed fields.

func (WorkflowDefinitionDocument) MarshalGQL added in v0.46.3

func (d WorkflowDefinitionDocument) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowDefinitionDocument) UnmarshalGQL added in v0.46.3

func (d *WorkflowDefinitionDocument) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowDefinitionSchema added in v0.46.3

type WorkflowDefinitionSchema struct {
	Version string          `json:"version,omitempty"`
	Schema  json.RawMessage `json:"schema,omitempty"` // optional JSONSchema for validation
}

WorkflowDefinitionSchema represents a template schema for definitions.

func (WorkflowDefinitionSchema) MarshalGQL added in v0.46.3

func (d WorkflowDefinitionSchema) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowDefinitionSchema) UnmarshalGQL added in v0.46.3

func (d *WorkflowDefinitionSchema) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowEventPayload added in v0.46.3

type WorkflowEventPayload struct {
	EventType enums.WorkflowEventType `json:"eventType,omitempty"`
	ActionKey string                  `json:"actionKey,omitempty"`
	Details   json.RawMessage         `json:"details,omitempty"`
}

WorkflowEventPayload stores workflow event payloads.

func (WorkflowEventPayload) MarshalGQL added in v0.46.3

func (p WorkflowEventPayload) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowEventPayload) UnmarshalGQL added in v0.46.3

func (p *WorkflowEventPayload) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowInstanceContext added in v0.46.3

type WorkflowInstanceContext struct {
	WorkflowDefinitionID string                      `json:"workflowDefinitionId,omitempty"`
	ObjectType           enums.WorkflowObjectType    `json:"objectType,omitempty"`
	ObjectID             string                      `json:"objectId,omitempty"`
	Version              int                         `json:"version,omitempty"`
	Assignments          []WorkflowAssignmentContext `json:"assignments,omitempty"`
	Data                 json.RawMessage             `json:"data,omitempty"` // optional payload captured at runtime
}

WorkflowInstanceContext holds runtime context for a workflow instance.

func (WorkflowInstanceContext) MarshalGQL added in v0.46.3

func (c WorkflowInstanceContext) MarshalGQL(w io.Writer)

MarshalGQL implements the Marshaler interface for gqlgen.

func (*WorkflowInstanceContext) UnmarshalGQL added in v0.46.3

func (c *WorkflowInstanceContext) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the Unmarshaler interface for gqlgen.

type WorkflowSelector added in v0.46.3

type WorkflowSelector struct {
	TagIDs      []string                   `json:"tagIds,omitempty"`
	GroupIDs    []string                   `json:"groupIds,omitempty"`
	ObjectTypes []enums.WorkflowObjectType `json:"objectTypes,omitempty"`
}

WorkflowSelector scopes workflows to tags, groups, or object types.

type WorkflowTrigger added in v0.46.3

type WorkflowTrigger struct {
	Operation   string                   `json:"operation,omitempty"`   // e.g. CREATE, UPDATE, DELETE
	ObjectType  enums.WorkflowObjectType `json:"objectType,omitempty"`  // schema/object type the trigger targets
	Fields      []string                 `json:"fields,omitempty"`      // specific fields that should trigger evaluation
	Selector    WorkflowSelector         `json:"selector,omitempty"`    // scoping for tags/groups/objects
	Expression  string                   `json:"expression,omitempty"`  // optional CEL expression
	Description string                   `json:"description,omitempty"` // human friendly description
}

WorkflowTrigger describes when to run a workflow.

Jump to

Keyboard shortcuts

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