@wise/dynamic-flow-client 2.8.14 → 2.8.15
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/main.js +32 -30
- package/build/main.min.js +1 -1
- package/build/types/common/messages/persist-async.messages.d.ts +8 -0
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +2 -0
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +1 -1
- package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +15 -0
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +22 -0
- package/build/types/revamp/domain/features/persistAsync/persist-async-utils.d.ts +2 -0
- package/build/types/revamp/domain/features/validation/spec-utils.d.ts +1 -0
- package/build/types/revamp/domain/features/validation/validation-functions.d.ts +7 -0
- package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +1 -0
- package/build/types/revamp/domain/mappers/schema/types.d.ts +2 -1
- package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +14 -13
- package/build/types/revamp/domain/mappers/types.d.ts +3 -0
- package/build/types/revamp/domain/types.d.ts +13 -5
- package/build/types/revamp/utils/{getSubmittableData.d.ts → component-utils.d.ts} +1 -0
- package/build/types/revamp/utils/type-utils.d.ts +7 -1
- package/build/types/test-utils/fetch-utils.d.ts +2 -2
- package/package.json +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -8
- package/build/types/revamp/domain/features/validation/getModelValidationErrors.d.ts +0 -5
- package/build/types/revamp/domain/features/validation/validateComponents.d.ts +0 -2
- package/build/types/revamp/domain/validation/validation-functions.d.ts +0 -7
- /package/build/types/revamp/{domain/mappers/utils → utils}/type-validators.d.ts +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
3
4
|
export type BooleanInputComponent = InputComponent<boolean> & {
|
|
4
5
|
type: 'boolean';
|
|
5
6
|
};
|
|
6
7
|
export declare const createBooleanInputComponent: (booleanInputProps: Pick<BooleanInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "control" | "id" | "errors" | "required" | "value" | "uid"> & {
|
|
7
8
|
checks: IsInvalidCheck<boolean | null>[];
|
|
9
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
8
10
|
summariser: (value: boolean | null) => RepeatableSummary;
|
|
9
11
|
}, updateComponent: UpdateComponent) => BooleanInputComponent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
1
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
3
|
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
3
4
|
export type DateInputComponent = InputComponent<string> & {
|
|
@@ -7,5 +8,6 @@ export type DateInputComponent = InputComponent<string> & {
|
|
|
7
8
|
};
|
|
8
9
|
export declare const createDateInputComponent: (textInputProps: Pick<DateInputComponent, "analyticsId" | "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "minimumDate" | "maximumDate" | "uid"> & {
|
|
9
10
|
checks: IsInvalidCheck<string | null>[];
|
|
11
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
10
12
|
summariser: (value: string | null) => RepeatableSummary;
|
|
11
13
|
}, updateComponent: UpdateComponent) => DateInputComponent;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
3
4
|
export type IntegerInputComponent = InputComponent<number> & {
|
|
4
5
|
type: 'integer';
|
|
5
6
|
};
|
|
6
7
|
export declare const createIntegerInputComponent: (integerInputProps: Pick<IntegerInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
8
|
checks: IsInvalidCheck<number | null>[];
|
|
9
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
8
10
|
summariser: (value: number | null) => RepeatableSummary;
|
|
9
11
|
}, updateComponent: UpdateComponent) => IntegerInputComponent;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
2
2
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
3
4
|
export type NumberInputComponent = InputComponent<number> & {
|
|
4
5
|
type: 'number';
|
|
5
6
|
};
|
|
6
7
|
export declare const createNumberInputComponent: (numberInputProps: Pick<NumberInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
7
8
|
checks: IsInvalidCheck<number | null>[];
|
|
9
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
8
10
|
summariser: (value: number | null) => RepeatableSummary;
|
|
9
11
|
}, updateComponent: UpdateComponent) => NumberInputComponent;
|
|
@@ -2,6 +2,7 @@ import type { Icon, Image, Model } from '@wise/dynamic-flow-types/build/next';
|
|
|
2
2
|
import type { InputComponent, RepeatableSummary, StepComponent, UpdateComponent } from '../types';
|
|
3
3
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
4
4
|
import type { AnalyticsEventDispatcher } from '../features/events';
|
|
5
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
5
6
|
export type SelectInputComponent = Omit<InputComponent<Model>, 'onChange'> & {
|
|
6
7
|
type: 'select';
|
|
7
8
|
selectedIndex: number | null;
|
|
@@ -25,6 +26,7 @@ export declare const createSelectInputComponent: (selectProps: Pick<SelectInputC
|
|
|
25
26
|
component: StepComponent;
|
|
26
27
|
})[];
|
|
27
28
|
checks: IsInvalidCheck<Model>[];
|
|
29
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
28
30
|
summariser: (value: Model | null) => RepeatableSummary;
|
|
29
31
|
trackEvent: AnalyticsEventDispatcher;
|
|
30
32
|
}, updateComponent: UpdateComponent) => SelectInputComponent;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
2
|
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
3
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
3
4
|
export type TextInputComponent = InputComponent<string> & {
|
|
4
5
|
type: 'text';
|
|
5
6
|
displayFormat?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const createTextInputComponent: (textInputProps: Pick<TextInputComponent, "analyticsId" | "description" | "disabled" | "help" | "title" | "placeholder" | "control" | "displayFormat" | "id" | "errors" | "required" | "value" | "autoComplete" | "uid"> & {
|
|
8
9
|
checks: IsInvalidCheck<string | null>[];
|
|
10
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
9
11
|
summariser: (value: string | null) => RepeatableSummary;
|
|
10
12
|
}, updateComponent: UpdateComponent) => TextInputComponent;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
2
2
|
import type { InputComponent, RepeatableSummary, UpdateComponent } from '../types';
|
|
3
|
+
import type { PerformPersistAsync } from '../features/persistAsync/getPerformPersistAsync';
|
|
3
4
|
export type UploadInputComponent = InputComponent<string> & {
|
|
4
5
|
type: 'upload';
|
|
5
6
|
accepts?: string[];
|
|
6
7
|
};
|
|
7
8
|
export declare const createUploadInputComponent: (uploadInputProps: Pick<UploadInputComponent, "analyticsId" | "description" | "disabled" | "title" | "placeholder" | "control" | "id" | "errors" | "required" | "value" | "accepts" | "autoComplete" | "uid"> & {
|
|
8
9
|
checks: IsInvalidCheck<string | null>[];
|
|
10
|
+
performPersistAsync: PerformPersistAsync | undefined;
|
|
9
11
|
summariser: (value: string | null) => RepeatableSummary;
|
|
10
12
|
}, updateComponent: UpdateComponent) => UploadInputComponent;
|
|
@@ -16,7 +16,7 @@ export type RepeatableComponent = BaseComponent<Model[]> & {
|
|
|
16
16
|
summaryDefaults: RepeatableSummary;
|
|
17
17
|
title?: string;
|
|
18
18
|
getChildren: () => StepComponent[];
|
|
19
|
-
|
|
19
|
+
getLocalValue: () => Model[] | null;
|
|
20
20
|
onAdd: () => void;
|
|
21
21
|
onEdit: (itemIndex: number) => void;
|
|
22
22
|
onRemove: () => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { getInputUpdateFunction } from '../../components/utils/component-utils';
|
|
2
|
+
import type { PerformPersistAsync } from './getPerformPersistAsync';
|
|
3
|
+
import type { BooleanInputComponent } from '../../components/BooleanInputComponent';
|
|
4
|
+
import type { DateInputComponent } from '../../components/DateInputComponent';
|
|
5
|
+
import type { IntegerInputComponent } from '../../components/IntegerInputComponent';
|
|
6
|
+
import type { NumberInputComponent } from '../../components/NumberInputComponent';
|
|
7
|
+
import type { SelectInputComponent } from '../../components/SelectInputComponent';
|
|
8
|
+
import type { TextInputComponent } from '../../components/TextInputComponent';
|
|
9
|
+
import type { UploadInputComponent } from '../../components/UploadInputComponent';
|
|
10
|
+
type Persistable = BooleanInputComponent | DateInputComponent | IntegerInputComponent | NumberInputComponent | SelectInputComponent | TextInputComponent | UploadInputComponent;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an onPersistAsync handler for a component.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getComponentPersistAsync: <C extends Persistable>(update: (updateFn: (component: C) => void) => void, performPersistAsync: PerformPersistAsync) => (component: C) => void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JsonElement, Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
|
+
import type { PersistAsyncConfig } from '../../mappers/types';
|
|
3
|
+
import type { HttpClient } from '../../../dynamic-flow-types';
|
|
4
|
+
import type { AnalyticsEventDispatcher } from '../events';
|
|
5
|
+
export type PerformPersistAsync = (props: PersistAsyncProps) => Promise<JsonElement>;
|
|
6
|
+
type PersistAsyncModel = Model | Blob;
|
|
7
|
+
type PersistAsyncProps = {
|
|
8
|
+
value: PersistAsyncModel;
|
|
9
|
+
signal: AbortSignal;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Takes an httpClient and schema persist async config and returns a function that can
|
|
13
|
+
* execute a persist async request.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getPerformPersistAsync: ({ schemaId, httpClient, trackEvent, persistAsyncConfig, genericErrorMessage, }: {
|
|
16
|
+
schemaId?: string | undefined;
|
|
17
|
+
httpClient: HttpClient;
|
|
18
|
+
trackEvent: AnalyticsEventDispatcher;
|
|
19
|
+
persistAsyncConfig: PersistAsyncConfig;
|
|
20
|
+
genericErrorMessage: string;
|
|
21
|
+
}) => PerformPersistAsync;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StepComponent } from '../../types';
|
|
2
|
+
import type { IsInvalidCheck } from './value-checks';
|
|
3
|
+
export declare const validateComponents: (components: StepComponent[]) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a function that takes a model and returns an array of validation errors
|
|
6
|
+
*/
|
|
7
|
+
export declare const getModelValidator: <M extends import("@wise/dynamic-flow-types/build/next").JsonElement>(checks: IsInvalidCheck<M>[]) => (currentValue: M) => string[];
|
|
@@ -18,6 +18,7 @@ export declare const getMockSchemaMapperProps: <S extends Schema>(schemaMapperPr
|
|
|
18
18
|
model: import("@wise/dynamic-flow-types/build/next").JsonElement;
|
|
19
19
|
required: boolean;
|
|
20
20
|
validationErrors: import("@wise/dynamic-flow-types/build/next").JsonElement;
|
|
21
|
+
persistAsyncConfig?: import("../../types").PersistAsyncConfig | undefined;
|
|
21
22
|
};
|
|
22
23
|
export declare const mockUpdateFunction: <C extends StepComponent>(draftComponent: C) => jest.Mock<any, any, any>;
|
|
23
24
|
export declare const getUpdateFunctionMock: <C extends StepComponent>(getComponent: () => C) => jest.Mock<void, [uid: string, update: (component: StepComponent) => void], any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Step as DFStep, Model, Schema, ValidationError } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { OnAction, UpdateComponent } from '../../types';
|
|
3
|
-
import type { GetErrorMessageFunctions } from '../types';
|
|
3
|
+
import type { GetErrorMessageFunctions, PersistAsyncConfig } from '../types';
|
|
4
4
|
import type { AnalyticsEventDispatcher, LoggingEventDispatcher } from '../../features/events';
|
|
5
5
|
import type { HttpClient } from '../../../dynamic-flow-types';
|
|
6
6
|
export type MapperProps = {
|
|
@@ -17,4 +17,5 @@ export type SchemaMapperProps = {
|
|
|
17
17
|
model: Model;
|
|
18
18
|
required?: boolean;
|
|
19
19
|
validationErrors?: ValidationError;
|
|
20
|
+
persistAsyncConfig?: PersistAsyncConfig;
|
|
20
21
|
};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import type { SchemaMapperProps } from '../types';
|
|
2
|
-
export declare const mapCommonSchemaProps: (
|
|
1
|
+
import type { MapperProps, SchemaMapperProps } from '../types';
|
|
2
|
+
export declare const mapCommonSchemaProps: (schemaMapperProps: SchemaMapperProps, mapperProps: MapperProps) => {
|
|
3
|
+
placeholder?: string | undefined;
|
|
4
|
+
help?: string | undefined;
|
|
5
|
+
uid: string;
|
|
6
|
+
id: string;
|
|
7
|
+
analyticsId: string;
|
|
8
|
+
control: string | undefined;
|
|
9
|
+
description: string | undefined;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
errors: string[];
|
|
12
|
+
keywords: string[] | undefined;
|
|
3
13
|
required: boolean;
|
|
14
|
+
title: string | undefined;
|
|
15
|
+
performPersistAsync: import("../../../features/persistAsync/getPerformPersistAsync").PerformPersistAsync | undefined;
|
|
4
16
|
summariser: (model: import("@wise/dynamic-flow-types/build/next").JsonElement) => {
|
|
5
17
|
title?: undefined;
|
|
6
18
|
description?: undefined;
|
|
@@ -12,15 +24,4 @@ export declare const mapCommonSchemaProps: ({ schema, required, validationErrors
|
|
|
12
24
|
icon: import("@wise/dynamic-flow-types/build/next").Icon | undefined;
|
|
13
25
|
image: import("@wise/dynamic-flow-types/build/next").Image | undefined;
|
|
14
26
|
};
|
|
15
|
-
title: string | undefined;
|
|
16
|
-
placeholder?: string | undefined;
|
|
17
|
-
keywords: string[] | undefined;
|
|
18
|
-
help?: string | undefined;
|
|
19
|
-
uid: string;
|
|
20
|
-
id: string;
|
|
21
|
-
analyticsId: string;
|
|
22
|
-
control: string | undefined;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
errors: string[];
|
|
26
27
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PersistAsync } from '@wise/dynamic-flow-types/build/next/feature/PersistAsync';
|
|
1
2
|
export type GetErrorMessageFunctions = (validationMessages?: ValidationMessages) => ErrorMessageFunctions;
|
|
2
3
|
export type ValidationMessages = Record<string, string | undefined>;
|
|
3
4
|
export type ErrorMessageFunctions = {
|
|
@@ -11,4 +12,6 @@ export type ErrorMessageFunctions = {
|
|
|
11
12
|
minItems: (minItems: number) => string;
|
|
12
13
|
pattern: () => string;
|
|
13
14
|
required: () => string;
|
|
15
|
+
persistAsyncError: () => string;
|
|
14
16
|
};
|
|
17
|
+
export type PersistAsyncConfig = Pick<PersistAsync, 'idProperty' | 'method' | 'param' | 'url'>;
|
|
@@ -12,13 +12,13 @@ import type { DecisionComponent } from './components/DecisionComponent';
|
|
|
12
12
|
import type { FormComponent } from './components/FormComponent';
|
|
13
13
|
import type { DividerComponent } from './components/DividerComponent';
|
|
14
14
|
import type { HeadingComponent } from './components/HeadingComponent';
|
|
15
|
-
import type { ImageComponent } from './components/ImageComponent';
|
|
16
|
-
import type { InstructionsComponent } from './components/InstructionsComponent';
|
|
17
15
|
import type { IntegerInputComponent } from './components/IntegerInputComponent';
|
|
16
|
+
import type { NumberInputComponent } from './components/NumberInputComponent';
|
|
17
|
+
import type { ImageComponent } from './components/ImageComponent';
|
|
18
18
|
import type { LoadingIndicatorComponent } from './components/LoadingIndicatorComponent';
|
|
19
19
|
import type { MarkdownComponent } from './components/MarkdownComponent';
|
|
20
|
+
import type { InstructionsComponent } from './components/InstructionsComponent';
|
|
20
21
|
import type { ModalComponent } from './components/ModalComponent';
|
|
21
|
-
import type { NumberInputComponent } from './components/NumberInputComponent';
|
|
22
22
|
import type { ObjectComponent } from './components/ObjectComponent';
|
|
23
23
|
import type { ParagraphComponent } from './components/ParagraphComponent';
|
|
24
24
|
import type { RepeatableComponent } from './components/repeatableComponent/RepeatableComponent';
|
|
@@ -32,7 +32,8 @@ export type BaseComponent<M extends Model> = {
|
|
|
32
32
|
type: string;
|
|
33
33
|
uid: string;
|
|
34
34
|
analyticsId?: string;
|
|
35
|
-
|
|
35
|
+
getSubmittableValue: () => M | null;
|
|
36
|
+
getLocalValue: () => M | null;
|
|
36
37
|
getSummary: () => RepeatableSummary;
|
|
37
38
|
validate: () => boolean;
|
|
38
39
|
};
|
|
@@ -52,10 +53,11 @@ export type InputComponent<M extends Model> = BaseComponent<M> & {
|
|
|
52
53
|
required: boolean;
|
|
53
54
|
title?: string;
|
|
54
55
|
value: M | null;
|
|
56
|
+
persistedState: PersistedState<M>;
|
|
55
57
|
onChange: (value: M | null) => void;
|
|
56
58
|
onBlur: () => void;
|
|
57
59
|
onFocus: () => void;
|
|
58
|
-
|
|
60
|
+
getLocalValue: () => M | null;
|
|
59
61
|
};
|
|
60
62
|
export type UpdateComponent = (id: string, update: (component: StepComponent) => void) => void;
|
|
61
63
|
export type OnAction = (action: Action) => void;
|
|
@@ -68,3 +70,9 @@ export type RepeatableSummary = {
|
|
|
68
70
|
icon?: Icon;
|
|
69
71
|
image?: Image;
|
|
70
72
|
};
|
|
73
|
+
export type PersistedState<M extends Model> = {
|
|
74
|
+
abortController: AbortController;
|
|
75
|
+
lastSubmitted: M | null;
|
|
76
|
+
submission: Promise<void>;
|
|
77
|
+
value: M | null;
|
|
78
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Model } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { StepComponent } from '../domain/types';
|
|
3
3
|
export declare const getSubmittableData: (components: StepComponent[]) => Model;
|
|
4
|
+
export declare const getLocalValues: (components: StepComponent[]) => Model;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type { AllOfSchema, ArraySchema, ArraySchemaList, BooleanSchema, ConstSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
1
|
+
import type { AllOfSchema, ArraySchema, ArraySchemaList, ArraySchemaTuple, BooleanSchema, ConstSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
|
|
2
2
|
import type { StepComponent } from '../domain/types';
|
|
3
3
|
import type { ColumnsComponent } from '../domain/components/ColumnsComponent';
|
|
4
4
|
import type { RepeatableComponent } from '../domain/components/repeatableComponent/RepeatableComponent';
|
|
5
|
+
import type { PersistAsync } from '@wise/dynamic-flow-types/build/next/feature/PersistAsync';
|
|
6
|
+
type SchemaWithPersistAsync = (ArraySchemaList | ArraySchemaTuple | BooleanSchema | IntegerSchema | NumberSchema | StringSchema) & {
|
|
7
|
+
persistAsync: PersistAsync;
|
|
8
|
+
};
|
|
5
9
|
export declare const hasChildren: (component: StepComponent) => component is StepComponent & {
|
|
6
10
|
getChildren: () => StepComponent[];
|
|
7
11
|
};
|
|
@@ -19,6 +23,8 @@ export declare const isOneOfSchema: (schema: Schema) => schema is OneOfSchema;
|
|
|
19
23
|
export declare const isArraySchema: (schema: Schema) => schema is ArraySchema;
|
|
20
24
|
export declare const isArrayListSchema: (schema: Schema) => schema is ArraySchemaList;
|
|
21
25
|
export declare const isStringSchema: (schema: Schema) => schema is StringSchema;
|
|
26
|
+
export declare const isSchemaWithPersistAsync: (schema: Schema) => schema is SchemaWithPersistAsync;
|
|
22
27
|
export declare const isHiddenSchema: (schema: Schema) => schema is Schema & {
|
|
23
28
|
hidden: true;
|
|
24
29
|
};
|
|
30
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Step } from '@wise/dynamic-flow-types';
|
|
2
2
|
type HttpClient = typeof fetch;
|
|
3
3
|
/**
|
|
4
4
|
* Returns a mock http client you can use in your DynamicFlow.
|
|
@@ -11,7 +11,7 @@ type HttpClient = typeof fetch;
|
|
|
11
11
|
* })
|
|
12
12
|
*/
|
|
13
13
|
export declare const getMockHttpClient: (handlers: Record<string, HttpClient | undefined>) => HttpClient;
|
|
14
|
-
export declare const respondWith: (
|
|
14
|
+
export declare const respondWith: (data: unknown, init?: ResponseInit) => Promise<Response>;
|
|
15
15
|
export declare const respondWithEtag: (step: Step) => Promise<Response>;
|
|
16
16
|
export declare const respondWithEmptyOk: () => Promise<Response>;
|
|
17
17
|
export declare const respondWithEmptyAndEtag: (step: Step) => Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { StepComponent } from '../types';
|
|
2
|
-
import type { IsInvalidCheck } from '../features/validation/value-checks';
|
|
3
|
-
export declare const validateComponents: (components: StepComponent[]) => boolean;
|
|
4
|
-
export declare const getModelValidationErrors: <M extends import("@wise/dynamic-flow-types/build/next").JsonElement>({ checks, model, }: {
|
|
5
|
-
checks: IsInvalidCheck<M>[];
|
|
6
|
-
model: M;
|
|
7
|
-
}) => string[];
|
|
File without changes
|