Dominevo
ReferenceHTTP API

displayPalette

The displayPalette router: 3 methods of the display-palette capability, with tier, scope, input and output.

Capability display-palette · scope system · mode singleton · source packages/types/src/capabilities/display-palette.cap.ts:25.

Every method is called at /trpc/displayPalette.<method> — queries with GET, mutations with POST. See How to call and Authorization.

MethodKindTierToken scopeViewer
getPalettequeryprotectedviewyes
listPresetsqueryprotectedviewyes
setPalettemutationadminadmin onlyno

displayPalette.getPalette

  • Kind: query — GET /trpc/displayPalette.getPalette
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability display-palette, or category system
  • Viewer: yes
  • Try it: open /system/api-explorer?method=displayPalette.getPalette on your hub

Input

void

Output

{ status: "ready"; presetId: "camstack" | "high-contrast" | "okabe-ito"; customized: boolean; source: "stored" | "unconfigured"; swatches: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }>; fallbacks: string[] } | { status: "unknown"; reason: string }

displayPalette.listPresets

  • Kind: query — GET /trpc/displayPalette.listPresets
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability display-palette, or category system
  • Viewer: yes
  • Try it: open /system/api-explorer?method=displayPalette.listPresets on your hub

Input

void

Output

({ id: string; name: string; swatches: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }>; fallbacks: string[] })[]

displayPalette.setPalette

  • Kind: mutation — POST /trpc/displayPalette.setPalette
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=displayPalette.setPalette on your hub

Input

{ presetId: string } | { presetId: string; overrides: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }> }

Output

{ status: "ready"; presetId: "camstack" | "high-contrast" | "okabe-ito"; customized: boolean; source: "stored" | "unconfigured"; swatches: Record<string, { form: "solid"; hex: string } | { form: "gradient"; hex: string; alphas: number[] }>; fallbacks: string[] }