@wise/dynamic-flow-types 1.3.0 → 1.5.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/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
+ export * from './spec/responses';
1
2
  export * from './spec/Action';
2
3
  export * from './spec/core';
3
4
  export * from './spec/LayoutComponent';
4
5
  export * from './spec/Model';
6
+ export * from './spec/Navigation';
5
7
  export * from './spec/PersistAsync';
6
8
  export * from './spec/Polling';
7
9
  export * from './spec/Promotion';
8
10
  export * from './spec/Schema';
9
11
  export * from './spec/Step';
10
12
  export * from './spec/ValidationAsync';
13
+ export * from './spec/Search';
11
14
  export type { FileUploadSchema, CameraDirection } from './spec/FileUploadSchema';
@@ -17,7 +17,4 @@ export type Action = CoreAction & {
17
17
  type?: 'primary' | 'secondary' | 'link' | 'positive' | 'negative';
18
18
  disabled?: boolean;
19
19
  };
20
- export type ActionResponseBody = {
21
- action: Action;
22
- };
23
20
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Action } from './Action';
2
2
  import { ExternalStepPollingConfiguration, ExternalStepPollingResponseHandler } from './Polling';
3
3
  import { Schema } from './Schema';
4
+ import { SearchConfig } from './Search';
4
5
  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 | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ParagraphLayout | ReviewLayout | StatusListLayout;
6
+ export type LayoutComponent = AlertLayout | BoxLayout | ButtonLayout | ColumnsLayout | DecisionLayout | DividerLayout | ExternalLayout | FormLayout | HeadingLayout | ImageLayout | InfoLayout | InstructionsLayout | ListLayout | LoadingIndicatorLayout | MarkdownLayout | ParagraphLayout | ReviewLayout | StatusListLayout | SearchLayout;
6
7
  export type AlertLayout = {
7
8
  type: 'alert';
8
9
  } & Alert;
@@ -163,6 +164,12 @@ export type ReviewLayout = {
163
164
  */
164
165
  action?: Action;
165
166
  };
167
+ export type SearchLayout = SearchConfig & {
168
+ type: 'search';
169
+ title: string;
170
+ emptyMessage: string;
171
+ margin?: Margin;
172
+ };
166
173
  type ReviewField = {
167
174
  label: string;
168
175
  value: string | number | boolean | null | undefined;
@@ -0,0 +1,8 @@
1
+ import { Action } from './Action';
2
+ export type Navigation = {
3
+ backButton?: BackButton;
4
+ };
5
+ export type BackButton = {
6
+ title?: string;
7
+ action: Action;
8
+ };
@@ -0,0 +1,21 @@
1
+ import { Action } from './Action';
2
+ import { HttpMethod, Icon, Image } from './core';
3
+ export type SearchConfig = {
4
+ url: string;
5
+ method: HttpMethod;
6
+ param: string;
7
+ };
8
+ export type SearchResult = {
9
+ title: string;
10
+ description?: string;
11
+ icon?: Icon;
12
+ image?: Image;
13
+ } & ({
14
+ type: 'action';
15
+ value: Action;
16
+ } | {
17
+ type: 'search';
18
+ value: SearchConfig & {
19
+ query: string;
20
+ };
21
+ });
@@ -1,6 +1,7 @@
1
1
  import { Action } from './Action';
2
2
  import { LayoutComponent } from './LayoutComponent';
3
3
  import { ObjectModel } from './Model';
4
+ import { Navigation } from './Navigation';
4
5
  import { ExternalStepPollingConfiguration, ExternalStepPollingResponseHandler, PollingConfiguration } from './Polling';
5
6
  import { Schema } from './Schema';
6
7
  import { Image } from './core';
@@ -19,6 +20,10 @@ type BaseStep = {
19
20
  schemas?: Schema[];
20
21
  actions?: Action[];
21
22
  model?: ObjectModel;
23
+ /**
24
+ * @experimental navigation is experimental and subject to change
25
+ */
26
+ navigation?: Navigation;
22
27
  refreshUrl?: string;
23
28
  /**
24
29
  * @deprecated Please use refreshUrl instead
@@ -83,15 +88,6 @@ export type DecisionStepOption = {
83
88
  };
84
89
  export type FormErrors = Record<string, unknown> | string | undefined | null;
85
90
  export type GlobalError = string | undefined | null;
86
- export type ErrorResponseBody = {
87
- error?: GlobalError;
88
- validation?: FormErrors;
89
- refreshUrl?: string;
90
- /**
91
- * @deprecated Please use refreshUrl instead
92
- */
93
- refreshFormUrl?: string;
94
- };
95
91
  /**
96
92
  * @deprecated Please use the review layout component
97
93
  */
@@ -0,0 +1,18 @@
1
+ import { Action } from './Action';
2
+ import { SearchResult } from './Search';
3
+ import { FormErrors, GlobalError } from './Step';
4
+ export type ActionResponseBody = {
5
+ action: Action;
6
+ };
7
+ export type ErrorResponseBody = {
8
+ error?: GlobalError;
9
+ validation?: FormErrors;
10
+ refreshUrl?: string;
11
+ /**
12
+ * @deprecated Please use refreshUrl instead
13
+ */
14
+ refreshFormUrl?: string;
15
+ };
16
+ export type SearchResponseBody = {
17
+ results: SearchResult[];
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-types",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Dynamic Flow TypeScript Types",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {