fix(config): validate state changes
This commit is contained in:
parent
272a566acb
commit
9a69044e18
|
@ -18,5 +18,4 @@ export interface ChangeSet
|
|||
| --- | --- | --- |
|
||||
| [adds](./cautious-journey.changeset.adds.md) | Array<LabelRef> | |
|
||||
| [removes](./cautious-journey.changeset.removes.md) | Array<LabelRef> | |
|
||||
| [requires](./cautious-journey.changeset.requires.md) | Array<LabelRef> | Required labels for this state change to occur. |
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [cautious-journey](./cautious-journey.md) > [ChangeSet](./cautious-journey.changeset.md) > [requires](./cautious-journey.changeset.requires.md)
|
||||
|
||||
## ChangeSet.requires property
|
||||
|
||||
Required labels for this state change to occur.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
requires: Array<LabelRef>;
|
||||
```
|
|
@ -9,5 +9,5 @@ State changes that could occur to this value.
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
becomes: Array<ChangeSet>;
|
||||
becomes: Array<StateChange>;
|
||||
```
|
||||
|
|
|
@ -9,13 +9,13 @@ One of many values for a particular state.
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface StateValue extends BaseLabel, ChangeSet
|
||||
export interface StateValue extends BaseLabel
|
||||
```
|
||||
<b>Extends:</b> BaseLabel, [ChangeSet](./cautious-journey.changeset.md)
|
||||
<b>Extends:</b> BaseLabel
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [becomes](./cautious-journey.statevalue.becomes.md) | Array<[ChangeSet](./cautious-journey.changeset.md)<!-- -->> | State changes that could occur to this value. |
|
||||
| [becomes](./cautious-journey.statevalue.becomes.md) | Array<StateChange> | State changes that could occur to this value. |
|
||||
|
||||
|
|
|
@ -42,6 +42,18 @@ definitions:
|
|||
- $ref: "#/definitions/change-set"
|
||||
- $ref: "#/definitions/base-label"
|
||||
|
||||
state-change:
|
||||
allOf:
|
||||
- $ref: "#/definitions/change-set"
|
||||
- type: object
|
||||
required:
|
||||
- matches
|
||||
properties:
|
||||
matches:
|
||||
items:
|
||||
$ref: "#/definitions/label-ref"
|
||||
|
||||
|
||||
state-label:
|
||||
allOf:
|
||||
- $ref: "#/definitions/change-set"
|
||||
|
@ -62,6 +74,8 @@ definitions:
|
|||
properties:
|
||||
becomes:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/state-change"
|
||||
default: []
|
||||
|
||||
config:
|
||||
|
@ -74,7 +88,6 @@ definitions:
|
|||
type: string
|
||||
name:
|
||||
type: string
|
||||
|
||||
projects:
|
||||
type: array
|
||||
items:
|
||||
|
|
|
@ -16,11 +16,6 @@ export interface LabelRef {
|
|||
export interface ChangeSet {
|
||||
adds: Array<LabelRef>;
|
||||
removes: Array<LabelRef>;
|
||||
|
||||
/**
|
||||
* Required labels for this state change to occur.
|
||||
*/
|
||||
requires: Array<LabelRef>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,6 +41,11 @@ export interface BaseLabel extends ChangeSet {
|
|||
* Label priority.
|
||||
*/
|
||||
priority: number;
|
||||
|
||||
/**
|
||||
* Required labels for this state change to occur.
|
||||
*/
|
||||
requires: Array<LabelRef>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,14 +53,18 @@ export interface BaseLabel extends ChangeSet {
|
|||
*/
|
||||
export type FlagLabel = BaseLabel;
|
||||
|
||||
export interface StateChange extends ChangeSet {
|
||||
matches: Array<LabelRef>;
|
||||
}
|
||||
|
||||
/**
|
||||
* One of many values for a particular state.
|
||||
*/
|
||||
export interface StateValue extends BaseLabel, ChangeSet {
|
||||
export interface StateValue extends BaseLabel {
|
||||
/**
|
||||
* State changes that could occur to this value.
|
||||
*/
|
||||
becomes: Array<ChangeSet>;
|
||||
becomes: Array<StateChange>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue