@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.
- package/build/next/feature/Action.d.ts +95 -7
- package/build/next/feature/External.d.ts +35 -0
- package/build/next/feature/Help.d.ts +6 -0
- package/build/next/feature/LinkHandler.d.ts +54 -0
- package/build/next/feature/Navigation.d.ts +11 -1
- package/build/next/feature/NavigationBackBehaviour.d.ts +8 -0
- package/build/next/feature/NavigationStackBehavior.d.ts +5 -0
- package/build/next/feature/PersistAsync.d.ts +73 -0
- package/build/next/feature/Polling.d.ts +43 -0
- package/build/next/feature/PollingOnError.d.ts +3 -0
- package/build/next/feature/StepError.d.ts +37 -0
- package/build/next/feature/Summary.d.ts +4 -0
- package/build/next/feature/SummaryProvider.d.ts +15 -0
- package/build/next/feature/SummarySummariser.d.ts +28 -0
- package/build/next/feature/UploadSource.d.ts +4 -0
- package/build/next/feature/ValidateAsync.d.ts +56 -0
- package/build/next/layout/AlertLayout.d.ts +20 -0
- package/build/next/layout/BoxLayout.d.ts +21 -0
- package/build/next/layout/ButtonLayout.d.ts +36 -3
- package/build/next/layout/ColumnsLayout.d.ts +22 -0
- package/build/next/layout/ColumnsLayoutBias.d.ts +3 -0
- package/build/next/layout/DecisionLayout.d.ts +15 -0
- package/build/next/layout/DecisionLayoutOption.d.ts +21 -0
- package/build/next/layout/DividerLayout.d.ts +10 -0
- package/build/next/layout/FormLayout.d.ts +21 -3
- package/build/next/layout/FormLayoutSchemaReference.d.ts +4 -0
- package/build/next/layout/HeadingLayout.d.ts +21 -0
- package/build/next/layout/ImageLayout.d.ts +26 -4
- package/build/next/layout/InfoLayout.d.ts +17 -0
- package/build/next/layout/InstructionsLayout.d.ts +18 -0
- package/build/next/layout/InstructionsLayoutItem.d.ts +9 -0
- package/build/next/layout/Layout.d.ts +3 -0
- package/build/next/layout/ListLayout.d.ts +16 -0
- package/build/next/layout/ListLayoutItem.d.ts +13 -0
- package/build/next/layout/ListLayoutStatus.d.ts +1 -0
- package/build/next/layout/LoadingIndicatorLayout.d.ts +16 -0
- package/build/next/layout/MarkdownLayout.d.ts +25 -0
- package/build/next/layout/ModalLayout.d.ts +17 -0
- package/build/next/layout/ModalLayoutContent.d.ts +3 -0
- package/build/next/layout/ModalLayoutTrigger.d.ts +3 -0
- package/build/next/layout/ParagraphLayout.d.ts +18 -0
- package/build/next/layout/ReviewLayout.d.ts +26 -5
- package/build/next/layout/ReviewLayoutCallToAction.d.ts +9 -0
- package/build/next/layout/ReviewLayoutField.d.ts +12 -0
- package/build/next/layout/SearchLayout.d.ts +29 -0
- package/build/next/layout/StatusListLayout.d.ts +18 -0
- package/build/next/layout/StatusListLayoutItem.d.ts +15 -0
- package/build/next/layout/StatusListLayoutStatus.d.ts +3 -0
- package/build/next/misc/Align.d.ts +3 -0
- package/build/next/misc/AutocompleteToken.d.ts +7 -0
- package/build/next/misc/Context.d.ts +5 -0
- package/build/next/misc/HttpMethod.d.ts +3 -0
- package/build/next/misc/Icon.d.ts +3 -0
- package/build/next/misc/IconNamed.d.ts +7 -0
- package/build/next/misc/IconText.d.ts +6 -0
- package/build/next/misc/Image.d.ts +8 -1
- package/build/next/misc/Size.d.ts +6 -0
- package/build/next/responses/action/ActionResponseBody.d.ts +11 -0
- package/build/next/responses/error/ErrorResponseBody.d.ts +47 -3
- package/build/next/responses/search/SearchResponseBody.d.ts +6 -0
- package/build/next/responses/search/SearchResult.d.ts +3 -0
- package/build/next/responses/search/SearchResultAction.d.ts +21 -0
- package/build/next/responses/search/SearchResultSearch.d.ts +22 -0
- package/build/next/responses/search/SearchSearchRequest.d.ts +17 -0
- package/build/next/schema/AllOfSchema.d.ts +55 -3
- package/build/next/schema/ArraySchema.d.ts +6 -0
- package/build/next/schema/ArraySchemaList.d.ts +74 -3
- package/build/next/schema/ArraySchemaTuple.d.ts +58 -3
- package/build/next/schema/BlobSchema.d.ts +80 -6
- package/build/next/schema/BooleanSchema.d.ts +98 -15
- package/build/next/schema/ConstSchema.d.ts +52 -3
- package/build/next/schema/IntegerSchema.d.ts +118 -15
- package/build/next/schema/NumberSchema.d.ts +119 -15
- package/build/next/schema/ObjectSchema.d.ts +69 -6
- package/build/next/schema/OneOfSchema.d.ts +111 -18
- package/build/next/schema/Schema.d.ts +11 -0
- package/build/next/schema/StringSchema.d.ts +150 -24
- package/build/next/schema/StringSchemaFormat.d.ts +3 -0
- package/build/next/step/Step.d.ts +62 -12
- package/package.json +3 -3
- package/build/next/schema/BlobSchemaSource.d.ts +0 -1
- package/build/next/schema/StringSchemaSource.d.ts +0 -4
|
@@ -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
|
-
*
|
|
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
|
-
|
|
87
|
+
analyticsId?: string;
|
|
28
88
|
/**
|
|
29
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
102
|
+
* When true, the step will be refreshed when the value of this schema changes.
|
|
32
103
|
*/
|
|
33
|
-
|
|
104
|
+
refreshStepOnChange?: boolean;
|
|
34
105
|
/**
|
|
35
|
-
*
|
|
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
|
-
|
|
111
|
+
alert?: AlertLayout;
|
|
38
112
|
/**
|
|
39
|
-
*
|
|
113
|
+
* Provide additional help information to the user.
|
|
40
114
|
*/
|
|
41
|
-
|
|
115
|
+
help?: Help;
|
|
42
116
|
/**
|
|
43
|
-
*
|
|
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
|
-
|
|
122
|
+
autocompleteHint?: AutocompleteToken[];
|
|
46
123
|
/**
|
|
47
|
-
*
|
|
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
|
-
|
|
141
|
+
autofillKey?: string;
|
|
50
142
|
/**
|
|
51
|
-
*
|
|
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
|
-
|
|
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;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { StringSchemaSource } from './StringSchemaSource';
|
|
2
1
|
import type { StringSchemaFormat } from './StringSchemaFormat';
|
|
3
2
|
import type { Icon } from '../misc/Icon';
|
|
4
3
|
import type { Image } from '../misc/Image';
|
|
@@ -6,72 +5,199 @@ import type { SummaryProvider } from '../feature/SummaryProvider';
|
|
|
6
5
|
import type { PersistAsync } from '../feature/PersistAsync';
|
|
7
6
|
import type { ValidateAsync } from '../feature/ValidateAsync';
|
|
8
7
|
import type { AlertLayout } from '../layout/AlertLayout';
|
|
8
|
+
import type { JsonElement } from '../JsonElement';
|
|
9
|
+
import type { UploadSource } from '../feature/UploadSource';
|
|
9
10
|
import type { AutocompleteToken } from '../misc/AutocompleteToken';
|
|
10
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
|
+
*/
|
|
11
17
|
export type StringSchema = {
|
|
12
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
|
+
*/
|
|
13
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
|
+
*/
|
|
14
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
|
+
*/
|
|
15
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
|
+
*/
|
|
16
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
|
+
*/
|
|
17
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
|
+
*/
|
|
18
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
|
+
*/
|
|
19
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
|
+
*/
|
|
20
76
|
pattern?: string;
|
|
77
|
+
/**
|
|
78
|
+
* A unique id which can be used to refer to the schema.
|
|
79
|
+
*/
|
|
21
80
|
$id?: string;
|
|
81
|
+
/**
|
|
82
|
+
* A user-facing title for the schema.
|
|
83
|
+
*/
|
|
22
84
|
title?: string;
|
|
85
|
+
/**
|
|
86
|
+
* A user-facing description for the schema.
|
|
87
|
+
*/
|
|
23
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
|
+
*/
|
|
24
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
|
+
*/
|
|
25
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
|
+
*/
|
|
26
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
|
+
*/
|
|
27
107
|
disabled?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* An icon which the client can use to represent this schema.
|
|
110
|
+
*/
|
|
28
111
|
icon?: Icon;
|
|
112
|
+
/**
|
|
113
|
+
* An image which the client can use to represent this schema.
|
|
114
|
+
*/
|
|
29
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
|
+
*/
|
|
30
120
|
keywords?: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Configure how this schema will be summarised when included in an [ArraySchema].
|
|
123
|
+
*/
|
|
31
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
|
+
*/
|
|
32
129
|
analyticsId?: string;
|
|
130
|
+
/**
|
|
131
|
+
* @see PersistAsync
|
|
132
|
+
*/
|
|
33
133
|
persistAsync?: PersistAsync;
|
|
134
|
+
/**
|
|
135
|
+
* When true, the step will be refreshed when the value of this schema changes.
|
|
136
|
+
*/
|
|
34
137
|
refreshStepOnChange?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* @see ValidateAsync
|
|
140
|
+
*/
|
|
35
141
|
validationAsync?: ValidateAsync;
|
|
36
|
-
validationMessages?: Record<string, string>;
|
|
37
|
-
alert?: AlertLayout;
|
|
38
|
-
autocompleteHint?: AutocompleteToken[];
|
|
39
|
-
autofillKey?: string;
|
|
40
|
-
help?: Help;
|
|
41
142
|
/**
|
|
42
|
-
*
|
|
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.
|
|
43
145
|
*/
|
|
44
|
-
|
|
146
|
+
validationMessages?: Record<string, string>;
|
|
45
147
|
/**
|
|
46
|
-
*
|
|
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.
|
|
47
152
|
*/
|
|
48
|
-
|
|
153
|
+
alert?: AlertLayout;
|
|
49
154
|
/**
|
|
50
|
-
*
|
|
155
|
+
* Provide client-specific configuration for the camera capture experience.
|
|
51
156
|
*/
|
|
52
|
-
|
|
157
|
+
cameraConfig?: JsonElement;
|
|
53
158
|
/**
|
|
54
|
-
*
|
|
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.
|
|
55
163
|
*/
|
|
56
|
-
|
|
164
|
+
accepts?: string[];
|
|
57
165
|
/**
|
|
58
|
-
*
|
|
166
|
+
* The maximum file size in bytes. If null, file size is unlimited.
|
|
59
167
|
*/
|
|
60
|
-
|
|
168
|
+
maxSize?: number;
|
|
61
169
|
/**
|
|
62
|
-
*
|
|
170
|
+
* Valid sources for the file. If null, any source is permitted.
|
|
63
171
|
*/
|
|
64
|
-
|
|
172
|
+
source?: UploadSource;
|
|
65
173
|
/**
|
|
66
|
-
*
|
|
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.
|
|
67
178
|
*/
|
|
68
|
-
|
|
179
|
+
autocompleteHint?: AutocompleteToken[];
|
|
69
180
|
/**
|
|
70
|
-
*
|
|
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`
|
|
71
197
|
*/
|
|
72
|
-
|
|
198
|
+
autofillKey?: string;
|
|
73
199
|
/**
|
|
74
|
-
*
|
|
200
|
+
* Provide additional help information to the user.
|
|
75
201
|
*/
|
|
76
|
-
|
|
202
|
+
help?: Help;
|
|
77
203
|
};
|
|
@@ -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.
|
|
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.
|
|
18
|
+
"esbuild": "0.20.2",
|
|
19
19
|
"npm-run-all2": "5.0.2",
|
|
20
|
-
"ts-to-zod": "3.7.
|
|
20
|
+
"ts-to-zod": "3.7.3",
|
|
21
21
|
"typescript": "4.9.5"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type BlobSchemaSource = 'file' | 'camera';
|