Skip to content

Commit

Permalink
chore: update playbook types
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Oct 29, 2024
1 parent f71e298 commit 68646ad
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/api/types/playbooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export type PlaybookSpec = {
export type PlaybookNames = {
id: string;
name: string;
namespace?: string;
title: string;
icon?: string;
category?: string;
Expand All @@ -122,6 +123,8 @@ export type PlaybookParamCommonFields = {
type PlaybookParamListOptions = PlaybookParamCommonFields & {
type: "list";
properties?: {
className?: string;
colSpan?: number;
// this is a list of options, e.g. a dropdown
options: {
label: string;
Expand All @@ -130,9 +133,22 @@ type PlaybookParamListOptions = PlaybookParamCommonFields & {
};
};

type ParamProperties = {
className?: string;
colSpan?: number;
};

type PlaybookParamTextOptions = PlaybookParamCommonFields & {
type: "text";
properties?: {
type:
| "text"
| "password"
| "email"
| "url"
| "number"
| "bytes"
| "millicores"
| "dns1123";
properties?: ParamProperties & {
// for multiline text, we can use this, to make it a textarea, otherwise
// it's a single line input
multiline?: boolean;
Expand All @@ -155,7 +171,7 @@ type PlaybookParamTextOptions = PlaybookParamCommonFields & {

export type PlaybookParamCodeEditor = PlaybookParamCommonFields & {
type: "code";
properties?: {
properties?: ParamProperties & {
// We can have a single code type, then we can use this to determine the language
// e.g. yaml, json, toml, etc.
language?: string;
Expand All @@ -166,29 +182,27 @@ export type PlaybookParamCodeEditor = PlaybookParamCommonFields & {

export type PlaybookParamCheckbox = PlaybookParamCommonFields & {
type: "checkbox";
// no properties, just a checkbox
properties?: ParamProperties;
};

export type PlaybookParamComponentConfigCheck = PlaybookParamCommonFields & {
type: "component" | "config" | "check";
properties?: {
properties?: ParamProperties & {
filter: PlaybookResourceSelector[];
};
};

export type PlaybookParamPeople = PlaybookParamCommonFields & {
type: "people";
properties?: {
properties?: ParamProperties & {
// filter by role
role: string;
};
};

export type PlaybookParamTeam = PlaybookParamCommonFields & {
type: "team";
properties?: {
// think about this one
};
properties?: ParamProperties;
};

export type PlaybookParam =
Expand Down

0 comments on commit 68646ad

Please sign in to comment.