Skip to main content

AlphaWidgetDefinition

Alpha: this API can change or be removed at any time, without notice.

One version of a widget that the Massdriver UI can draw, and the well-known stash key that drives it. When a stash has the key with a value that matches schema, everyone who can view the project sees the widget. Keys that start with md/ are reserved for widgets: setting one checks its value against the schema.

A well-known key carries its version, for example md/v1/usage. A breaking change to a key's shape adds a new version of the widget with a new key, next to the old one. When a stash has more than one version of a widget's key, the UI draws the widget from the highest version.

type AlphaWidgetDefinition {
name: String!
description: String!
entity: AlphaWidgetEntityKind!
version: Int!
key: String!
keySegments: [String!]!
segmentValues: Map!
scope: AlphaStashScopeKind!
format: AlphaStashFormat!
schema: Map!
inputs: [AlphaWidgetInput!]!
}

Fields​

AlphaWidgetDefinition.name ● String! non-null scalar {#name}​

The widget's name, for example instance.usage_bar. A WIDGET annotation uses it as its surface.

AlphaWidgetDefinition.description ● String! non-null scalar {#description}​

What the widget shows.

AlphaWidgetDefinition.entity ● AlphaWidgetEntityKind! non-null enum {#entity}​

The kind of entity the widget shows on.

AlphaWidgetDefinition.version ● Int! non-null scalar {#version}​

The version of the well-known key's shape, for example 1.

AlphaWidgetDefinition.key ● String! non-null scalar {#key}​

The well-known stash key, for example md/v1/usage, or a key pattern with named segments in braces, for example md/v1/step/{step}. A key such as md/v1/step/src matches the pattern. A segment is 1 to 63 lowercase letters, digits, _, and -, and starts with a letter or digit.

AlphaWidgetDefinition.keySegments ● [String!]! non-null scalar {#key-segments}​

The names of the segments in key, for example ["step"] for md/v1/step/{step}. Empty for a fixed key.

AlphaWidgetDefinition.segmentValues ● Map! non-null scalar {#segment-values}​

The only values that a segment can have, by segment name. A segment that is not listed can be any value that follows the segment rule in key.

AlphaWidgetDefinition.scope ● AlphaStashScopeKind! non-null enum {#scope}​

The kind of entity whose stash holds the key. A link.traffic widget reads the key on the instance that sends the traffic, and shows on the lines that leave that instance.

AlphaWidgetDefinition.format ● AlphaStashFormat! non-null enum {#format}​

The format the key's value must be set with.

AlphaWidgetDefinition.schema ● Map! non-null scalar {#schema}​

The JSON Schema (draft 2020-12) that the key's value must match. Its $id names the key, for example https://schemas.massdriver.cloud/stash/md/v1/usage.json.

AlphaWidgetDefinition.inputs ● [AlphaWidgetInput!]! non-null object {#inputs}​

The widget's inputs.

Returned By​

alphaWidgetCatalog query