mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
3b3059c9ce
* New pfs impl * Reached codegen parity with old system * Update all models.cue inputs * Rename all models.cue files * Remove unused prefixfs * Changes Queries->DataQuery schema interface * Recodegen * All tests passing, nearly good now * Add SchemaInterface to kindsys props * Add pascal name deriver * Relocate plugin cue files again * Clarify use of injected fields * Remove unnecessary aliasing * Move DataQuery into mudball * Allow forcing ExpandReferences on go type generation * Move DataQuery def into kindsys, add generator to copy it to common * Fix copy generator to replace package name correctly * Fix duplicate type, test failure * Fix linting issues
32 lines
1.5 KiB
CUE
32 lines
1.5 KiB
CUE
package kindsys
|
|
|
|
// Composable is a category of kind that provides schema elements for
|
|
// composition into Core and Custom kinds. Grafana plugins
|
|
// provide composable kinds; for example, a datasource plugin provides one to
|
|
// describe the structure of its queries, which is then composed into dashboards
|
|
// and alerting rules.
|
|
//
|
|
// Each Composable is an implementation of exactly one Slot, a shared meta-schema
|
|
// defined by Grafana itself that constrains the shape of schemas declared in
|
|
// that ComposableKind.
|
|
Composable: S={
|
|
_sharedKind
|
|
|
|
// schemaInterface is the name of the Grafana schema interface implemented by
|
|
// this Composable kind. The set is open to ensure forward compatibility of
|
|
// Grafana and tooling with any additional schema interfaces that may be added.
|
|
schemaInterface: string
|
|
// TODO is it worth doing something like below, given that we have to keep this set open for forward compatibility?
|
|
// schemaInterface: or([ for k, _ in schemaInterfaces {k}, string])
|
|
|
|
let schif = schemaInterfaces[S.schemaInterface]
|
|
|
|
// lineage is the Thema lineage containing all the schemas that have existed for this kind.
|
|
// The name of the lineage is constrained to the name of the schema interface being implemented.
|
|
// FIXME cuetsy currently gets confused by all the unifications - maybe openapi too. Do something like the following after thema separates joinSchema/constraint expression
|
|
// lineage: { joinSchema: schif.interface }
|
|
// lineage: { joinSchema: (schif.interface | *{}) }
|
|
|
|
lineageIsGroup: schif.group
|
|
}
|