Skip to content

LabelModel

Defined in: packages/core/src/models/label.ts:18

Data operations for label types and build labels.

new LabelModel(db, tables?): LabelModel

Defined in: packages/core/src/models/label.ts:26

DatabaseAdapter

Database adapter.

LabelTables

Table handles.

LabelModel

attach(projectId, buildId, typeKey, value): Promise<BuildLabel>

Defined in: packages/core/src/models/label.ts:126

Attach a label value to a build.

string

string

string

string

Promise<BuildLabel>


createType(projectId, input): Promise<LabelType>

Defined in: packages/core/src/models/label.ts:79

Create a custom label type for a project.

string

string

string

string

string

Promise<LabelType>


getType(projectId, key): Promise<LabelType | null>

Defined in: packages/core/src/models/label.ts:67

Fetch a label type by key, or null if not found.

string

string

Promise<LabelType | null>


hasPersistent(projectId, buildId): Promise<boolean>

Defined in: packages/core/src/models/label.ts:173

Whether a build is marked as persistent.

string

string

Promise<boolean>


latestBuildId(projectId, typeKey, value): Promise<string | null>

Defined in: packages/core/src/models/label.ts:150

Return the id of the latest build carrying a given label value, if any.

string

string

string

Promise<string | null>


listForBuild(buildId): Promise<BuildLabel[]>

Defined in: packages/core/src/models/label.ts:143

List all labels attached to a build.

string

Promise<BuildLabel[]>


listTypes(projectId): Promise<LabelType[]>

Defined in: packages/core/src/models/label.ts:60

List all label types for a project.

string

Promise<LabelType[]>


persistentBuildIds(projectId): Promise<Set<string>>

Defined in: packages/core/src/models/label.ts:178

Ids of the project’s builds marked persistent (exempt from retention).

string

Promise<Set<string>>


removeType(projectId, key): Promise<void>

Defined in: packages/core/src/models/label.ts:115

Remove a custom label type, rejecting reserved or persistent types.

string

string

Promise<void>


seedFor(projectId): Promise<void>

Defined in: packages/core/src/models/label.ts:40

Seed the default label types for a project if missing.

string

Project ID.

Promise<void>


updateType(projectId, key, input): Promise<LabelType | null>

Defined in: packages/core/src/models/label.ts:95

Update a custom label type’s name, template or color.

string

string

string | null

string | null

string

Promise<LabelType | null>