@wise/dynamic-flow-client 1.2.2 → 1.3.1

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 (135) hide show
  1. package/build/main.js +642 -3515
  2. package/build/main.min.js +1 -22
  3. package/build/types/common/constants/index.d.ts +0 -1
  4. package/build/types/common/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +1 -10
  5. package/build/types/common/hooks/usePersistAsync/usePersistAsync.d.ts +1 -1
  6. package/build/types/common/hooks/useStepPolling/useStepPolling.d.ts +1 -1
  7. package/build/types/common/utils/index.d.ts +3 -1
  8. package/build/types/common/utils/misc-utils.d.ts +2 -0
  9. package/build/types/{types/specification/Model.d.ts → common/utils/model-utils.d.ts} +1 -6
  10. package/build/types/common/utils/schema-utils.d.ts +23 -11
  11. package/build/types/common/utils/step-utils.d.ts +1 -1
  12. package/build/types/common/validators/models/model-validators.d.ts +1 -1
  13. package/build/types/common/validators/models/models.utils.d.ts +1 -1
  14. package/build/types/common/validators/schemas/schema-validators.d.ts +1 -1
  15. package/build/types/common/validators/validationFailures/validation-failures.d.ts +1 -1
  16. package/build/types/dynamicFlow/DynamicFlowStep.d.ts +1 -1
  17. package/build/types/dynamicFlow/DynamicFlowTypes.d.ts +1 -2
  18. package/build/types/dynamicFlow/utils/responseParsers/response-parsers.d.ts +1 -1
  19. package/build/types/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +2 -1
  20. package/build/types/dynamicFlow/utils/useDynamicFlowState.d.ts +1 -1
  21. package/build/types/formControl/FormControl.d.ts +58 -2
  22. package/build/types/index.d.ts +1 -2
  23. package/build/types/jsonSchemaForm/JsonSchemaForm.d.ts +1 -1
  24. package/build/types/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -1
  25. package/build/types/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -1
  26. package/build/types/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +1 -1
  27. package/build/types/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +1 -2
  28. package/build/types/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -1
  29. package/build/types/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +1 -1
  30. package/build/types/jsonSchemaForm/genericSchema/GenericSchema.d.ts +1 -1
  31. package/build/types/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +1 -1
  32. package/build/types/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +1 -1
  33. package/build/types/jsonSchemaForm/oneOfSchema/{utils/one-of-utils.d.ts → utils.d.ts} +1 -2
  34. package/build/types/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +1 -1
  35. package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +1 -1
  36. package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +1 -1
  37. package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +1 -1
  38. package/build/types/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +1 -1
  39. package/build/types/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.d.ts +1 -1
  40. package/build/types/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +1 -1
  41. package/build/types/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +1 -1
  42. package/build/types/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +1 -1
  43. package/build/types/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +1 -1
  44. package/build/types/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +1 -2
  45. package/build/types/layout/DynamicLayout.d.ts +1 -1
  46. package/build/types/layout/alert/DynamicAlert.d.ts +1 -1
  47. package/build/types/layout/box/DynamicBox.d.ts +1 -1
  48. package/build/types/layout/button/DynamicButton.d.ts +1 -1
  49. package/build/types/layout/button/utils.d.ts +1 -2
  50. package/build/types/layout/columns/DynamicColumns.d.ts +1 -1
  51. package/build/types/layout/decision/DynamicDecision.d.ts +1 -1
  52. package/build/types/layout/divider/DynamicDivider.d.ts +1 -1
  53. package/build/types/layout/external/DynamicExternal.d.ts +1 -1
  54. package/build/types/layout/form/DynamicForm.d.ts +1 -1
  55. package/build/types/layout/heading/DynamicHeading.d.ts +1 -1
  56. package/build/types/layout/image/DynamicImage.d.ts +1 -1
  57. package/build/types/layout/list/DynamicList.d.ts +1 -1
  58. package/build/types/layout/loadingIndicator/DynamicLoadingIndicator.d.ts +1 -1
  59. package/build/types/layout/markdown/DynamicMarkdown.d.ts +1 -1
  60. package/build/types/layout/paragraph/DynamicParagraph.d.ts +1 -1
  61. package/build/types/layout/review/DynamicReview.d.ts +1 -1
  62. package/build/types/layout/utils.d.ts +1 -1
  63. package/build/types/step/cameraStep/CameraStep.d.ts +1 -1
  64. package/build/types/step/cameraStep/cameraCapture/CameraCapture.d.ts +1 -1
  65. package/build/types/step/cameraStep/cameraCapture/hooks/index.d.ts +1 -1
  66. package/build/types/step/cameraStep/cameraCapture/tracking/index.d.ts +1 -1
  67. package/build/types/step/layoutStep/LayoutStep.d.ts +1 -1
  68. package/build/types/step/layoutStep/utils/inline-reference-utils.d.ts +1 -1
  69. package/build/types/step/layoutStep/utils/layout-utils.d.ts +1 -1
  70. package/package.json +4 -2
  71. package/build/types/common/constants/SchemaType.d.ts +0 -11
  72. package/build/types/fixtures/components/alert.d.ts +0 -3
  73. package/build/types/fixtures/components/box.d.ts +0 -3
  74. package/build/types/fixtures/components/button.d.ts +0 -3
  75. package/build/types/fixtures/components/columns.d.ts +0 -3
  76. package/build/types/fixtures/components/copyable.d.ts +0 -3
  77. package/build/types/fixtures/components/decision-flags.d.ts +0 -3
  78. package/build/types/fixtures/components/decision-icons.d.ts +0 -3
  79. package/build/types/fixtures/components/decision.d.ts +0 -3
  80. package/build/types/fixtures/components/heading.d.ts +0 -3
  81. package/build/types/fixtures/components/image.d.ts +0 -3
  82. package/build/types/fixtures/components/index.d.ts +0 -15
  83. package/build/types/fixtures/components/info.d.ts +0 -3
  84. package/build/types/fixtures/components/list.d.ts +0 -3
  85. package/build/types/fixtures/components/loading-indicator.d.ts +0 -3
  86. package/build/types/fixtures/components/paragraph.d.ts +0 -3
  87. package/build/types/fixtures/components/review.d.ts +0 -3
  88. package/build/types/fixtures/examples/camera-capture.d.ts +0 -3
  89. package/build/types/fixtures/examples/index.d.ts +0 -5
  90. package/build/types/fixtures/examples/recipient-update.d.ts +0 -3
  91. package/build/types/fixtures/examples/recipient.d.ts +0 -3
  92. package/build/types/fixtures/examples/single-file-upload.d.ts +0 -3
  93. package/build/types/fixtures/examples/step-validation-errors.d.ts +0 -3
  94. package/build/types/fixtures/features/action-response.d.ts +0 -3
  95. package/build/types/fixtures/features/external.d.ts +0 -3
  96. package/build/types/fixtures/features/index.d.ts +0 -5
  97. package/build/types/fixtures/features/persist-async.d.ts +0 -3
  98. package/build/types/fixtures/features/polling.d.ts +0 -3
  99. package/build/types/fixtures/features/validation-async.d.ts +0 -3
  100. package/build/types/fixtures/index.d.ts +0 -50
  101. package/build/types/fixtures/jsonSchemaForm/allOf.d.ts +0 -3
  102. package/build/types/fixtures/layouts/all.d.ts +0 -3
  103. package/build/types/fixtures/layouts/final-step-layout.d.ts +0 -3
  104. package/build/types/fixtures/layouts/index.d.ts +0 -6
  105. package/build/types/fixtures/layouts/list.d.ts +0 -3
  106. package/build/types/fixtures/layouts/pay-in.d.ts +0 -3
  107. package/build/types/fixtures/layouts/review.d.ts +0 -3
  108. package/build/types/fixtures/layouts/success.d.ts +0 -3
  109. package/build/types/fixtures/responses/action-response-final.d.ts +0 -3
  110. package/build/types/fixtures/responses/action.d.ts +0 -5
  111. package/build/types/fixtures/responses/exit.d.ts +0 -6
  112. package/build/types/fixtures/responses/index.d.ts +0 -4
  113. package/build/types/fixtures/responses/recipient-update-final.d.ts +0 -3
  114. package/build/types/fixtures/schemas/all-of.d.ts +0 -3
  115. package/build/types/fixtures/schemas/basic-form.d.ts +0 -3
  116. package/build/types/fixtures/schemas/boolean.d.ts +0 -3
  117. package/build/types/fixtures/schemas/index.d.ts +0 -6
  118. package/build/types/fixtures/schemas/number-and-integer.d.ts +0 -3
  119. package/build/types/fixtures/schemas/one-of.d.ts +0 -3
  120. package/build/types/fixtures/schemas/string-formats.d.ts +0 -3
  121. package/build/types/fixtures/utils/image-util.d.ts +0 -2
  122. package/build/types/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.d.ts +0 -3
  123. package/build/types/jsonSchemaForm/oneOfSchema/utils/index.d.ts +0 -2
  124. package/build/types/types/common/FormControl.d.ts +0 -57
  125. package/build/types/types/index.d.ts +0 -15
  126. package/build/types/types/specification/Action.d.ts +0 -19
  127. package/build/types/types/specification/FileUploadSchema.d.ts +0 -23
  128. package/build/types/types/specification/LayoutComponent.d.ts +0 -139
  129. package/build/types/types/specification/PersistAsync.d.ts +0 -8
  130. package/build/types/types/specification/Polling.d.ts +0 -12
  131. package/build/types/types/specification/Promotion.d.ts +0 -20
  132. package/build/types/types/specification/Schema.d.ts +0 -184
  133. package/build/types/types/specification/Step.d.ts +0 -110
  134. package/build/types/types/specification/ValidationAsync.d.ts +0 -6
  135. package/build/types/types/specification/core.d.ts +0 -29
@@ -1,139 +0,0 @@
1
- import { ExternalStepPollingConfiguration } from '../../common/hooks';
2
- import { Action } from './Action';
3
- import { Schema } from './Schema';
4
- import { Margin, Size, Icon, Image, Align, Orientation, Reference, Alert } from './core';
5
- export type LayoutComponent = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | ExternalLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ParagraphLayout | ReviewLayout;
6
- export type AlertLayout = {
7
- type: 'alert';
8
- } & Alert;
9
- export type BoxLayout = {
10
- type: 'box';
11
- components: LayoutComponent[];
12
- width?: Size;
13
- margin?: Margin;
14
- border?: boolean;
15
- };
16
- export type ButtonLayout = {
17
- type: 'button';
18
- action: Action | Reference;
19
- title?: string;
20
- control?: 'primary' | 'secondary' | 'tertiary';
21
- context?: 'neutral' | 'positive' | 'negative';
22
- disabled?: boolean;
23
- margin?: Margin;
24
- /**
25
- * @deprecated Only supported on web client
26
- */
27
- size?: Size;
28
- };
29
- export type ColumnsLayout = {
30
- type: 'columns';
31
- left: LayoutComponent[];
32
- right: LayoutComponent[];
33
- bias?: 'none' | 'left' | 'right';
34
- margin?: Margin;
35
- };
36
- export type DecisionLayout = {
37
- type: 'decision';
38
- options: DecisionOption[];
39
- margin?: Margin;
40
- };
41
- type DecisionOption = {
42
- action: Action | Reference;
43
- title: string;
44
- description?: string;
45
- icon?: Icon;
46
- image?: Image;
47
- disabled?: boolean;
48
- };
49
- /**
50
- * @deprecated Only supported on web client
51
- */
52
- export type DividerLayout = {
53
- type: 'divider';
54
- margin?: Margin;
55
- };
56
- /**
57
- * @deprecated Please use the external feature set instead
58
- */
59
- export type ExternalLayout = {
60
- type: 'external';
61
- requestUrl: string;
62
- polling?: Omit<ExternalStepPollingConfiguration, 'responseHandlers'>;
63
- responseHandlers?: ExternalStepPollingConfiguration['responseHandlers'];
64
- retryTitle?: string;
65
- };
66
- export type FormLayout = {
67
- type: 'form';
68
- schema: Schema | Reference;
69
- margin?: Margin;
70
- };
71
- export type HeadingLayout = {
72
- type: 'heading';
73
- size?: Size;
74
- text: string;
75
- margin?: Margin;
76
- align?: Align;
77
- };
78
- export type ImageLayout = {
79
- type: 'image';
80
- url: string;
81
- /**
82
- * @deprecated Only supported on web client
83
- */
84
- text?: string;
85
- size?: Size;
86
- margin?: Margin;
87
- };
88
- export type InfoLayout = {
89
- type: 'info';
90
- markdown: string;
91
- margin?: Margin;
92
- align?: Align;
93
- };
94
- export type ListLayout = {
95
- type: 'list';
96
- items: ListItem[];
97
- title?: string;
98
- margin?: Margin;
99
- };
100
- type ListItem = {
101
- title: string;
102
- description?: string;
103
- icon?: Icon;
104
- status?: 'positive' | 'neutral' | 'warning';
105
- };
106
- export type LoadingIndicatorLayout = {
107
- type: 'loading-indicator';
108
- margin?: Margin;
109
- size?: Size;
110
- };
111
- export type MarkdownLayout = {
112
- type: 'markdown';
113
- content: string;
114
- margin?: Margin;
115
- align?: Align;
116
- };
117
- export type ParagraphLayout = {
118
- type: 'paragraph';
119
- text: string;
120
- control?: 'copyable';
121
- margin?: Margin;
122
- align?: Align;
123
- };
124
- export type ReviewLayout = {
125
- type: 'review';
126
- title?: string;
127
- fields: ReviewField[];
128
- orientation?: Orientation;
129
- margin?: Margin;
130
- /**
131
- * @deprecated Only supported on web client
132
- */
133
- action?: Action;
134
- };
135
- type ReviewField = {
136
- label: string;
137
- value: string | number | boolean | null | undefined;
138
- };
139
- export {};
@@ -1,8 +0,0 @@
1
- import { Schema } from './Schema';
2
- export type PersistAsync = {
3
- idProperty: string;
4
- method?: 'POST' | 'PUT' | 'PATCH';
5
- param: string;
6
- schema: Schema;
7
- url: string;
8
- };
@@ -1,12 +0,0 @@
1
- import { Action } from './Action';
2
- export type PollingConfiguration = {
3
- url: string;
4
- interval: number;
5
- maxAttempts: number;
6
- onError: {
7
- action: Action;
8
- };
9
- };
10
- export type PollingResponse = {
11
- action: Action;
12
- } | null;
@@ -1,20 +0,0 @@
1
- import { Icon, Image } from './core';
2
- export type Promotion = {
3
- displayTwice?: boolean;
4
- other: {
5
- description?: string;
6
- heading?: {
7
- text: string;
8
- };
9
- icon?: Icon;
10
- image?: Image;
11
- title: string;
12
- };
13
- promoted?: {
14
- title?: string;
15
- description?: string;
16
- };
17
- control?: string;
18
- checkedMeans?: 'promoted' | 'other';
19
- default?: 'promoted' | 'other';
20
- };
@@ -1,184 +0,0 @@
1
- import { FileUploadSchema } from './FileUploadSchema';
2
- import { Model, ObjectModel } from './Model';
3
- import { PersistAsync } from './PersistAsync';
4
- import { Promotion } from './Promotion';
5
- import { ValidationAsync } from './ValidationAsync';
6
- import { Icon, Image, Alert, Help } from './core';
7
- export type Schema = AllOfSchema | ArraySchema | BlobSchema | BooleanSchema | IntegerSchema | NumberSchema | ObjectSchema | OneOfSchema | StringSchema | ListArraySchema | TupleArraySchema | FileUploadSchema | MultipleFileUploadSchema | ConstSchema;
8
- type SchemaBase = {
9
- $id?: string;
10
- type?: 'boolean' | 'blob' | 'array' | 'integer' | 'number' | 'string' | 'object';
11
- alert?: Alert;
12
- autofillProvider?: string;
13
- autofillKey?: string;
14
- allOf?: never;
15
- analyticsId?: string;
16
- const?: Model;
17
- default?: Model;
18
- description?: string;
19
- disabled?: boolean;
20
- format?: string;
21
- help?: Help;
22
- hidden?: boolean;
23
- icon?: Icon;
24
- image?: Image;
25
- oneOf?: never;
26
- persistAsync?: never;
27
- promoted?: boolean;
28
- promotion?: never;
29
- /**
30
- * @deprecated Please use disabled
31
- */
32
- readOnly?: boolean;
33
- refreshFormOnChange?: boolean;
34
- refreshFormUrl?: string;
35
- summary?: SchemaSummary;
36
- title?: string;
37
- validationAsync?: ValidationAsync;
38
- validationMessages?: Record<string, string>;
39
- /**
40
- * @deprecated Please use oneOf instead
41
- */
42
- values?: {
43
- label: string;
44
- value: string | number;
45
- }[];
46
- /**
47
- * @deprecated Please use layouts instead
48
- */
49
- width?: string;
50
- keywords?: string[];
51
- };
52
- export type AllOfSchema = Omit<SchemaBase, 'allOf'> & {
53
- allOf: Schema[];
54
- maximum?: number;
55
- minimum?: number;
56
- minLength?: number;
57
- maxLength?: number;
58
- minItems?: number;
59
- maxItems?: number;
60
- required?: string[];
61
- };
62
- export type ArraySchema = Omit<SchemaBase, 'persistAsync'> & {
63
- type: 'array';
64
- addItemTitle?: string;
65
- editItemTitle?: string;
66
- removeItemTitle?: string;
67
- items: Schema | Schema[];
68
- maxItems?: number;
69
- minItems?: number;
70
- persistAsync?: PersistAsync;
71
- summary?: ArraySchemaSummary;
72
- };
73
- export type ListArraySchema = ArraySchema & {
74
- items: Schema;
75
- };
76
- export type TupleArraySchema = ArraySchema & {
77
- items: Schema[];
78
- };
79
- export type MultipleFileUploadSchema = ListArraySchema & {
80
- items: PersistAsyncSchema;
81
- };
82
- export type BlobSchema = SchemaBase & {
83
- type: 'blob';
84
- accepts?: string[];
85
- maxSize?: number;
86
- };
87
- export type BooleanSchema = SchemaBase & {
88
- type: 'boolean';
89
- default?: boolean;
90
- const?: boolean;
91
- oneOf?: BooleanSchema[];
92
- };
93
- export type ConstSchema = SchemaBase & {
94
- type?: never;
95
- const: Model;
96
- };
97
- export type IntegerSchema = Omit<SchemaBase, 'persistAsync'> & {
98
- type: 'integer';
99
- default?: number;
100
- maximum?: number;
101
- minimum?: number;
102
- persistAsync?: PersistAsync;
103
- placeholder?: number;
104
- const?: number;
105
- oneOf?: IntegerSchema[];
106
- };
107
- export type NumberSchema = SchemaBase & Omit<IntegerSchema, 'type'> & {
108
- type: 'number';
109
- oneOf?: NumberSchema[];
110
- };
111
- export type ObjectSchema = SchemaBase & {
112
- type: 'object';
113
- displayOrder: string[];
114
- properties: Record<string, Schema>;
115
- required?: string[];
116
- oneOf?: ObjectSchema[];
117
- };
118
- export type OneOfSchema = Omit<SchemaBase, 'oneOf' | 'promotion'> & {
119
- oneOf: Schema[];
120
- promotion?: Promotion;
121
- maximum?: number;
122
- minimum?: number;
123
- minLength?: number;
124
- maxLength?: number;
125
- minItems?: number;
126
- maxItems?: number;
127
- required?: string[];
128
- default?: Model;
129
- placeholder?: Model;
130
- control?: string;
131
- };
132
- export type OneOfObjectSchema = Omit<OneOfSchema, 'oneOf' | 'default'> & {
133
- oneOf: ObjectSchema[];
134
- default?: ObjectModel;
135
- };
136
- export type PersistAsyncSchema = Schema & {
137
- persistAsync: PersistAsync;
138
- };
139
- export type StringSchema = Omit<SchemaBase, 'persistAsync'> & {
140
- type: 'string';
141
- control?: string;
142
- default?: string;
143
- displayFormat?: string;
144
- minimum?: string;
145
- maximum?: string;
146
- maxLength?: number;
147
- minLength?: number;
148
- pattern?: string;
149
- persistAsync?: PersistAsync;
150
- placeholder?: string;
151
- const?: string;
152
- oneOf?: StringSchema[];
153
- };
154
- export type BasicSchema = BooleanSchema | IntegerSchema | NumberSchema | StringSchema;
155
- export type ValidationAsyncSchema = BasicSchema & {
156
- validationAsync: ValidationAsync;
157
- };
158
- type SchemaSummary = {
159
- providesDescription?: boolean;
160
- providesIcon?: boolean;
161
- providesImage?: boolean;
162
- providesTitle?: boolean;
163
- };
164
- type ArraySchemaSummary = SchemaSummary & {
165
- defaultDescription?: string;
166
- defaultIcon?: Icon;
167
- defaultImage?: Image;
168
- defaultTitle?: string;
169
- };
170
- export declare function isBasicSchema(schema: Schema): schema is BasicSchema;
171
- export declare function isObjectSchema(schema: Schema): schema is ObjectSchema;
172
- export declare function isOneOfObjectSchema(schema: Schema): schema is OneOfObjectSchema;
173
- export declare function isOneOfSchema(schema: Schema): schema is OneOfSchema;
174
- export declare function isAllOfSchema(schema: Schema): schema is AllOfSchema;
175
- export declare function isBlobSchema(schema: Schema): schema is BlobSchema;
176
- export declare function isArraySchema(schema: Schema): schema is ArraySchema;
177
- export declare function isTupleArraySchema(schema: ArraySchema): schema is TupleArraySchema;
178
- export declare function isListArraySchema(schema: ArraySchema): schema is ListArraySchema;
179
- export declare function isStringSchema(schema: Schema): schema is StringSchema;
180
- export declare function isPersistAsyncSchema(schema: Schema): schema is PersistAsyncSchema;
181
- export declare function isPersistAsyncFileSchema(schema: Schema): schema is PersistAsyncSchema;
182
- export declare const isValidationAsyncSchema: (schema: Schema) => schema is ValidationAsyncSchema;
183
- export declare const isMultipleFileUploadSchema: (schema: Schema) => schema is MultipleFileUploadSchema;
184
- export {};
@@ -1,110 +0,0 @@
1
- import { ExternalStepPollingConfiguration } from '../../common/hooks';
2
- import { Action } from './Action';
3
- import { LayoutComponent } from './LayoutComponent';
4
- import { ObjectModel } from './Model';
5
- import { PollingConfiguration } from './Polling';
6
- import { Schema } from './Schema';
7
- import { Image } from './core';
8
- export type Step = FormStep | DecisionStep | ExternalStep | FinalStep;
9
- type BaseStep = {
10
- id?: string;
11
- /**
12
- * @deprecated Please use id instead
13
- */
14
- key?: string;
15
- type?: string;
16
- title?: string;
17
- description?: string;
18
- analytics?: Record<string, unknown>;
19
- layout?: LayoutComponent[];
20
- schemas?: Schema[];
21
- actions?: Action[];
22
- model?: ObjectModel;
23
- refreshFormUrl?: string;
24
- polling?: PollingConfiguration;
25
- external?: {
26
- url: string;
27
- };
28
- errors?: {
29
- error?: GlobalError;
30
- validation?: FormErrors;
31
- };
32
- };
33
- export type FormStep = BaseStep & {
34
- type?: 'form';
35
- title: string;
36
- layout: LayoutComponent[];
37
- schemas: Schema[];
38
- errors?: unknown;
39
- };
40
- /**
41
- * @deprecated Please use a form step with a layout instead
42
- */
43
- export type FinalStep = BaseStep & {
44
- type: 'final';
45
- actions: Action[];
46
- details: {
47
- description: string;
48
- image?: Image;
49
- title: string;
50
- };
51
- success: boolean;
52
- };
53
- /**
54
- * @deprecated Please use the external feature set instead
55
- */
56
- export type ExternalStep = BaseStep & {
57
- type: 'external';
58
- description?: string;
59
- polling?: Omit<ExternalStepPollingConfiguration, 'responseHandlers'>;
60
- requestUrl: string;
61
- responseHandlers?: ExternalStepPollingConfiguration['responseHandlers'];
62
- retryTitle?: string;
63
- title: string;
64
- };
65
- /**
66
- * @deprecated Please use DecisionLayout instead
67
- */
68
- export type DecisionStep = BaseStep & {
69
- type: 'decision';
70
- options?: DecisionStepOption[];
71
- };
72
- /**
73
- * @deprecated Please use DecisionLayout instead
74
- */
75
- export type DecisionStepOption = {
76
- title: string;
77
- description?: string;
78
- url: string;
79
- disabled?: boolean;
80
- };
81
- export type FormErrors = Record<string, unknown> | string | undefined | null;
82
- export type GlobalError = string | undefined | null;
83
- export type ErrorResponseBody = {
84
- error?: GlobalError;
85
- validation?: FormErrors;
86
- refreshFormUrl?: string;
87
- };
88
- /**
89
- * @deprecated Please use the review layout component
90
- */
91
- export type LegacyReviewStep = Omit<FormStep, 'actions' | 'schemas' | 'layout'> & {
92
- reviewFields?: LegacyReviewFields;
93
- actions?: Action[];
94
- schemas?: Schema[];
95
- };
96
- export type LegacyReviewFields = {
97
- title?: string;
98
- fields: Array<{
99
- title: string;
100
- value: string;
101
- }>;
102
- };
103
- export type LegacyFormStep = Step & {
104
- type?: 'form';
105
- reviewFields?: LegacyReviewFields;
106
- schemas?: Schema[];
107
- actions?: Action[];
108
- };
109
- export declare const isBasicError: (error: FormErrors) => error is string | null;
110
- export {};
@@ -1,6 +0,0 @@
1
- import { HttpMethod } from './core';
2
- export type ValidationAsync = {
3
- param: string;
4
- url: string;
5
- method?: HttpMethod;
6
- };
@@ -1,29 +0,0 @@
1
- export type Image = {
2
- url: string;
3
- text?: string;
4
- name?: string;
5
- };
6
- export type Icon = {
7
- name?: string;
8
- text?: never;
9
- } | {
10
- name?: never;
11
- text?: string;
12
- };
13
- export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
14
- export type Margin = Size;
15
- export type Context = 'neutral' | 'warning' | 'positive' | 'negative';
16
- export type Orientation = 'horizontal' | 'vertical';
17
- export type Align = 'left' | 'right' | 'center';
18
- export type HttpMethod = 'POST' | 'GET' | 'PUT' | 'PATCH' | 'DELETE';
19
- export type Reference = {
20
- $ref: string;
21
- };
22
- export type Alert = {
23
- markdown: string;
24
- context?: Context;
25
- margin?: Margin;
26
- };
27
- export type Help = {
28
- markdown: string;
29
- };