diff --git a/docs/api/cautious-journey.changeset.md b/docs/api/cautious-journey.changeset.md index 37454de..6a51285 100644 --- a/docs/api/cautious-journey.changeset.md +++ b/docs/api/cautious-journey.changeset.md @@ -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. | diff --git a/docs/api/cautious-journey.changeset.requires.md b/docs/api/cautious-journey.changeset.requires.md deleted file mode 100644 index a32fa7c..0000000 --- a/docs/api/cautious-journey.changeset.requires.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[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. - -Signature: - -```typescript -requires: Array; -``` diff --git a/docs/api/cautious-journey.statevalue.becomes.md b/docs/api/cautious-journey.statevalue.becomes.md index 391d6c4..8d5918c 100644 --- a/docs/api/cautious-journey.statevalue.becomes.md +++ b/docs/api/cautious-journey.statevalue.becomes.md @@ -9,5 +9,5 @@ State changes that could occur to this value. Signature: ```typescript -becomes: Array; +becomes: Array; ``` diff --git a/docs/api/cautious-journey.statevalue.md b/docs/api/cautious-journey.statevalue.md index 7162a9c..dfe5c72 100644 --- a/docs/api/cautious-journey.statevalue.md +++ b/docs/api/cautious-journey.statevalue.md @@ -9,13 +9,13 @@ One of many values for a particular state. Signature: ```typescript -export interface StateValue extends BaseLabel, ChangeSet +export interface StateValue extends BaseLabel ``` -Extends: BaseLabel, [ChangeSet](./cautious-journey.changeset.md) +Extends: 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. | diff --git a/src/config/schema.yml b/src/config/schema.yml index b0b35c8..cd48ee2 100644 --- a/src/config/schema.yml +++ b/src/config/schema.yml @@ -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: diff --git a/src/labels.ts b/src/labels.ts index 835aa9f..94ed2ec 100644 --- a/src/labels.ts +++ b/src/labels.ts @@ -16,11 +16,6 @@ export interface LabelRef { export interface ChangeSet { adds: Array; removes: Array; - - /** - * Required labels for this state change to occur. - */ - requires: Array; } /** @@ -46,6 +41,11 @@ export interface BaseLabel extends ChangeSet { * Label priority. */ priority: number; + + /** + * Required labels for this state change to occur. + */ + requires: Array; } /** @@ -53,14 +53,18 @@ export interface BaseLabel extends ChangeSet { */ export type FlagLabel = BaseLabel; +export interface StateChange extends ChangeSet { + matches: Array; +} + /** * 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; + becomes: Array; } /**