@wise/dynamic-flow-types 2.7.0 → 2.9.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.
Files changed (82) hide show
  1. package/build/next/feature/Action.d.ts +95 -7
  2. package/build/next/feature/External.d.ts +35 -0
  3. package/build/next/feature/Help.d.ts +6 -0
  4. package/build/next/feature/LinkHandler.d.ts +54 -0
  5. package/build/next/feature/Navigation.d.ts +11 -1
  6. package/build/next/feature/NavigationBackBehaviour.d.ts +8 -0
  7. package/build/next/feature/NavigationStackBehavior.d.ts +5 -0
  8. package/build/next/feature/PersistAsync.d.ts +73 -0
  9. package/build/next/feature/Polling.d.ts +43 -0
  10. package/build/next/feature/PollingOnError.d.ts +3 -0
  11. package/build/next/feature/StepError.d.ts +37 -0
  12. package/build/next/feature/Summary.d.ts +4 -0
  13. package/build/next/feature/SummaryProvider.d.ts +15 -0
  14. package/build/next/feature/SummarySummariser.d.ts +28 -0
  15. package/build/next/feature/UploadSource.d.ts +4 -0
  16. package/build/next/feature/ValidateAsync.d.ts +56 -0
  17. package/build/next/layout/AlertLayout.d.ts +20 -0
  18. package/build/next/layout/BoxLayout.d.ts +21 -0
  19. package/build/next/layout/ButtonLayout.d.ts +36 -3
  20. package/build/next/layout/ColumnsLayout.d.ts +22 -0
  21. package/build/next/layout/ColumnsLayoutBias.d.ts +3 -0
  22. package/build/next/layout/DecisionLayout.d.ts +15 -0
  23. package/build/next/layout/DecisionLayoutOption.d.ts +21 -0
  24. package/build/next/layout/DividerLayout.d.ts +10 -0
  25. package/build/next/layout/FormLayout.d.ts +21 -3
  26. package/build/next/layout/FormLayoutSchemaReference.d.ts +4 -0
  27. package/build/next/layout/HeadingLayout.d.ts +21 -0
  28. package/build/next/layout/ImageLayout.d.ts +26 -4
  29. package/build/next/layout/InfoLayout.d.ts +17 -0
  30. package/build/next/layout/InstructionsLayout.d.ts +18 -0
  31. package/build/next/layout/InstructionsLayoutItem.d.ts +9 -0
  32. package/build/next/layout/Layout.d.ts +3 -0
  33. package/build/next/layout/ListLayout.d.ts +16 -0
  34. package/build/next/layout/ListLayoutItem.d.ts +13 -0
  35. package/build/next/layout/ListLayoutStatus.d.ts +1 -0
  36. package/build/next/layout/LoadingIndicatorLayout.d.ts +16 -0
  37. package/build/next/layout/MarkdownLayout.d.ts +25 -0
  38. package/build/next/layout/ModalLayout.d.ts +17 -0
  39. package/build/next/layout/ModalLayoutContent.d.ts +3 -0
  40. package/build/next/layout/ModalLayoutTrigger.d.ts +3 -0
  41. package/build/next/layout/ParagraphLayout.d.ts +18 -0
  42. package/build/next/layout/ReviewLayout.d.ts +26 -5
  43. package/build/next/layout/ReviewLayoutCallToAction.d.ts +9 -0
  44. package/build/next/layout/ReviewLayoutField.d.ts +12 -0
  45. package/build/next/layout/SearchLayout.d.ts +29 -0
  46. package/build/next/layout/StatusListLayout.d.ts +18 -0
  47. package/build/next/layout/StatusListLayoutItem.d.ts +15 -0
  48. package/build/next/layout/StatusListLayoutStatus.d.ts +3 -0
  49. package/build/next/misc/Align.d.ts +3 -0
  50. package/build/next/misc/AutocompleteToken.d.ts +7 -0
  51. package/build/next/misc/Context.d.ts +5 -0
  52. package/build/next/misc/HttpMethod.d.ts +3 -0
  53. package/build/next/misc/Icon.d.ts +3 -0
  54. package/build/next/misc/IconNamed.d.ts +7 -0
  55. package/build/next/misc/IconText.d.ts +6 -0
  56. package/build/next/misc/Image.d.ts +8 -1
  57. package/build/next/misc/Size.d.ts +6 -0
  58. package/build/next/responses/action/ActionResponseBody.d.ts +11 -0
  59. package/build/next/responses/error/ErrorResponseBody.d.ts +47 -3
  60. package/build/next/responses/search/SearchResponseBody.d.ts +6 -0
  61. package/build/next/responses/search/SearchResult.d.ts +3 -0
  62. package/build/next/responses/search/SearchResultAction.d.ts +21 -0
  63. package/build/next/responses/search/SearchResultSearch.d.ts +22 -0
  64. package/build/next/responses/search/SearchSearchRequest.d.ts +17 -0
  65. package/build/next/schema/AllOfSchema.d.ts +55 -3
  66. package/build/next/schema/ArraySchema.d.ts +6 -0
  67. package/build/next/schema/ArraySchemaList.d.ts +74 -3
  68. package/build/next/schema/ArraySchemaTuple.d.ts +58 -3
  69. package/build/next/schema/BlobSchema.d.ts +80 -6
  70. package/build/next/schema/BooleanSchema.d.ts +98 -15
  71. package/build/next/schema/ConstSchema.d.ts +52 -3
  72. package/build/next/schema/IntegerSchema.d.ts +118 -15
  73. package/build/next/schema/NumberSchema.d.ts +119 -15
  74. package/build/next/schema/ObjectSchema.d.ts +69 -6
  75. package/build/next/schema/OneOfSchema.d.ts +111 -18
  76. package/build/next/schema/Schema.d.ts +11 -0
  77. package/build/next/schema/StringSchema.d.ts +150 -24
  78. package/build/next/schema/StringSchemaFormat.d.ts +3 -0
  79. package/build/next/step/Step.d.ts +62 -12
  80. package/package.json +3 -3
  81. package/build/next/schema/BlobSchemaSource.d.ts +0 -1
  82. package/build/next/schema/StringSchemaSource.d.ts +0 -4
@@ -1,12 +1,41 @@
1
1
  import type { HttpMethod } from '../misc/HttpMethod';
2
2
  import type { Size } from '../misc/Size';
3
+ /**
4
+ * Displays a search input field, which performs a search and returns a [com.wise.dynamicflow.responses.search.SearchResult].
5
+ * Results are actions or further searches.
6
+ */
3
7
  export type SearchLayout = {
8
+ /**
9
+ * It must be `search`.
10
+ */
4
11
  type: 'search';
12
+ /**
13
+ * A title to be displayed as a label for the search field.
14
+ */
5
15
  title: string;
16
+ /**
17
+ * The HTTP method to use for the request.
18
+ */
6
19
  method: HttpMethod;
20
+ /**
21
+ * The URL for the request. Either absolute or relative to the base URL of the flow.
22
+ */
7
23
  url: string;
24
+ /**
25
+ * The name of the parameter to place the search term under.
26
+ * If the method is GET, this will be included as a query parameter, otherwise, this will be a property of the JSON object in the request body.
27
+ */
8
28
  param: string;
29
+ /**
30
+ * A markdown message which the client should display if the results array is empty.
31
+ */
9
32
  emptyMessage?: string;
33
+ /**
34
+ * Specify a particular control to use to represent the layout. If the control is unknown, it will be ignored.
35
+ */
10
36
  control?: string;
37
+ /**
38
+ * The vertical margin to apply above this component. Defaults to `md`.
39
+ */
11
40
  margin?: Size;
12
41
  };
@@ -1,9 +1,27 @@
1
1
  import type { StatusListLayoutItem } from './StatusListLayoutItem';
2
2
  import type { Size } from '../misc/Size';
3
+ /**
4
+ * A list of items with statuses.
5
+ */
3
6
  export type StatusListLayout = {
7
+ /**
8
+ * It must be `status-list`.
9
+ */
4
10
  type: 'status-list';
11
+ /**
12
+ * Array of items.
13
+ */
5
14
  items: StatusListLayoutItem[];
15
+ /**
16
+ * The user-facing title.
17
+ */
6
18
  title?: string;
19
+ /**
20
+ * Specify a particular control to use to represent the layout. If the control is unknown, it will be ignored.
21
+ */
7
22
  control?: string;
23
+ /**
24
+ * The vertical margin to apply above this component. Defaults to `md`.
25
+ */
8
26
  margin?: Size;
9
27
  };
@@ -1,8 +1,23 @@
1
1
  import type { Icon } from '../misc/Icon';
2
2
  import type { StatusListLayoutStatus } from './StatusListLayoutStatus';
3
+ /**
4
+ * A single entry in a [StatusListLayout].
5
+ */
3
6
  export type StatusListLayoutItem = {
7
+ /**
8
+ * A user-facing title.
9
+ */
4
10
  title: string;
11
+ /**
12
+ * A user-facing description.
13
+ */
5
14
  description?: string;
15
+ /**
16
+ * An icon to represent the item.
17
+ */
6
18
  icon: Icon;
19
+ /**
20
+ * The status of the item, if it has one.
21
+ */
7
22
  status?: StatusListLayoutStatus;
8
23
  };
@@ -1 +1,4 @@
1
+ /**
2
+ * Represents the state of an item in a [StatusListLayout].
3
+ */
1
4
  export type StatusListLayoutStatus = 'not-done' | 'pending' | 'done';
@@ -1 +1,4 @@
1
+ /**
2
+ * An enum describing how the content of a layout should be aligned.
3
+ */
1
4
  export type Align = 'left' | 'center' | 'right';
@@ -1 +1,8 @@
1
+ /**
2
+ * A token which can be used in an autocomplete hint to tell clients what kind of data is expected. This can enable the
3
+ * user agent or assistive technologies to automatically suggest or fill in information specific to the user.
4
+ * Please note that not all values will work on all platforms. For the most benefit, it is helpful to combine controls
5
+ * with autocomplete hint - i.e a common pattern is to have password control on string schemas that can be combined
6
+ * with `PASSWORD` or `NEW_PASSWORD` autocomplete hints for the best possible user experience.
7
+ */
1
8
  export type AutocompleteToken = 'on' | 'name' | 'name-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'name-suffix' | 'nickname' | 'email' | 'username' | 'new-username' | 'new-password' | 'password' | 'one-time-code' | 'job-title' | 'organization-name' | 'full-street-address' | 'street-address-line-1' | 'street-address-line-2' | 'street-address-line-3' | 'address-level-1' | 'address-level-2' | 'address-level-3' | 'address-level-4' | 'country-code' | 'country-name' | 'postal-code' | 'credit-card-name' | 'credit-card-given-name' | 'credit-card-middle-name' | 'credit-card-family-name' | 'credit-card-number' | 'credit-card-expiration' | 'credit-card-expiration-month' | 'credit-card-expiration-year' | 'credit-card-security-code' | 'credit-card-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'birthdate' | 'birthdate-day' | 'birthdate-month' | 'birthdate-year' | 'gender' | 'phone-number' | 'phone-country-code' | 'phone-national' | 'phone-area-code' | 'phone-local' | 'phone-local-prefix' | 'phone-local-suffix' | 'phone-extension' | 'url' | 'photo' | 'impp' | 'shipping' | 'billing' | 'home' | 'work' | 'mobile' | 'fax' | 'pager';
@@ -1 +1,6 @@
1
+ /**
2
+ * An enum describing the sentiment of a layout component, typically used to apply variations on a layout style.
3
+ * The specific meaning of these values is dependent on the client and it's possible that multiple values may be
4
+ * mapped to the same style in some implementations.
5
+ */
1
6
  export type Context = 'positive' | 'neutral' | 'warning' | 'negative' | 'success' | 'failure' | 'info' | 'primary';
@@ -1 +1,4 @@
1
+ /**
2
+ * An enum describing which HTTP verb to be used.
3
+ */
1
4
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
@@ -1,3 +1,6 @@
1
1
  import type { IconNamed } from './IconNamed';
2
2
  import type { IconText } from './IconText';
3
+ /**
4
+ * Client-side icons based on well-known names or text content.
5
+ */
3
6
  export type Icon = IconNamed | IconText;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * A named icon.
3
+ */
1
4
  export type IconNamed = {
5
+ /**
6
+ * The name of the icon that is known and can be rendered by the client. An icon name is typically the
7
+ * equivalent to the icon identifier in many design systems.
8
+ */
2
9
  name: string;
3
10
  };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * A textual icon.
3
+ */
1
4
  export type IconText = {
5
+ /**
6
+ * The text to be used to generate the icon (e.g. initials for an avatar)
7
+ */
2
8
  text: string;
3
9
  };
@@ -1,10 +1,17 @@
1
+ /**
2
+ * Images fetched from URLs.
3
+ */
1
4
  export type Image = {
2
- url: string;
3
5
  /**
4
6
  * @deprecated Please use 'accessibilityDescription' instead
5
7
  */
6
8
  text?: string;
7
9
  /**
10
+ * The URL to use to fetch the image.
11
+ */
12
+ url: string;
13
+ /**
14
+ * A description of the content of the image to be used by screen readers.
8
15
  * @experimental This feature may be changed in the future without notice.
9
16
  */
10
17
  accessibilityDescription?: string;
@@ -1 +1,7 @@
1
+ /**
2
+ * An enum describing a size in generic terms.
3
+ * The size enum is used to describe sizes in multiple situations - for example margin, image, and heading sizes. The
4
+ * specific meaning of these values is dependent on the client, and it is possible that multiple values may be mapped to
5
+ * the same size in some implementations.
6
+ */
1
7
  export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -1,4 +1,15 @@
1
1
  import type { Action } from '../../feature/Action';
2
+ /**
3
+ * Represents an action response body.
4
+ * A response is determined to be an Action when the status code is in the 200-299 range, the `exit` property in the
5
+ * triggering action was not set to `true`, and the `X-DF-Response-Type: action` header is provided.
6
+ * When this response is received, the client performs the provided action. When doing so the client doesn't run any
7
+ * validation and no additional data from the step is included in the submission - any submission data must
8
+ * be provided in the action's `data` property. See [com.wise.dynamicflow.feature.Action].
9
+ */
2
10
  export type ActionResponseBody = {
11
+ /**
12
+ * The action to perform when this response is received.
13
+ */
3
14
  action: Action;
4
15
  };
@@ -1,14 +1,58 @@
1
1
  import type { JsonElement } from '../../JsonElement';
2
+ /**
3
+ * Represents an error response body.
4
+ * A response is determined to be an error when the status code of a response is outside of the 200-299 range.
5
+ */
2
6
  export type ErrorResponseBody = {
3
- error?: string;
4
- validation?: JsonElement;
5
- refreshUrl?: string;
6
7
  /**
7
8
  * @deprecated Please use 'refreshUrl' instead
8
9
  */
9
10
  refreshFormUrl?: string;
10
11
  /**
12
+ * Additional data to be included in any analytics events generated by clients for this error.
11
13
  * @experimental This feature may be changed in the future without notice.
12
14
  */
13
15
  analytics?: Record<string, string>;
16
+ /**
17
+ * A user-facing, general error message, not related to any particular schema.
18
+ */
19
+ error?: string;
20
+ /**
21
+ * Error messages related to specific fields. The structure of this value must match the structure of the data
22
+ * to be validated.
23
+ * For example, given the following model:
24
+ * ```
25
+ * {
26
+ * "name": "A Person",
27
+ * "bankDetails": {
28
+ * "accountNumber": "31510604",
29
+ * "sortCode": "100000"
30
+ * }
31
+ * }
32
+ * ```
33
+ * A validation message for the "sortCode" field would be provided as follows:
34
+ * ```
35
+ * {
36
+ * "bankDetails": {
37
+ * "sortCode": "Please enter a valid sort code"
38
+ * }
39
+ * }
40
+ * ```
41
+ * Multiple validation messages can be returned at once, for example:
42
+ * ```
43
+ * {
44
+ * "name": "Please enter a full name",
45
+ * "bankDetails": {
46
+ * "sortCode": "Please enter a valid sort code"
47
+ * }
48
+ * }
49
+ * ```
50
+ */
51
+ validation?: JsonElement;
52
+ /**
53
+ * If present, the client will refresh the step using the given URL. Any errors also present in the response should
54
+ * be applied to the refreshed step.
55
+ * See [com.wise.dynamicflow.feature.RefreshOnChange].
56
+ */
57
+ refreshUrl?: string;
14
58
  };
@@ -1,4 +1,10 @@
1
1
  import type { SearchResult } from './SearchResult';
2
+ /**
3
+ * Represents the result of a search. See [com.wise.dynamicflow.layout.SearchLayout].
4
+ */
2
5
  export type SearchResponseBody = {
6
+ /**
7
+ * A list of results.
8
+ */
3
9
  results: SearchResult[];
4
10
  };
@@ -1,3 +1,6 @@
1
1
  import type { SearchResultAction } from './SearchResultAction';
2
2
  import type { SearchResultSearch } from './SearchResultSearch';
3
+ /**
4
+ * Represents a single entry in a [SearchResponseBody].
5
+ */
3
6
  export type SearchResult = SearchResultAction | SearchResultSearch;
@@ -1,11 +1,32 @@
1
1
  import type { Icon } from '../../misc/Icon';
2
2
  import type { ImageLayout } from '../../layout/ImageLayout';
3
3
  import type { Action } from '../../feature/Action';
4
+ /**
5
+ * A search result which contains an [com.wise.dynamicflow.feature.Action] to perform when the result is selected.
6
+ */
4
7
  export type SearchResultAction = {
8
+ /**
9
+ * It must be `action`.
10
+ */
5
11
  type: 'action';
12
+ /**
13
+ * The user-facing title.
14
+ */
6
15
  title: string;
16
+ /**
17
+ * The user-facing description.
18
+ */
7
19
  description?: string;
20
+ /**
21
+ * An icon representing the result.
22
+ */
8
23
  icon?: Icon;
24
+ /**
25
+ * An image representing the result.
26
+ */
9
27
  image?: ImageLayout;
28
+ /**
29
+ * The action to perform when the option is selected.
30
+ */
10
31
  value: Action;
11
32
  };
@@ -1,11 +1,33 @@
1
1
  import type { Icon } from '../../misc/Icon';
2
2
  import type { ImageLayout } from '../../layout/ImageLayout';
3
3
  import type { SearchSearchRequest } from './SearchSearchRequest';
4
+ /**
5
+ * A search result which contains another search to be performed when selected. Can be used to provide groups of
6
+ * results or simple pagination.
7
+ */
4
8
  export type SearchResultSearch = {
9
+ /**
10
+ * It must be `search`.
11
+ */
5
12
  type: 'search';
13
+ /**
14
+ * The user-facing title.
15
+ */
6
16
  title: string;
17
+ /**
18
+ * The user-facing description.
19
+ */
7
20
  description?: string;
21
+ /**
22
+ * An icon representing the result.
23
+ */
8
24
  icon?: Icon;
25
+ /**
26
+ * An image representing the result.
27
+ */
9
28
  image?: ImageLayout;
29
+ /**
30
+ * A search configuration to used when the option is selected.
31
+ */
10
32
  value: SearchSearchRequest;
11
33
  };
@@ -1,7 +1,24 @@
1
1
  import type { HttpMethod } from '../../misc/HttpMethod';
2
+ /**
3
+ * A search request.
4
+ */
2
5
  export type SearchSearchRequest = {
6
+ /**
7
+ * The URL for the request. Either absolute or relative to the base URL of the flow.
8
+ */
3
9
  url: string;
10
+ /**
11
+ * The HTTP method to use for the request.
12
+ */
4
13
  method: HttpMethod;
14
+ /**
15
+ * The name of the parameter to place the search term under.
16
+ * If the HTTP method allows a request body this will be the property name to use in the request body JSON object.
17
+ * If the HTTP method does not allow a request body, this will be included as a query parameter.
18
+ */
5
19
  param: string;
20
+ /**
21
+ * The value of the query.
22
+ */
6
23
  query: string;
7
24
  };
@@ -3,22 +3,74 @@ import type { Icon } from '../misc/Icon';
3
3
  import type { Image } from '../misc/Image';
4
4
  import type { SummaryProvider } from '../feature/SummaryProvider';
5
5
  import type { AlertLayout } from '../layout/AlertLayout';
6
+ /**
7
+ * A schema which merges the value of its child schemas.
8
+ * Use an allOf schema to represent a form section where the submission payload is the result of merging the allOf's child schemas.
9
+ * This can be useful if you need to have one object in your submission payload, but want to split the properties into two or more sections.
10
+ */
6
11
  export type AllOfSchema = {
12
+ /**
13
+ * If true, the UI for this schema will not accept input, but the corresponding data will still be submitted.
14
+ * Defaults to false.
15
+ */
7
16
  disabled?: boolean;
17
+ /**
18
+ * @deprecated Please use nested oneOf schemas instead.
19
+ */
20
+ promoted?: boolean;
21
+ /**
22
+ * The child schemas of the allOf. The values of these schemas will be merged from first to last to create the
23
+ * submission value.
24
+ */
8
25
  allOf: Schema[];
26
+ /**
27
+ * A unique id which can be used to refer to the schema.
28
+ */
9
29
  $id?: string;
30
+ /**
31
+ * A user-facing title for the schema.
32
+ */
10
33
  title?: string;
34
+ /**
35
+ * A user-facing description for the schema.
36
+ */
11
37
  description?: string;
38
+ /**
39
+ * An identifier which can be used to request the client use a particular UI control to represent this schema.
40
+ */
12
41
  control?: string;
42
+ /**
43
+ * If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted.
44
+ * Defaults to false.
45
+ */
13
46
  hidden?: boolean;
47
+ /**
48
+ * An icon which the client can use to represent this schema.
49
+ */
14
50
  icon?: Icon;
51
+ /**
52
+ * An image which the client can use to represent this schema.
53
+ */
15
54
  image?: Image;
55
+ /**
56
+ * A list of keywords that can be used when searching or filtering items in a [com.wise.dynamicflow.schema.OneOfSchema].
57
+ * Only applies when this schema is child schema in a [com.wise.dynamicflow.schema.OneOfSchema].
58
+ */
16
59
  keywords?: string[];
60
+ /**
61
+ * Configure how this schema will be summarised when included in an [ArraySchema].
62
+ */
17
63
  summary?: SummaryProvider;
64
+ /**
65
+ * An internal id which is attached to analytics events relating to the schema.
66
+ * It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step.
67
+ */
18
68
  analyticsId?: string;
19
- alert?: AlertLayout;
20
69
  /**
21
- * @deprecated Please use nested oneOf schemas instead.
70
+ * Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or
71
+ * additional information to the user, but shouldn't be used for validation. For client-side validation please see
72
+ * the validation available on each schema type, or see [com.wise.dynamicflow.feature.ValidateAsync] and
73
+ * [com.wise.dynamicflow.feature.Action] for server-side validation.
22
74
  */
23
- promoted?: boolean;
75
+ alert?: AlertLayout;
24
76
  };
@@ -1,3 +1,9 @@
1
1
  import type { ArraySchemaList } from './ArraySchemaList';
2
2
  import type { ArraySchemaTuple } from './ArraySchemaTuple';
3
+ /**
4
+ * Represents an array of data in the submission.
5
+ * Arrays are either a list or a tuple:
6
+ * - A list is a set of fields which can be repeated a number of times, with each set being an element in the array.
7
+ * - A tuple is a fixed set of fields, where each field corresponds to an element in the array.
8
+ */
3
9
  export type ArraySchema = ArraySchemaList | ArraySchemaTuple;
@@ -5,29 +5,100 @@ import type { SummarySummariser } from '../feature/SummarySummariser';
5
5
  import type { PersistAsync } from '../feature/PersistAsync';
6
6
  import type { ValidateAsync } from '../feature/ValidateAsync';
7
7
  import type { AlertLayout } from '../layout/AlertLayout';
8
+ /**
9
+ * A variable length array where each item matches the items JSON schema. This can be used, for example, to create a
10
+ * repeating form section, or multi-file upload.
11
+ */
8
12
  export type ArraySchemaList = {
13
+ /**
14
+ * It must be `array`.
15
+ */
9
16
  type: 'array';
17
+ /**
18
+ * @deprecated Please use nested oneOf schemas instead.
19
+ */
20
+ promoted?: boolean;
21
+ /**
22
+ * A unique id which can be used to refer to the schema.
23
+ */
10
24
  $id?: string;
25
+ /**
26
+ * A schema which describes the structure of each array element.
27
+ */
11
28
  items: Schema;
29
+ /**
30
+ * The title for the add a new item, and the title for the screen to enter the item info.
31
+ */
12
32
  addItemTitle: string;
33
+ /**
34
+ * The title for the screen to edit the item info.
35
+ */
13
36
  editItemTitle: string;
37
+ /**
38
+ * The minimum number of items in the array.
39
+ */
14
40
  minItems?: number;
41
+ /**
42
+ * The maximum number of items in the array.
43
+ */
15
44
  maxItems?: number;
45
+ /**
46
+ * A user-facing title for the schema.
47
+ */
16
48
  title?: string;
49
+ /**
50
+ * A user-facing description for the schema.
51
+ */
17
52
  description?: string;
53
+ /**
54
+ * An identifier which can be used to request the client use a particular UI control to represent this schema.
55
+ */
18
56
  control?: string;
57
+ /**
58
+ * If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted.
59
+ * Defaults to false.
60
+ */
19
61
  hidden?: boolean;
62
+ /**
63
+ * An icon which the client can use to represent this schema.
64
+ */
20
65
  icon?: Icon;
66
+ /**
67
+ * An image which the client can use to represent this schema.
68
+ */
21
69
  image?: Image;
70
+ /**
71
+ * A list of keywords that can be used when searching or filtering items in a [com.wise.dynamicflow.schema.OneOfSchema].
72
+ * Only applies when this schema is child schema in a [com.wise.dynamicflow.schema.OneOfSchema].
73
+ */
22
74
  keywords?: string[];
75
+ /**
76
+ * Configure how this schema will be summarised when included in an [ArraySchema].
77
+ */
23
78
  summary?: SummarySummariser;
79
+ /**
80
+ * An internal id which is attached to analytics events relating to the schema.
81
+ * It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step.
82
+ */
24
83
  analyticsId?: string;
84
+ /**
85
+ * @see PersistAsync
86
+ */
25
87
  persistAsync?: PersistAsync;
88
+ /**
89
+ * @see ValidateAsync
90
+ */
26
91
  validationAsync?: ValidateAsync;
92
+ /**
93
+ * Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or
94
+ * additional information to the user, but shouldn't be used for validation. For client-side validation please see
95
+ * the validation available on each schema type, or see [com.wise.dynamicflow.feature.ValidateAsync] and
96
+ * [com.wise.dynamicflow.feature.Action] for server-side validation.
97
+ */
27
98
  alert?: AlertLayout;
28
- validationMessages?: Record<string, string>;
29
99
  /**
30
- * @deprecated Please use nested oneOf schemas instead.
100
+ * An object where each property/value pair is the name of a validation property (e.g. maximum)
101
+ * to the user-facing error message to display if the validation fails.
31
102
  */
32
- promoted?: boolean;
103
+ validationMessages?: Record<string, string>;
33
104
  };
@@ -5,24 +5,79 @@ import type { SummaryProvider } from '../feature/SummaryProvider';
5
5
  import type { PersistAsync } from '../feature/PersistAsync';
6
6
  import type { ValidateAsync } from '../feature/ValidateAsync';
7
7
  import type { AlertLayout } from '../layout/AlertLayout';
8
+ /**
9
+ * A fixed-length array where each schema represents the data at the corresponding element in the array.
10
+ * The minItems and maxItems validation has no purpose for a tuple, and should be ignored if provided.
11
+ */
8
12
  export type ArraySchemaTuple = {
13
+ /**
14
+ * It must be `array`.
15
+ */
9
16
  type: 'array';
17
+ /**
18
+ * @deprecated Please use nested oneOf schemas instead.
19
+ */
20
+ promoted?: boolean;
21
+ /**
22
+ * A unique id which can be used to refer to the schema.
23
+ */
10
24
  $id?: string;
25
+ /**
26
+ * An array of schemas which define each element that appears in this array.
27
+ */
11
28
  items: Schema[];
29
+ /**
30
+ * A user-facing title for the schema.
31
+ */
12
32
  title?: string;
33
+ /**
34
+ * A user-facing description for the schema.
35
+ */
13
36
  description?: string;
37
+ /**
38
+ * An identifier which can be used to request the client use a particular UI control to represent this schema.
39
+ */
14
40
  control?: string;
41
+ /**
42
+ * If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted.
43
+ * Defaults to false.
44
+ */
15
45
  hidden?: boolean;
46
+ /**
47
+ * An icon which the client can use to represent this schema.
48
+ */
16
49
  icon?: Icon;
50
+ /**
51
+ * An image which the client can use to represent this schema.
52
+ */
17
53
  image?: Image;
54
+ /**
55
+ * A list of keywords that can be used when searching or filtering items in a [com.wise.dynamicflow.schema.OneOfSchema].
56
+ * Only applies when this schema is child schema in a [com.wise.dynamicflow.schema.OneOfSchema].
57
+ */
18
58
  keywords?: string[];
59
+ /**
60
+ * Configure how this schema will be summarised when included in an [ArraySchema].
61
+ */
19
62
  summary?: SummaryProvider;
63
+ /**
64
+ * An internal id which is attached to analytics events relating to the schema.
65
+ * It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step.
66
+ */
20
67
  analyticsId?: string;
68
+ /**
69
+ * @see PersistAsync
70
+ */
21
71
  persistAsync?: PersistAsync;
72
+ /**
73
+ * @see ValidateAsync
74
+ */
22
75
  validationAsync?: ValidateAsync;
23
- alert?: AlertLayout;
24
76
  /**
25
- * @deprecated Please use nested oneOf schemas instead.
77
+ * Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or
78
+ * additional information to the user, but shouldn't be used for validation. For client-side validation please see
79
+ * the validation available on each schema type, or see [com.wise.dynamicflow.feature.ValidateAsync] and
80
+ * [com.wise.dynamicflow.feature.Action] for server-side validation.
26
81
  */
27
- promoted?: boolean;
82
+ alert?: AlertLayout;
28
83
  };