@adeildo/pi-kit 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adeildo/pi-kit",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "The app builder, settings and events that pi-harness packages are built on.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -22,6 +22,8 @@ export interface AskQuestion {
22
22
  question: string;
23
23
  options: AskOption[];
24
24
  multiSelect?: boolean;
25
+ /** A last row for an answer in the user's own words. On unless it is `false`. */
26
+ typed?: boolean;
25
27
  }
26
28
 
27
29
  export interface AskRequest {
@@ -70,6 +72,8 @@ export function decodeAskRequest(value: unknown): string | undefined {
70
72
  return "a question has no header or text";
71
73
  if (!Array.isArray(question.options) || question.options.length === 0)
72
74
  return `"${question.header}" has no options`;
75
+ if (question.typed !== undefined && typeof question.typed !== "boolean")
76
+ return `"${question.header}" has a typed flag that is not a boolean`;
73
77
  for (const option of question.options) {
74
78
  if (!isObject(option) || typeof option.label !== "string")
75
79
  return `"${question.header}" has an option with no label`;