@wise/dynamic-flow-types 2.8.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 (80) 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 +3 -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 +75 -3
  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 +147 -22
  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
@@ -4,29 +4,92 @@ import type { Icon } from '../misc/Icon';
4
4
  import type { Image } from '../misc/Image';
5
5
  import type { SummaryProvider } from '../feature/SummaryProvider';
6
6
  import type { AlertLayout } from '../layout/AlertLayout';
7
+ /**
8
+ * Represents an object value in the submission.
9
+ * Objects can optionally be given a title to have them appear as form sections.
10
+ * If you'd like to group your fields into separate sections while keeping them in the same object in your submission,
11
+ * consider using [AllOfSchema].
12
+ */
7
13
  export type ObjectSchema = {
14
+ /**
15
+ * It must be `object`.
16
+ */
8
17
  type: 'object';
18
+ /**
19
+ * If true, the UI for this schema will not accept input, but the corresponding data will still be submitted.
20
+ * Defaults to false.
21
+ */
9
22
  disabled?: boolean;
23
+ /**
24
+ * @deprecated Please use nested oneOf schemas instead.
25
+ */
26
+ promoted?: boolean;
27
+ /**
28
+ * Provide additional help information to the user.
29
+ * @deprecated Only supported on web clients
30
+ */
31
+ help?: Help;
32
+ /**
33
+ * The properties of the object.
34
+ */
10
35
  properties: Record<string, Schema>;
36
+ /**
37
+ * The order in which the properties should be rendered by the client. This is required because objects are
38
+ * inherently unordered, and all properties must be included or they will not be displayed.
39
+ */
11
40
  displayOrder: string[];
41
+ /**
42
+ * An array containing the names of the properties which must have a non-null value for the object to be valid.
43
+ */
12
44
  required?: string[];
45
+ /**
46
+ * A unique id which can be used to refer to the schema.
47
+ */
13
48
  $id?: string;
49
+ /**
50
+ * A user-facing title for the schema.
51
+ */
14
52
  title?: string;
53
+ /**
54
+ * A user-facing description for the schema.
55
+ */
15
56
  description?: string;
57
+ /**
58
+ * An identifier which can be used to request the client use a particular UI control to represent this schema.
59
+ */
16
60
  control?: string;
61
+ /**
62
+ * If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted.
63
+ * Defaults to false.
64
+ */
17
65
  hidden?: boolean;
66
+ /**
67
+ * An icon which the client can use to represent this schema.
68
+ */
18
69
  icon?: Icon;
70
+ /**
71
+ * An image which the client can use to represent this schema.
72
+ */
19
73
  image?: Image;
74
+ /**
75
+ * A list of keywords that can be used when searching or filtering items in a [com.wise.dynamicflow.schema.OneOfSchema].
76
+ * Only applies when this schema is child schema in a [com.wise.dynamicflow.schema.OneOfSchema].
77
+ */
20
78
  keywords?: string[];
79
+ /**
80
+ * Configure how this schema will be summarised when included in an [ArraySchema].
81
+ */
21
82
  summary?: SummaryProvider;
22
- analyticsId?: string;
23
- alert?: AlertLayout;
24
83
  /**
25
- * @deprecated Please use nested oneOf schemas instead.
84
+ * An internal id which is attached to analytics events relating to the schema.
85
+ * It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step.
26
86
  */
27
- promoted?: boolean;
87
+ analyticsId?: string;
28
88
  /**
29
- * @deprecated Only supported on web clients
89
+ * Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or
90
+ * additional information to the user, but shouldn't be used for validation. For client-side validation please see
91
+ * the validation available on each schema type, or see [com.wise.dynamicflow.feature.ValidateAsync] and
92
+ * [com.wise.dynamicflow.feature.Action] for server-side validation.
30
93
  */
31
- help?: Help;
94
+ alert?: AlertLayout;
32
95
  };
@@ -6,49 +6,142 @@ import type { SummaryProvider } from '../feature/SummaryProvider';
6
6
  import type { AlertLayout } from '../layout/AlertLayout';
7
7
  import type { Help } from '../feature/Help';
8
8
  import type { AutocompleteToken } from '../misc/AutocompleteToken';
9
+ /**
10
+ * Offers a choice between a number of child schemas.
11
+ * Use a oneOf schema to represent either the selection of one of many constant values (e.g. a select box or dropdown)
12
+ * or alternative sections of a form (e.g. when the user can complete either section A or section B).
13
+ */
9
14
  export type OneOfSchema = {
15
+ /**
16
+ * If true, the UI for this schema will not accept input, but the corresponding data will still be submitted.
17
+ * Defaults to false.
18
+ */
10
19
  disabled?: boolean;
20
+ /**
21
+ * @deprecated This property is deprecated
22
+ */
23
+ autofillProvider?: string;
24
+ /**
25
+ * @deprecated Please use nested oneOf schemas instead.
26
+ */
27
+ promoted?: boolean;
28
+ /**
29
+ * @deprecated Please use 'refreshStepOnChange' instead
30
+ */
31
+ refreshFormOnChange?: boolean;
32
+ /**
33
+ * @deprecated Please use 'refreshUrl' in Step instead
34
+ */
35
+ refreshUrl?: string;
36
+ /**
37
+ * @deprecated Please use 'refreshUrl' in Step instead
38
+ */
39
+ refreshFormUrl?: string;
40
+ /**
41
+ * @deprecated OneOf Promotion is no longer supported
42
+ */
43
+ promotion?: JsonElement;
44
+ /**
45
+ * The child schemas to be selected between.
46
+ */
11
47
  oneOf: Schema[];
48
+ /**
49
+ * A user-facing placeholder value to use for the field. This can be used to provide an example of the expected
50
+ * input.
51
+ */
12
52
  placeholder?: string;
53
+ /**
54
+ * A unique id which can be used to refer to the schema.
55
+ */
13
56
  $id?: string;
57
+ /**
58
+ * A user-facing title for the schema.
59
+ */
14
60
  title?: string;
61
+ /**
62
+ * A user-facing description for the schema.
63
+ */
15
64
  description?: string;
65
+ /**
66
+ * An identifier which can be used to request the client use a particular UI control to represent this schema.
67
+ */
16
68
  control?: string;
69
+ /**
70
+ * The default value to use for this schema. This will be overridden by a value in the model of the
71
+ * [com.wise.dynamicflow.step.Step] if one is provided.
72
+ */
17
73
  default?: JsonElement;
74
+ /**
75
+ * If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted.
76
+ * Defaults to false.
77
+ */
18
78
  hidden?: boolean;
79
+ /**
80
+ * An icon which the client can use to represent this schema.
81
+ */
19
82
  icon?: Icon;
83
+ /**
84
+ * An image which the client can use to represent this schema.
85
+ */
20
86
  image?: Image;
87
+ /**
88
+ * A list of keywords that can be used when searching or filtering items in a [com.wise.dynamicflow.schema.OneOfSchema].
89
+ * Only applies when this schema is child schema in a [com.wise.dynamicflow.schema.OneOfSchema].
90
+ */
21
91
  keywords?: string[];
92
+ /**
93
+ * Configure how this schema will be summarised when included in an [ArraySchema].
94
+ */
22
95
  summary?: SummaryProvider;
96
+ /**
97
+ * An internal id which is attached to analytics events relating to the schema.
98
+ * It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step.
99
+ */
23
100
  analyticsId?: string;
24
- refreshStepOnChange?: boolean;
25
- alert?: AlertLayout;
26
- help?: Help;
27
- autocompleteHint?: AutocompleteToken[];
28
- autofillKey?: string;
29
- validationMessages?: Record<string, string>;
30
101
  /**
31
- * @deprecated This property is deprecated
102
+ * When true, the step will be refreshed when the value of this schema changes.
32
103
  */
33
- autofillProvider?: string;
104
+ refreshStepOnChange?: boolean;
34
105
  /**
35
- * @deprecated Please use nested oneOf schemas instead.
106
+ * Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or
107
+ * additional information to the user, but shouldn't be used for validation. For client-side validation please see
108
+ * the validation available on each schema type, or see [com.wise.dynamicflow.feature.ValidateAsync] and
109
+ * [com.wise.dynamicflow.feature.Action] for server-side validation.
36
110
  */
37
- promoted?: boolean;
111
+ alert?: AlertLayout;
38
112
  /**
39
- * @deprecated Please use 'refreshStepOnChange' instead
113
+ * Provide additional help information to the user.
40
114
  */
41
- refreshFormOnChange?: boolean;
115
+ help?: Help;
42
116
  /**
43
- * @deprecated Please use 'refreshUrl' in Step instead
117
+ * A list of tokens describing to the client what kind of field it is. This can enable the user agent or assistive
118
+ * technologies to automatically suggest or fill in information specific to the user.
119
+ * Values not recognised by the client will be discarded, and clients that only support single values will take the
120
+ * first supported value in the list.
44
121
  */
45
- refreshUrl?: string;
122
+ autocompleteHint?: AutocompleteToken[];
46
123
  /**
47
- * @deprecated Please use 'refreshUrl' in Step instead
124
+ * Identifies the type of data which the client can autofill for this schema. This is provided in a `.`
125
+ * delimited string, in the format `source.prop`, e.g `contact.email`. In this example, the client should
126
+ * suggest values from the `email` property on objects retrieved from the `contact` source to autofill
127
+ * this field.
128
+ * The only currently supported source is `contact`. It will inspect contacts from the native client address
129
+ * book (if available).
130
+ * Supported properties on the `contact` source are:
131
+ * - `givenName`
132
+ * - `familyName`
133
+ * - `fullName`
134
+ * - `email`
135
+ * - `firstLine`
136
+ * - `city`
137
+ * - `state`
138
+ * - `postalCode`
139
+ * - `countryCode`
48
140
  */
49
- refreshFormUrl?: string;
141
+ autofillKey?: string;
50
142
  /**
51
- * @deprecated OneOf Promotion is no longer supported
143
+ * An object where each property/value pair is the name of a validation property (e.g. maximum)
144
+ * to the user-facing error message to display if the validation fails.
52
145
  */
53
- promotion?: JsonElement;
146
+ validationMessages?: Record<string, string>;
54
147
  };
@@ -8,4 +8,15 @@ import type { NumberSchema } from './NumberSchema';
8
8
  import type { ObjectSchema } from './ObjectSchema';
9
9
  import type { OneOfSchema } from './OneOfSchema';
10
10
  import type { StringSchema } from './StringSchema';
11
+ /**
12
+ * The data to be collected, its validation rules, and how it is presented to the user are defined through a subset of
13
+ * [JSON Schema](https://json-schema.org/),
14
+ * with some additional properties added to improve the user experience and functionality. Each form step contains an
15
+ * array of schemas - typically there would only be one root schema but in order to support more layouts
16
+ * it's possible to provide any number. These schemas are mapped to their corresponding input components to be presented to
17
+ * the user, for example, a string schema would be mapped to a text input.
18
+ * At submission time, the values entered for each root schema are merged and submitted to the endpoint
19
+ * defined by the [com.wise.dynamicflow.feature.Action] the user has taken. In the case of any conflicting definitions,
20
+ * schemas which appear later in the schemas array will overwrite any values from schemas earlier in the array.
21
+ */
11
22
  export type Schema = AllOfSchema | ArraySchema | BlobSchema | BooleanSchema | ConstSchema | IntegerSchema | NumberSchema | ObjectSchema | OneOfSchema | StringSchema;
@@ -9,70 +9,195 @@ import type { JsonElement } from '../JsonElement';
9
9
  import type { UploadSource } from '../feature/UploadSource';
10
10
  import type { AutocompleteToken } from '../misc/AutocompleteToken';
11
11
  import type { Help } from '../feature/Help';
12
+ /**
13
+ * Represents a string value in the submission.
14
+ * This could be used for standard text input, or a format can be provided
15
+ * to specify a particular type of string (e.g. a date).
16
+ */
12
17
  export type StringSchema = {
13
18
  type: 'string';
19
+ /**
20
+ * @deprecated This property is deprecated
21
+ */
22
+ autofillProvider?: string;
23
+ /**
24
+ * @deprecated Please use nested oneOf schemas instead.
25
+ */
26
+ promoted?: boolean;
27
+ /**
28
+ * @deprecated Please use 'refreshStepOnChange' instead
29
+ */
30
+ refreshFormOnChange?: boolean;
31
+ /**
32
+ * @deprecated Please use 'refreshUrl' in Step instead
33
+ */
34
+ refreshUrl?: string;
35
+ /**
36
+ * @deprecated Please use 'refreshUrl' in Step instead
37
+ */
38
+ refreshFormUrl?: string;
39
+ /**
40
+ * The type of data the string represents.
41
+ */
14
42
  format?: StringSchemaFormat;
43
+ /**
44
+ * An input mask where a * represents a user-input character. Only the user input is submitted, not the full string.
45
+ */
15
46
  displayFormat?: string;
47
+ /**
48
+ * A user-facing placeholder value to use for the field. This can be used to provide an example of the expected
49
+ * input.
50
+ */
16
51
  placeholder?: string;
52
+ /**
53
+ * The minimum length permitted for the value, if null then there is no minimum length. This is ignored if a format
54
+ * with a specific structure is provided (e.g. `date`).
55
+ */
17
56
  minLength?: number;
57
+ /**
58
+ * The maximum length permitted for the value, if null then there is no maximum length. This is ignored if a format
59
+ * with a specific structure is provided (e.g. `date`).
60
+ */
18
61
  maxLength?: number;
62
+ /**
63
+ * The minimum value permitted. If null then there is no minimum. This is used for formats with a specific structure
64
+ * (e.g. `date`).
65
+ */
19
66
  minimum?: string;
67
+ /**
68
+ * The maximum value permitted. If null then there is no maximum. This is used for formats with a specific structure
69
+ * (e.g. `date`).
70
+ */
20
71
  maximum?: string;
72
+ /**
73
+ * A regular expression that the value must match to be valid. This is ignored if a format with a specific
74
+ * structure is provided (e.g. `date`).
75
+ */
21
76
  pattern?: string;
77
+ /**
78
+ * A unique id which can be used to refer to the schema.
79
+ */
22
80
  $id?: string;
81
+ /**
82
+ * A user-facing title for the schema.
83
+ */
23
84
  title?: string;
85
+ /**
86
+ * A user-facing description for the schema.
87
+ */
24
88
  description?: string;
89
+ /**
90
+ * An identifier which can be used to request the client use a particular UI control to represent this schema.
91
+ */
25
92
  control?: string;
93
+ /**
94
+ * The default value to use for this schema. This will be overridden by a value in the model of the
95
+ * [com.wise.dynamicflow.step.Step] if one is provided.
96
+ */
26
97
  default?: string;
98
+ /**
99
+ * If true, no UI will be shown to the user for this schema, but the corresponding data will still be submitted.
100
+ * Defaults to false.
101
+ */
27
102
  hidden?: boolean;
103
+ /**
104
+ * If true, the UI for this schema will not accept input, but the corresponding data will still be submitted.
105
+ * Defaults to false.
106
+ */
28
107
  disabled?: boolean;
108
+ /**
109
+ * An icon which the client can use to represent this schema.
110
+ */
29
111
  icon?: Icon;
112
+ /**
113
+ * An image which the client can use to represent this schema.
114
+ */
30
115
  image?: Image;
116
+ /**
117
+ * A list of keywords that can be used when searching or filtering items in a [com.wise.dynamicflow.schema.OneOfSchema].
118
+ * Only applies when this schema is child schema in a [com.wise.dynamicflow.schema.OneOfSchema].
119
+ */
31
120
  keywords?: string[];
121
+ /**
122
+ * Configure how this schema will be summarised when included in an [ArraySchema].
123
+ */
32
124
  summary?: SummaryProvider;
125
+ /**
126
+ * An internal id which is attached to analytics events relating to the schema.
127
+ * It allows you to override $id during event emission, it is not user-facing and does not have to be unique within the step.
128
+ */
33
129
  analyticsId?: string;
34
- persistAsync?: PersistAsync;
35
- refreshStepOnChange?: boolean;
36
- validationAsync?: ValidateAsync;
37
- validationMessages?: Record<string, string>;
38
- alert?: AlertLayout;
39
- autocompleteHint?: AutocompleteToken[];
40
- autofillKey?: string;
41
- help?: Help;
42
130
  /**
43
- * @deprecated This property is deprecated
131
+ * @see PersistAsync
44
132
  */
45
- autofillProvider?: string;
133
+ persistAsync?: PersistAsync;
46
134
  /**
47
- * @deprecated Please use nested oneOf schemas instead.
135
+ * When true, the step will be refreshed when the value of this schema changes.
48
136
  */
49
- promoted?: boolean;
137
+ refreshStepOnChange?: boolean;
50
138
  /**
51
- * @deprecated Please use 'refreshStepOnChange' instead
139
+ * @see ValidateAsync
52
140
  */
53
- refreshFormOnChange?: boolean;
141
+ validationAsync?: ValidateAsync;
54
142
  /**
55
- * @deprecated Please use 'refreshUrl' in Step instead
143
+ * An object where each property/value pair is the name of a validation property (e.g. maximum)
144
+ * to the user-facing error message to display if the validation fails.
56
145
  */
57
- refreshUrl?: string;
146
+ validationMessages?: Record<string, string>;
58
147
  /**
59
- * @deprecated Please use 'refreshUrl' in Step instead
148
+ * Configure an alert which will be displayed above the UI for this schema. This can be used to provide warnings or
149
+ * additional information to the user, but shouldn't be used for validation. For client-side validation please see
150
+ * the validation available on each schema type, or see [com.wise.dynamicflow.feature.ValidateAsync] and
151
+ * [com.wise.dynamicflow.feature.Action] for server-side validation.
60
152
  */
61
- refreshFormUrl?: string;
153
+ alert?: AlertLayout;
62
154
  /**
63
- * @deprecated Please use 'persistAsync' with a 'BlobSchema' instead.
155
+ * Provide client-specific configuration for the camera capture experience.
64
156
  */
65
157
  cameraConfig?: JsonElement;
66
158
  /**
67
- * @deprecated Please use 'persistAsync' with a 'BlobSchema' instead.
159
+ * Array of MIME types the field should accept. If null, any type of file is accepted.
160
+ * Wildcard MIME types are allowed, but support for them varies from platform to platform.
161
+ * Clients must support at least image, audio, and video.
162
+ * Any unrecognised MIME types will be ignored.
68
163
  */
69
164
  accepts?: string[];
70
165
  /**
71
- * @deprecated Please use 'persistAsync' with a 'BlobSchema' instead.
166
+ * The maximum file size in bytes. If null, file size is unlimited.
72
167
  */
73
168
  maxSize?: number;
74
169
  /**
75
- * @deprecated Please use 'persistAsync' with a 'BlobSchema' instead.
170
+ * Valid sources for the file. If null, any source is permitted.
76
171
  */
77
172
  source?: UploadSource;
173
+ /**
174
+ * A list of tokens describing to the client what kind of field it is. This can enable the user agent or assistive
175
+ * technologies to automatically suggest or fill in information specific to the user.
176
+ * Values not recognised by the client will be discarded, and clients that only support single values will take the
177
+ * first supported value in the list.
178
+ */
179
+ autocompleteHint?: AutocompleteToken[];
180
+ /**
181
+ * Identifies the type of data which the client can autofill for this schema. This is provided in a `.`
182
+ * delimited string, in the format `source.prop`, e.g `contact.email`. In this example, the client should
183
+ * suggest values from the `email` property on objects retrieved from the `contact` source to autofill
184
+ * this field.
185
+ * The only currently supported source is `contact`. It will inspect contacts from the native client address
186
+ * book (if available).
187
+ * Supported properties on the `contact` source are:
188
+ * - `givenName`
189
+ * - `familyName`
190
+ * - `fullName`
191
+ * - `email`
192
+ * - `firstLine`
193
+ * - `city`
194
+ * - `state`
195
+ * - `postalCode`
196
+ * - `countryCode`
197
+ */
198
+ autofillKey?: string;
199
+ /**
200
+ * Provide additional help information to the user.
201
+ */
202
+ help?: Help;
78
203
  };
@@ -1 +1,4 @@
1
+ /**
2
+ * Formats for string values
3
+ */
1
4
  export type StringSchemaFormat = 'date' | 'email' | 'numeric' | 'password' | 'phone-number' | 'base64url';
@@ -7,19 +7,14 @@ import type { Polling } from '../feature/Polling';
7
7
  import type { LinkHandler } from '../feature/LinkHandler';
8
8
  import type { StepError } from '../feature/StepError';
9
9
  import type { Navigation } from '../feature/Navigation';
10
+ /**
11
+ * A step represents a single screen in a flow. It is made up of schemas, which represent data to be collected from the
12
+ * user, layouts which describe how the screen looks, and a number of advanced features to provide more complex
13
+ * behaviours.
14
+ * ### Step Response
15
+ * A response is determined to be a Step when the status code is in the 200-299 range, the `exit` property in the triggering action was not set to `true`, and the `X-DF-Response-Type: step` header is provided.
16
+ */
10
17
  export type Step = {
11
- id: string;
12
- title: string;
13
- schemas: Schema[];
14
- layout: Layout[];
15
- model?: JsonElement;
16
- external?: External;
17
- polling?: Polling;
18
- linkHandlers?: LinkHandler[];
19
- analytics?: Record<string, string>;
20
- errors?: StepError;
21
- navigation?: Navigation;
22
- refreshUrl?: string;
23
18
  /**
24
19
  * @deprecated Please use 'id' instead
25
20
  */
@@ -40,4 +35,59 @@ export type Step = {
40
35
  * @deprecated Please use 'refreshUrl' instead
41
36
  */
42
37
  refreshFormUrl?: string;
38
+ /**
39
+ * An identifier which is added to analytics events as `stepId`.
40
+ */
41
+ id: string;
42
+ /**
43
+ * A user-facing title.
44
+ */
45
+ title: string;
46
+ /**
47
+ * An array of schemas describing the data for the user to input. Each root schemas which should be displayed to the
48
+ * user must be referenced by a [com.wise.dynamicflow.layout.FormLayout] in the `layout` property. If a schema is
49
+ * not referenced by a [com.wise.dynamicflow.layout.FormLayout], it won't be displayed, but it will still be submitted.
50
+ * On submission, the values corresponding to each element in the `schemas` array will be merged, as if they were contained in an
51
+ * [com.wise.dynamicflow.schema.AllOfSchema].
52
+ */
53
+ schemas: Schema[];
54
+ /**
55
+ * An array of layouts describing how the step should be structured.
56
+ */
57
+ layout: Layout[];
58
+ /**
59
+ * The data to use when initialising the step. It must follow the structure the schemas array describes, and any
60
+ * data which doesn't correspond to the schema is ignored.
61
+ */
62
+ model?: JsonElement;
63
+ /**
64
+ * Used to configure an app or web page to be opened when the step is first loaded.
65
+ */
66
+ external?: External;
67
+ /**
68
+ * Used to configure a polling behaviour, allowing the flow to progress automatically.
69
+ */
70
+ polling?: Polling;
71
+ /**
72
+ * Used to configure deep/universal link handling, allowing the flow to progress based on incoming redirects/links.
73
+ */
74
+ linkHandlers?: LinkHandler[];
75
+ /**
76
+ * Additional data to be included in analytics events. The keys/values in this object will be included in all events
77
+ * generated by clients.
78
+ */
79
+ analytics?: Record<string, string>;
80
+ /**
81
+ * Errors which will be shown when the step loads.
82
+ */
83
+ errors?: StepError;
84
+ /**
85
+ * Used to configure navigational behaviour of the step, for example to provide an
86
+ * [com.wise.dynamicflow.feature.Action] to perform when navigating back.
87
+ */
88
+ navigation?: Navigation;
89
+ /**
90
+ * The URL to use to fetch an updated step when the value of a schema marked refreshStepOnChange is updated.
91
+ */
92
+ refreshUrl?: string;
43
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-types",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "Dynamic Flow TypeScript Types",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -15,9 +15,9 @@
15
15
  ],
16
16
  "devDependencies": {
17
17
  "@formatjs/cli": "^6.2.7",
18
- "esbuild": "0.20.1",
18
+ "esbuild": "0.20.2",
19
19
  "npm-run-all2": "5.0.2",
20
- "ts-to-zod": "3.7.1",
20
+ "ts-to-zod": "3.7.3",
21
21
  "typescript": "4.9.5"
22
22
  },
23
23
  "peerDependencies": {},