@wise/dynamic-flow-client 3.18.1 → 3.19.1-experimental-6810eca
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 +462 -367
- package/build/main.min.js +1 -1
- package/build/main.mjs +462 -367
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +3 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +3 -1
- package/build/types/revamp/domain/features/polling/getStepPolling.d.ts +3 -4
- package/build/types/revamp/domain/mappers/mapStepToComponent.d.ts +3 -2
- package/build/types/revamp/domain/types.d.ts +1 -0
- package/build/types/revamp/flow/executePoll.d.ts +21 -0
- package/build/types/revamp/flow/getResponseType.d.ts +1 -0
- package/package.json +4 -4
package/build/main.mjs
CHANGED
|
@@ -1598,6 +1598,8 @@ var instructionsComponentToProps = ({
|
|
|
1598
1598
|
|
|
1599
1599
|
// src/revamp/renderers/mappers/integerInputComponentToProps.ts
|
|
1600
1600
|
var integerInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-integer")), {
|
|
1601
|
+
maximum: component.maximum,
|
|
1602
|
+
minimum: component.minimum,
|
|
1601
1603
|
onChange: component.onChange.bind(component)
|
|
1602
1604
|
});
|
|
1603
1605
|
|
|
@@ -1661,6 +1663,8 @@ var multiUploadInputComponentToProps = (component) => {
|
|
|
1661
1663
|
|
|
1662
1664
|
// src/revamp/renderers/mappers/numberInputComponentToProps.ts
|
|
1663
1665
|
var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-number")), {
|
|
1666
|
+
maximum: component.maximum,
|
|
1667
|
+
minimum: component.minimum,
|
|
1664
1668
|
onChange: component.onChange.bind(component)
|
|
1665
1669
|
});
|
|
1666
1670
|
|
|
@@ -1697,6 +1701,8 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1697
1701
|
description,
|
|
1698
1702
|
editItemTitle,
|
|
1699
1703
|
errors,
|
|
1704
|
+
maxItems,
|
|
1705
|
+
minItems,
|
|
1700
1706
|
summaryDefaults,
|
|
1701
1707
|
title = "",
|
|
1702
1708
|
onEdit,
|
|
@@ -1719,13 +1725,15 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
|
|
|
1719
1725
|
return {
|
|
1720
1726
|
type: "repeatable",
|
|
1721
1727
|
children,
|
|
1728
|
+
addItemTitle,
|
|
1722
1729
|
control,
|
|
1723
|
-
items: itemProps,
|
|
1724
|
-
editableItem: editableItemChildren,
|
|
1725
|
-
title,
|
|
1726
1730
|
description,
|
|
1727
|
-
|
|
1731
|
+
editableItem: editableItemChildren,
|
|
1728
1732
|
editItemTitle,
|
|
1733
|
+
items: itemProps,
|
|
1734
|
+
maxItems,
|
|
1735
|
+
minItems,
|
|
1736
|
+
title,
|
|
1729
1737
|
error: errors[0],
|
|
1730
1738
|
onAdd: onAdd.bind(component),
|
|
1731
1739
|
onEdit: onEdit.bind(component),
|
|
@@ -1834,14 +1842,18 @@ var statusListComponentToProps = ({
|
|
|
1834
1842
|
// src/revamp/renderers/mappers/textInputComponentToProps.ts
|
|
1835
1843
|
var textInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-text")), {
|
|
1836
1844
|
displayFormat: component.displayFormat,
|
|
1845
|
+
maxLength: component.maxLength,
|
|
1846
|
+
minLength: component.minLength,
|
|
1837
1847
|
onChange: component.onChange.bind(component)
|
|
1838
1848
|
});
|
|
1839
1849
|
|
|
1840
1850
|
// src/revamp/renderers/mappers/multiSelectComponentToProps.ts
|
|
1841
1851
|
var multiSelectInputComponentToProps = (component) => {
|
|
1842
|
-
const { options, selectedIndices, onSelect } = component;
|
|
1843
|
-
const _a = inputComponentToProps(component, "input-multi-select"), { value } = _a, props = __objRest(_a, ["value"]);
|
|
1852
|
+
const { maxItems, minItems, options, selectedIndices, onSelect } = component;
|
|
1853
|
+
const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
|
|
1844
1854
|
return __spreadProps(__spreadValues({}, props), {
|
|
1855
|
+
maxItems,
|
|
1856
|
+
minItems,
|
|
1845
1857
|
options,
|
|
1846
1858
|
selectedIndices,
|
|
1847
1859
|
onSelect: onSelect.bind(component)
|
|
@@ -5815,21 +5827,13 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5815
5827
|
quotelessJson,
|
|
5816
5828
|
ZodError
|
|
5817
5829
|
});
|
|
5818
|
-
var
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
z.literal("GET"),
|
|
5825
|
-
z.literal("POST"),
|
|
5826
|
-
z.literal("PUT"),
|
|
5827
|
-
z.literal("PATCH"),
|
|
5828
|
-
z.literal("DELETE")
|
|
5830
|
+
var sizeSchema = z.union([
|
|
5831
|
+
z.literal("xs"),
|
|
5832
|
+
z.literal("sm"),
|
|
5833
|
+
z.literal("md"),
|
|
5834
|
+
z.literal("lg"),
|
|
5835
|
+
z.literal("xl")
|
|
5829
5836
|
]);
|
|
5830
|
-
var iconNamedSchema = z.object({
|
|
5831
|
-
name: z.string()
|
|
5832
|
-
});
|
|
5833
5837
|
var contextSchema = z.union([
|
|
5834
5838
|
z.literal("positive"),
|
|
5835
5839
|
z.literal("neutral"),
|
|
@@ -5840,18 +5844,107 @@ var contextSchema = z.union([
|
|
|
5840
5844
|
z.literal("info"),
|
|
5841
5845
|
z.literal("primary")
|
|
5842
5846
|
]);
|
|
5843
|
-
var
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
z.literal("
|
|
5850
|
-
z.literal("
|
|
5851
|
-
z.literal("
|
|
5847
|
+
var columnsLayoutBiasSchema = z.union([
|
|
5848
|
+
z.literal("none"),
|
|
5849
|
+
z.literal("left"),
|
|
5850
|
+
z.literal("right")
|
|
5851
|
+
]);
|
|
5852
|
+
var statusListLayoutStatusSchema = z.union([
|
|
5853
|
+
z.literal("not-done"),
|
|
5854
|
+
z.literal("pending"),
|
|
5855
|
+
z.literal("done")
|
|
5852
5856
|
]);
|
|
5853
5857
|
var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
|
|
5854
|
-
var
|
|
5858
|
+
var formLayoutSchemaReferenceSchema = z.object({
|
|
5859
|
+
$ref: z.string()
|
|
5860
|
+
});
|
|
5861
|
+
var modalLayoutTriggerSchema = z.object({
|
|
5862
|
+
title: z.string()
|
|
5863
|
+
});
|
|
5864
|
+
var httpMethodSchema = z.union([
|
|
5865
|
+
z.literal("GET"),
|
|
5866
|
+
z.literal("POST"),
|
|
5867
|
+
z.literal("PUT"),
|
|
5868
|
+
z.literal("PATCH"),
|
|
5869
|
+
z.literal("DELETE")
|
|
5870
|
+
]);
|
|
5871
|
+
var dividerLayoutSchema = z.object({
|
|
5872
|
+
type: z.literal("divider"),
|
|
5873
|
+
control: z.string().optional(),
|
|
5874
|
+
margin: sizeSchema.optional()
|
|
5875
|
+
});
|
|
5876
|
+
var listLayoutStatusSchema = z.union([
|
|
5877
|
+
z.literal("warning"),
|
|
5878
|
+
z.literal("neutral"),
|
|
5879
|
+
z.literal("positive")
|
|
5880
|
+
]);
|
|
5881
|
+
var headingLayoutSchema = z.object({
|
|
5882
|
+
type: z.literal("heading"),
|
|
5883
|
+
text: z.string(),
|
|
5884
|
+
size: sizeSchema.optional(),
|
|
5885
|
+
align: alignSchema.optional(),
|
|
5886
|
+
control: z.string().optional(),
|
|
5887
|
+
margin: sizeSchema.optional()
|
|
5888
|
+
});
|
|
5889
|
+
var formLayoutSchema = z.object({
|
|
5890
|
+
type: z.literal("form"),
|
|
5891
|
+
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
5892
|
+
schemaId: z.string(),
|
|
5893
|
+
control: z.string().optional(),
|
|
5894
|
+
margin: sizeSchema.optional()
|
|
5895
|
+
});
|
|
5896
|
+
var imageLayoutSchema = z.object({
|
|
5897
|
+
type: z.literal("image"),
|
|
5898
|
+
text: z.string().optional(),
|
|
5899
|
+
url: z.string(),
|
|
5900
|
+
size: sizeSchema.optional(),
|
|
5901
|
+
accessibilityDescription: z.string().optional(),
|
|
5902
|
+
control: z.string().optional(),
|
|
5903
|
+
margin: sizeSchema.optional()
|
|
5904
|
+
});
|
|
5905
|
+
var infoLayoutSchema = z.object({
|
|
5906
|
+
type: z.literal("info"),
|
|
5907
|
+
markdown: z.string(),
|
|
5908
|
+
align: alignSchema.optional(),
|
|
5909
|
+
control: z.string().optional(),
|
|
5910
|
+
margin: sizeSchema.optional()
|
|
5911
|
+
});
|
|
5912
|
+
var loadingIndicatorLayoutSchema = z.object({
|
|
5913
|
+
type: z.literal("loading-indicator"),
|
|
5914
|
+
size: sizeSchema.optional(),
|
|
5915
|
+
control: z.string().optional(),
|
|
5916
|
+
margin: sizeSchema.optional()
|
|
5917
|
+
});
|
|
5918
|
+
var paragraphLayoutSchema = z.object({
|
|
5919
|
+
type: z.literal("paragraph"),
|
|
5920
|
+
text: z.string(),
|
|
5921
|
+
align: alignSchema.optional(),
|
|
5922
|
+
control: z.string().optional(),
|
|
5923
|
+
margin: sizeSchema.optional()
|
|
5924
|
+
});
|
|
5925
|
+
var instructionsLayoutItemSchema = z.object({
|
|
5926
|
+
text: z.string(),
|
|
5927
|
+
context: contextSchema
|
|
5928
|
+
});
|
|
5929
|
+
var helpSchema = z.object({
|
|
5930
|
+
markdown: z.string()
|
|
5931
|
+
});
|
|
5932
|
+
var imageSchema = z.object({
|
|
5933
|
+
text: z.string().optional(),
|
|
5934
|
+
url: z.string(),
|
|
5935
|
+
accessibilityDescription: z.string().optional()
|
|
5936
|
+
});
|
|
5937
|
+
var summaryProviderSchema = z.object({
|
|
5938
|
+
providesTitle: z.boolean().optional(),
|
|
5939
|
+
providesDescription: z.boolean().optional(),
|
|
5940
|
+
providesIcon: z.boolean().optional(),
|
|
5941
|
+
providesImage: z.boolean().optional()
|
|
5942
|
+
});
|
|
5943
|
+
var validateAsyncSchema = z.object({
|
|
5944
|
+
param: z.string(),
|
|
5945
|
+
method: httpMethodSchema,
|
|
5946
|
+
url: z.string()
|
|
5947
|
+
});
|
|
5855
5948
|
var autocompleteTokenSchema = z.union([
|
|
5856
5949
|
z.literal("on"),
|
|
5857
5950
|
z.literal("name"),
|
|
@@ -5917,106 +6010,14 @@ var autocompleteTokenSchema = z.union([
|
|
|
5917
6010
|
z.literal("fax"),
|
|
5918
6011
|
z.literal("pager")
|
|
5919
6012
|
]);
|
|
5920
|
-
var
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
type: z.literal("paragraph"),
|
|
5928
|
-
text: z.string(),
|
|
5929
|
-
align: alignSchema.optional(),
|
|
5930
|
-
control: z.string().optional(),
|
|
5931
|
-
margin: sizeSchema.optional()
|
|
5932
|
-
});
|
|
5933
|
-
var dividerLayoutSchema = z.object({
|
|
5934
|
-
type: z.literal("divider"),
|
|
5935
|
-
control: z.string().optional(),
|
|
5936
|
-
margin: sizeSchema.optional()
|
|
5937
|
-
});
|
|
5938
|
-
var listLayoutStatusSchema = z.union([
|
|
5939
|
-
z.literal("warning"),
|
|
5940
|
-
z.literal("neutral"),
|
|
5941
|
-
z.literal("positive")
|
|
5942
|
-
]);
|
|
5943
|
-
var formLayoutSchemaReferenceSchema = z.object({
|
|
5944
|
-
$ref: z.string()
|
|
5945
|
-
});
|
|
5946
|
-
var imageLayoutSchema = z.object({
|
|
5947
|
-
type: z.literal("image"),
|
|
5948
|
-
text: z.string().optional(),
|
|
5949
|
-
url: z.string(),
|
|
5950
|
-
size: sizeSchema.optional(),
|
|
5951
|
-
accessibilityDescription: z.string().optional(),
|
|
5952
|
-
control: z.string().optional(),
|
|
5953
|
-
margin: sizeSchema.optional()
|
|
5954
|
-
});
|
|
5955
|
-
var statusListLayoutStatusSchema = z.union([
|
|
5956
|
-
z.literal("not-done"),
|
|
5957
|
-
z.literal("pending"),
|
|
5958
|
-
z.literal("done")
|
|
5959
|
-
]);
|
|
5960
|
-
var instructionsLayoutItemSchema = z.object({
|
|
5961
|
-
text: z.string(),
|
|
5962
|
-
context: contextSchema
|
|
5963
|
-
});
|
|
5964
|
-
var modalLayoutTriggerSchema = z.object({
|
|
5965
|
-
title: z.string()
|
|
5966
|
-
});
|
|
5967
|
-
var searchLayoutSchema = z.object({
|
|
5968
|
-
type: z.literal("search"),
|
|
5969
|
-
title: z.string(),
|
|
5970
|
-
method: httpMethodSchema,
|
|
5971
|
-
url: z.string(),
|
|
5972
|
-
param: z.string(),
|
|
5973
|
-
emptyMessage: z.string().optional(),
|
|
5974
|
-
control: z.string().optional(),
|
|
5975
|
-
margin: sizeSchema.optional()
|
|
5976
|
-
});
|
|
5977
|
-
var infoLayoutSchema = z.object({
|
|
5978
|
-
type: z.literal("info"),
|
|
5979
|
-
markdown: z.string(),
|
|
5980
|
-
align: alignSchema.optional(),
|
|
5981
|
-
control: z.string().optional(),
|
|
5982
|
-
margin: sizeSchema.optional()
|
|
5983
|
-
});
|
|
5984
|
-
var formLayoutSchema = z.object({
|
|
5985
|
-
type: z.literal("form"),
|
|
5986
|
-
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
5987
|
-
schemaId: z.string(),
|
|
5988
|
-
control: z.string().optional(),
|
|
5989
|
-
margin: sizeSchema.optional()
|
|
5990
|
-
});
|
|
5991
|
-
var headingLayoutSchema = z.object({
|
|
5992
|
-
type: z.literal("heading"),
|
|
5993
|
-
text: z.string(),
|
|
5994
|
-
size: sizeSchema.optional(),
|
|
5995
|
-
align: alignSchema.optional(),
|
|
5996
|
-
control: z.string().optional(),
|
|
5997
|
-
margin: sizeSchema.optional()
|
|
5998
|
-
});
|
|
5999
|
-
var markdownLayoutSchema = z.object({
|
|
6000
|
-
type: z.literal("markdown"),
|
|
6001
|
-
content: z.string(),
|
|
6002
|
-
align: alignSchema.optional(),
|
|
6003
|
-
control: z.string().optional(),
|
|
6004
|
-
margin: sizeSchema.optional()
|
|
6005
|
-
});
|
|
6006
|
-
var columnsLayoutBiasSchema = z.union([
|
|
6007
|
-
z.literal("none"),
|
|
6008
|
-
z.literal("left"),
|
|
6009
|
-
z.literal("right")
|
|
6013
|
+
var stringSchemaFormatSchema = z.union([
|
|
6014
|
+
z.literal("date"),
|
|
6015
|
+
z.literal("email"),
|
|
6016
|
+
z.literal("numeric"),
|
|
6017
|
+
z.literal("password"),
|
|
6018
|
+
z.literal("phone-number"),
|
|
6019
|
+
z.literal("base64url")
|
|
6010
6020
|
]);
|
|
6011
|
-
var helpSchema = z.object({
|
|
6012
|
-
markdown: z.string()
|
|
6013
|
-
});
|
|
6014
|
-
var searchSearchRequestSchema = z.object({
|
|
6015
|
-
url: z.string(),
|
|
6016
|
-
method: httpMethodSchema,
|
|
6017
|
-
param: z.string(),
|
|
6018
|
-
query: z.string()
|
|
6019
|
-
});
|
|
6020
6021
|
var jsonElementSchema = z.lazy(
|
|
6021
6022
|
() => z.union([
|
|
6022
6023
|
z.string(),
|
|
@@ -6026,6 +6027,7 @@ var jsonElementSchema = z.lazy(
|
|
|
6026
6027
|
z.array(jsonElementSchema)
|
|
6027
6028
|
]).nullable()
|
|
6028
6029
|
);
|
|
6030
|
+
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
6029
6031
|
var externalSchema = z.object({
|
|
6030
6032
|
url: z.string()
|
|
6031
6033
|
});
|
|
@@ -6033,42 +6035,28 @@ var stepErrorSchema = z.object({
|
|
|
6033
6035
|
error: z.string().optional(),
|
|
6034
6036
|
validation: jsonElementSchema.optional()
|
|
6035
6037
|
});
|
|
6036
|
-
var
|
|
6037
|
-
z.
|
|
6038
|
-
z.
|
|
6039
|
-
z.
|
|
6040
|
-
|
|
6041
|
-
z.
|
|
6042
|
-
z.literal("base64url")
|
|
6043
|
-
]);
|
|
6044
|
-
var summarySummariserSchema = z.object({
|
|
6045
|
-
defaultTitle: z.string().optional(),
|
|
6046
|
-
defaultDescription: z.string().optional(),
|
|
6047
|
-
defaultIcon: iconSchema.optional(),
|
|
6048
|
-
defaultImage: imageLayoutSchema.optional(),
|
|
6049
|
-
providesTitle: z.boolean().optional(),
|
|
6050
|
-
providesDescription: z.boolean().optional(),
|
|
6051
|
-
providesIcon: z.boolean().optional(),
|
|
6052
|
-
providesImage: z.boolean().optional()
|
|
6038
|
+
var errorResponseBodySchema = z.object({
|
|
6039
|
+
refreshFormUrl: z.string().optional(),
|
|
6040
|
+
analytics: z.record(z.string()).optional(),
|
|
6041
|
+
error: z.string().optional(),
|
|
6042
|
+
validation: jsonElementSchema.optional(),
|
|
6043
|
+
refreshUrl: z.string().optional()
|
|
6053
6044
|
});
|
|
6054
|
-
var
|
|
6055
|
-
|
|
6045
|
+
var searchSearchRequestSchema = z.object({
|
|
6046
|
+
url: z.string(),
|
|
6056
6047
|
method: httpMethodSchema,
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
var summaryProviderSchema = z.object({
|
|
6060
|
-
providesTitle: z.boolean().optional(),
|
|
6061
|
-
providesDescription: z.boolean().optional(),
|
|
6062
|
-
providesIcon: z.boolean().optional(),
|
|
6063
|
-
providesImage: z.boolean().optional()
|
|
6048
|
+
param: z.string(),
|
|
6049
|
+
query: z.string()
|
|
6064
6050
|
});
|
|
6065
|
-
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
6066
6051
|
var navigationStackBehaviorSchema = z.union([
|
|
6067
6052
|
z.literal("default"),
|
|
6068
6053
|
z.literal("remove-previous"),
|
|
6069
6054
|
z.literal("remove-all"),
|
|
6070
6055
|
z.literal("replace-current")
|
|
6071
6056
|
]);
|
|
6057
|
+
var linkSchema = z.object({
|
|
6058
|
+
url: z.string()
|
|
6059
|
+
});
|
|
6072
6060
|
var actionTypeSchema = z.union([
|
|
6073
6061
|
z.literal("primary"),
|
|
6074
6062
|
z.literal("secondary"),
|
|
@@ -6076,9 +6064,11 @@ var actionTypeSchema = z.union([
|
|
|
6076
6064
|
z.literal("positive"),
|
|
6077
6065
|
z.literal("negative")
|
|
6078
6066
|
]);
|
|
6079
|
-
var
|
|
6080
|
-
|
|
6081
|
-
|
|
6067
|
+
var iconNamedSchema = z.object({
|
|
6068
|
+
name: z.string()
|
|
6069
|
+
});
|
|
6070
|
+
var iconTextSchema = z.object({
|
|
6071
|
+
text: z.string()
|
|
6082
6072
|
});
|
|
6083
6073
|
var actionSchema = z.object({
|
|
6084
6074
|
title: z.string().optional(),
|
|
@@ -6095,25 +6085,26 @@ var actionSchema = z.object({
|
|
|
6095
6085
|
timeout: z.number().optional(),
|
|
6096
6086
|
skipValidation: z.boolean().optional()
|
|
6097
6087
|
});
|
|
6098
|
-
var
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6088
|
+
var markdownLayoutSchema = z.object({
|
|
6089
|
+
type: z.literal("markdown"),
|
|
6090
|
+
content: z.string(),
|
|
6091
|
+
align: alignSchema.optional(),
|
|
6092
|
+
control: z.string().optional(),
|
|
6093
|
+
margin: sizeSchema.optional()
|
|
6103
6094
|
});
|
|
6104
|
-
var
|
|
6105
|
-
|
|
6095
|
+
var searchLayoutSchema = z.object({
|
|
6096
|
+
type: z.literal("search"),
|
|
6106
6097
|
title: z.string(),
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6098
|
+
method: httpMethodSchema,
|
|
6099
|
+
url: z.string(),
|
|
6100
|
+
param: z.string(),
|
|
6101
|
+
emptyMessage: z.string().optional(),
|
|
6102
|
+
control: z.string().optional(),
|
|
6103
|
+
margin: sizeSchema.optional()
|
|
6111
6104
|
});
|
|
6112
|
-
var
|
|
6105
|
+
var reviewLayoutCallToActionSchema = z.object({
|
|
6113
6106
|
title: z.string(),
|
|
6114
|
-
|
|
6115
|
-
icon: iconSchema,
|
|
6116
|
-
status: statusListLayoutStatusSchema.optional()
|
|
6107
|
+
action: actionSchema
|
|
6117
6108
|
});
|
|
6118
6109
|
var instructionsLayoutSchema = z.object({
|
|
6119
6110
|
type: z.literal("instructions"),
|
|
@@ -6122,26 +6113,39 @@ var instructionsLayoutSchema = z.object({
|
|
|
6122
6113
|
control: z.string().optional(),
|
|
6123
6114
|
margin: sizeSchema.optional()
|
|
6124
6115
|
});
|
|
6125
|
-
var
|
|
6126
|
-
type: z.literal("button"),
|
|
6127
|
-
size: sizeSchema.optional(),
|
|
6128
|
-
title: z.string().optional(),
|
|
6129
|
-
action: actionSchema,
|
|
6130
|
-
context: contextSchema.optional(),
|
|
6131
|
-
disabled: z.boolean().optional(),
|
|
6132
|
-
pinOrder: z.number().optional(),
|
|
6133
|
-
control: z.string().optional(),
|
|
6134
|
-
margin: sizeSchema.optional()
|
|
6135
|
-
});
|
|
6116
|
+
var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
6136
6117
|
var reviewLayoutFieldSchema = z.object({
|
|
6137
6118
|
label: z.string(),
|
|
6138
6119
|
value: z.string(),
|
|
6139
6120
|
help: helpSchema.optional()
|
|
6140
6121
|
});
|
|
6122
|
+
var statusListLayoutItemSchema = z.object({
|
|
6123
|
+
title: z.string(),
|
|
6124
|
+
description: z.string().optional(),
|
|
6125
|
+
icon: iconSchema,
|
|
6126
|
+
status: statusListLayoutStatusSchema.optional()
|
|
6127
|
+
});
|
|
6141
6128
|
var behaviorSchema = z.object({
|
|
6142
6129
|
action: actionSchema.optional(),
|
|
6143
6130
|
link: linkSchema.optional()
|
|
6144
6131
|
});
|
|
6132
|
+
var summarySummariserSchema = z.object({
|
|
6133
|
+
defaultTitle: z.string().optional(),
|
|
6134
|
+
defaultDescription: z.string().optional(),
|
|
6135
|
+
defaultIcon: iconSchema.optional(),
|
|
6136
|
+
defaultImage: imageLayoutSchema.optional(),
|
|
6137
|
+
providesTitle: z.boolean().optional(),
|
|
6138
|
+
providesDescription: z.boolean().optional(),
|
|
6139
|
+
providesIcon: z.boolean().optional(),
|
|
6140
|
+
providesImage: z.boolean().optional()
|
|
6141
|
+
});
|
|
6142
|
+
var linkHandlerSchema = z.object({
|
|
6143
|
+
regexPattern: z.string(),
|
|
6144
|
+
action: actionSchema
|
|
6145
|
+
});
|
|
6146
|
+
var actionResponseBodySchema = z.object({
|
|
6147
|
+
action: actionSchema
|
|
6148
|
+
});
|
|
6145
6149
|
var searchResultSearchSchema = z.object({
|
|
6146
6150
|
type: z.literal("search"),
|
|
6147
6151
|
title: z.string(),
|
|
@@ -6158,20 +6162,6 @@ var searchResultActionSchema = z.object({
|
|
|
6158
6162
|
image: imageLayoutSchema.optional(),
|
|
6159
6163
|
value: actionSchema
|
|
6160
6164
|
});
|
|
6161
|
-
var actionResponseBodySchema = z.object({
|
|
6162
|
-
action: actionSchema
|
|
6163
|
-
});
|
|
6164
|
-
var errorResponseBodySchema = z.object({
|
|
6165
|
-
refreshFormUrl: z.string().optional(),
|
|
6166
|
-
analytics: z.record(z.string()).optional(),
|
|
6167
|
-
error: z.string().optional(),
|
|
6168
|
-
validation: jsonElementSchema.optional(),
|
|
6169
|
-
refreshUrl: z.string().optional()
|
|
6170
|
-
});
|
|
6171
|
-
var linkHandlerSchema = z.object({
|
|
6172
|
-
regexPattern: z.string(),
|
|
6173
|
-
action: actionSchema
|
|
6174
|
-
});
|
|
6175
6165
|
var pollingOnErrorSchema = z.object({
|
|
6176
6166
|
action: actionSchema
|
|
6177
6167
|
});
|
|
@@ -6179,26 +6169,33 @@ var navigationBackBehaviorSchema = z.object({
|
|
|
6179
6169
|
title: z.string().optional(),
|
|
6180
6170
|
action: actionSchema
|
|
6181
6171
|
});
|
|
6182
|
-
var
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
var alertLayoutCallToActionSchema = z.object({
|
|
6187
|
-
title: z.string(),
|
|
6188
|
-
accessibilityDescription: z.string().optional(),
|
|
6189
|
-
behavior: behaviorSchema
|
|
6190
|
-
});
|
|
6191
|
-
var listLayoutSchema = z.object({
|
|
6192
|
-
type: z.literal("list"),
|
|
6193
|
-
items: z.array(listLayoutItemSchema),
|
|
6172
|
+
var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
6173
|
+
var buttonLayoutSchema = z.object({
|
|
6174
|
+
type: z.literal("button"),
|
|
6175
|
+
size: sizeSchema.optional(),
|
|
6194
6176
|
title: z.string().optional(),
|
|
6177
|
+
action: actionSchema,
|
|
6178
|
+
context: contextSchema.optional(),
|
|
6179
|
+
disabled: z.boolean().optional(),
|
|
6180
|
+
pinOrder: z.number().optional(),
|
|
6195
6181
|
control: z.string().optional(),
|
|
6196
6182
|
margin: sizeSchema.optional()
|
|
6197
6183
|
});
|
|
6198
|
-
var
|
|
6199
|
-
|
|
6184
|
+
var decisionLayoutOptionSchema = z.object({
|
|
6185
|
+
action: actionSchema,
|
|
6186
|
+
title: z.string(),
|
|
6187
|
+
description: z.string().optional(),
|
|
6188
|
+
disabled: z.boolean().optional(),
|
|
6189
|
+
icon: iconSchema.optional(),
|
|
6190
|
+
image: imageLayoutSchema.optional()
|
|
6191
|
+
});
|
|
6192
|
+
var reviewLayoutSchema = z.object({
|
|
6193
|
+
type: z.literal("review"),
|
|
6194
|
+
orientation: z.string().optional(),
|
|
6195
|
+
action: actionSchema.optional(),
|
|
6196
|
+
fields: z.array(reviewLayoutFieldSchema),
|
|
6200
6197
|
title: z.string().optional(),
|
|
6201
|
-
|
|
6198
|
+
callToAction: reviewLayoutCallToActionSchema.optional(),
|
|
6202
6199
|
control: z.string().optional(),
|
|
6203
6200
|
margin: sizeSchema.optional()
|
|
6204
6201
|
});
|
|
@@ -6209,17 +6206,17 @@ var statusListLayoutSchema = z.object({
|
|
|
6209
6206
|
control: z.string().optional(),
|
|
6210
6207
|
margin: sizeSchema.optional()
|
|
6211
6208
|
});
|
|
6212
|
-
var
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6209
|
+
var listLayoutItemSchema = z.object({
|
|
6210
|
+
title: z.string(),
|
|
6211
|
+
description: z.string().optional(),
|
|
6212
|
+
icon: iconSchema,
|
|
6213
|
+
status: listLayoutStatusSchema.optional()
|
|
6214
|
+
});
|
|
6215
|
+
var alertLayoutCallToActionSchema = z.object({
|
|
6216
|
+
title: z.string(),
|
|
6217
|
+
accessibilityDescription: z.string().optional(),
|
|
6218
|
+
behavior: behaviorSchema
|
|
6221
6219
|
});
|
|
6222
|
-
var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
6223
6220
|
var pollingSchema = z.object({
|
|
6224
6221
|
url: z.string(),
|
|
6225
6222
|
interval: z.number().optional(),
|
|
@@ -6233,6 +6230,14 @@ var navigationSchema = z.object({
|
|
|
6233
6230
|
back: navigationBackBehaviorSchema.optional(),
|
|
6234
6231
|
stackBehavior: navigationStackBehaviorSchema.optional()
|
|
6235
6232
|
});
|
|
6233
|
+
var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
6234
|
+
var decisionLayoutSchema = z.object({
|
|
6235
|
+
type: z.literal("decision"),
|
|
6236
|
+
title: z.string().optional(),
|
|
6237
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
6238
|
+
control: z.string().optional(),
|
|
6239
|
+
margin: sizeSchema.optional()
|
|
6240
|
+
});
|
|
6236
6241
|
var alertLayoutSchema = z.object({
|
|
6237
6242
|
type: z.literal("alert"),
|
|
6238
6243
|
markdown: z.string(),
|
|
@@ -6241,8 +6246,12 @@ var alertLayoutSchema = z.object({
|
|
|
6241
6246
|
margin: sizeSchema.optional(),
|
|
6242
6247
|
callToAction: alertLayoutCallToActionSchema.optional()
|
|
6243
6248
|
});
|
|
6244
|
-
var
|
|
6245
|
-
|
|
6249
|
+
var listLayoutSchema = z.object({
|
|
6250
|
+
type: z.literal("list"),
|
|
6251
|
+
items: z.array(listLayoutItemSchema),
|
|
6252
|
+
title: z.string().optional(),
|
|
6253
|
+
control: z.string().optional(),
|
|
6254
|
+
margin: sizeSchema.optional()
|
|
6246
6255
|
});
|
|
6247
6256
|
var blobSchemaSchema = z.object({
|
|
6248
6257
|
type: z.literal("blob"),
|
|
@@ -6282,6 +6291,19 @@ var constSchemaSchema = z.object({
|
|
|
6282
6291
|
analyticsId: z.string().optional(),
|
|
6283
6292
|
disabled: z.boolean().optional()
|
|
6284
6293
|
});
|
|
6294
|
+
var searchResponseBodySchema = z.object({
|
|
6295
|
+
results: z.array(searchResultSchema)
|
|
6296
|
+
});
|
|
6297
|
+
var columnsLayoutSchema = z.lazy(
|
|
6298
|
+
() => z.object({
|
|
6299
|
+
type: z.literal("columns"),
|
|
6300
|
+
left: z.array(layoutSchema),
|
|
6301
|
+
right: z.array(layoutSchema),
|
|
6302
|
+
bias: columnsLayoutBiasSchema.optional(),
|
|
6303
|
+
control: z.string().optional(),
|
|
6304
|
+
margin: sizeSchema.optional()
|
|
6305
|
+
})
|
|
6306
|
+
);
|
|
6285
6307
|
var layoutSchema = z.lazy(
|
|
6286
6308
|
() => z.union([
|
|
6287
6309
|
alertLayoutSchema,
|
|
@@ -6298,32 +6320,12 @@ var layoutSchema = z.lazy(
|
|
|
6298
6320
|
listLayoutSchema,
|
|
6299
6321
|
loadingIndicatorLayoutSchema,
|
|
6300
6322
|
markdownLayoutSchema,
|
|
6301
|
-
modalLayoutSchema,
|
|
6302
|
-
paragraphLayoutSchema,
|
|
6303
|
-
reviewLayoutSchema,
|
|
6304
|
-
searchLayoutSchema,
|
|
6305
|
-
statusListLayoutSchema
|
|
6306
|
-
])
|
|
6307
|
-
);
|
|
6308
|
-
var boxLayoutSchema = z.lazy(
|
|
6309
|
-
() => z.object({
|
|
6310
|
-
type: z.literal("box"),
|
|
6311
|
-
components: z.array(layoutSchema),
|
|
6312
|
-
width: sizeSchema.optional(),
|
|
6313
|
-
border: z.boolean().optional(),
|
|
6314
|
-
control: z.string().optional(),
|
|
6315
|
-
margin: sizeSchema.optional()
|
|
6316
|
-
})
|
|
6317
|
-
);
|
|
6318
|
-
var columnsLayoutSchema = z.lazy(
|
|
6319
|
-
() => z.object({
|
|
6320
|
-
type: z.literal("columns"),
|
|
6321
|
-
left: z.array(layoutSchema),
|
|
6322
|
-
right: z.array(layoutSchema),
|
|
6323
|
-
bias: columnsLayoutBiasSchema.optional(),
|
|
6324
|
-
control: z.string().optional(),
|
|
6325
|
-
margin: sizeSchema.optional()
|
|
6326
|
-
})
|
|
6323
|
+
modalLayoutSchema,
|
|
6324
|
+
paragraphLayoutSchema,
|
|
6325
|
+
reviewLayoutSchema,
|
|
6326
|
+
searchLayoutSchema,
|
|
6327
|
+
statusListLayoutSchema
|
|
6328
|
+
])
|
|
6327
6329
|
);
|
|
6328
6330
|
var modalLayoutSchema = z.lazy(
|
|
6329
6331
|
() => z.object({
|
|
@@ -6340,25 +6342,14 @@ var modalLayoutContentSchema = z.lazy(
|
|
|
6340
6342
|
components: z.array(layoutSchema)
|
|
6341
6343
|
})
|
|
6342
6344
|
);
|
|
6343
|
-
var
|
|
6345
|
+
var boxLayoutSchema = z.lazy(
|
|
6344
6346
|
() => z.object({
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
schemas: z.array(schemaSchema),
|
|
6352
|
-
layout: z.array(layoutSchema),
|
|
6353
|
-
description: z.string().optional(),
|
|
6354
|
-
model: jsonElementSchema.optional(),
|
|
6355
|
-
external: externalSchema.optional(),
|
|
6356
|
-
polling: pollingSchema.optional(),
|
|
6357
|
-
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
6358
|
-
analytics: z.record(z.string()).optional(),
|
|
6359
|
-
errors: stepErrorSchema.optional(),
|
|
6360
|
-
navigation: navigationSchema.optional(),
|
|
6361
|
-
refreshUrl: z.string().optional()
|
|
6347
|
+
type: z.literal("box"),
|
|
6348
|
+
components: z.array(layoutSchema),
|
|
6349
|
+
width: sizeSchema.optional(),
|
|
6350
|
+
border: z.boolean().optional(),
|
|
6351
|
+
control: z.string().optional(),
|
|
6352
|
+
margin: sizeSchema.optional()
|
|
6362
6353
|
})
|
|
6363
6354
|
);
|
|
6364
6355
|
var schemaSchema = z.lazy(
|
|
@@ -6584,17 +6575,21 @@ var stringSchemaSchema = z.lazy(
|
|
|
6584
6575
|
help: helpSchema.optional()
|
|
6585
6576
|
})
|
|
6586
6577
|
);
|
|
6587
|
-
var
|
|
6578
|
+
var persistAsyncSchema = z.lazy(
|
|
6579
|
+
() => z.object({
|
|
6580
|
+
param: z.string(),
|
|
6581
|
+
idProperty: z.string(),
|
|
6582
|
+
schema: schemaSchema,
|
|
6583
|
+
url: z.string(),
|
|
6584
|
+
method: httpMethodSchema
|
|
6585
|
+
})
|
|
6586
|
+
);
|
|
6587
|
+
var arraySchemaTupleSchema = z.lazy(
|
|
6588
6588
|
() => z.object({
|
|
6589
6589
|
type: z.literal("array"),
|
|
6590
6590
|
promoted: z.boolean().optional(),
|
|
6591
6591
|
$id: z.string().optional(),
|
|
6592
|
-
items: schemaSchema,
|
|
6593
|
-
addItemTitle: z.string(),
|
|
6594
|
-
editItemTitle: z.string(),
|
|
6595
|
-
minItems: z.number().optional(),
|
|
6596
|
-
maxItems: z.number().optional(),
|
|
6597
|
-
placeholder: z.string().optional(),
|
|
6592
|
+
items: z.array(schemaSchema),
|
|
6598
6593
|
title: z.string().optional(),
|
|
6599
6594
|
description: z.string().optional(),
|
|
6600
6595
|
control: z.string().optional(),
|
|
@@ -6602,30 +6597,24 @@ var arraySchemaListSchema = z.lazy(
|
|
|
6602
6597
|
icon: iconSchema.optional(),
|
|
6603
6598
|
image: imageSchema.optional(),
|
|
6604
6599
|
keywords: z.array(z.string()).optional(),
|
|
6605
|
-
summary:
|
|
6600
|
+
summary: summaryProviderSchema.optional(),
|
|
6606
6601
|
analyticsId: z.string().optional(),
|
|
6607
6602
|
persistAsync: persistAsyncSchema.optional(),
|
|
6608
6603
|
validationAsync: validateAsyncSchema.optional(),
|
|
6609
|
-
alert: alertLayoutSchema.optional()
|
|
6610
|
-
validationMessages: z.record(z.string()).optional(),
|
|
6611
|
-
disabled: z.boolean().optional()
|
|
6612
|
-
})
|
|
6613
|
-
);
|
|
6614
|
-
var persistAsyncSchema = z.lazy(
|
|
6615
|
-
() => z.object({
|
|
6616
|
-
param: z.string(),
|
|
6617
|
-
idProperty: z.string(),
|
|
6618
|
-
schema: schemaSchema,
|
|
6619
|
-
url: z.string(),
|
|
6620
|
-
method: httpMethodSchema
|
|
6604
|
+
alert: alertLayoutSchema.optional()
|
|
6621
6605
|
})
|
|
6622
6606
|
);
|
|
6623
|
-
var
|
|
6607
|
+
var arraySchemaListSchema = z.lazy(
|
|
6624
6608
|
() => z.object({
|
|
6625
6609
|
type: z.literal("array"),
|
|
6626
6610
|
promoted: z.boolean().optional(),
|
|
6627
6611
|
$id: z.string().optional(),
|
|
6628
|
-
items:
|
|
6612
|
+
items: schemaSchema,
|
|
6613
|
+
addItemTitle: z.string(),
|
|
6614
|
+
editItemTitle: z.string(),
|
|
6615
|
+
minItems: z.number().optional(),
|
|
6616
|
+
maxItems: z.number().optional(),
|
|
6617
|
+
placeholder: z.string().optional(),
|
|
6629
6618
|
title: z.string().optional(),
|
|
6630
6619
|
description: z.string().optional(),
|
|
6631
6620
|
control: z.string().optional(),
|
|
@@ -6633,11 +6622,34 @@ var arraySchemaTupleSchema = z.lazy(
|
|
|
6633
6622
|
icon: iconSchema.optional(),
|
|
6634
6623
|
image: imageSchema.optional(),
|
|
6635
6624
|
keywords: z.array(z.string()).optional(),
|
|
6636
|
-
summary:
|
|
6625
|
+
summary: summarySummariserSchema.optional(),
|
|
6637
6626
|
analyticsId: z.string().optional(),
|
|
6638
6627
|
persistAsync: persistAsyncSchema.optional(),
|
|
6639
6628
|
validationAsync: validateAsyncSchema.optional(),
|
|
6640
|
-
alert: alertLayoutSchema.optional()
|
|
6629
|
+
alert: alertLayoutSchema.optional(),
|
|
6630
|
+
validationMessages: z.record(z.string()).optional(),
|
|
6631
|
+
disabled: z.boolean().optional()
|
|
6632
|
+
})
|
|
6633
|
+
);
|
|
6634
|
+
var stepSchema = z.lazy(
|
|
6635
|
+
() => z.object({
|
|
6636
|
+
key: z.string().optional(),
|
|
6637
|
+
type: z.string().optional(),
|
|
6638
|
+
actions: z.array(actionSchema).optional(),
|
|
6639
|
+
refreshFormUrl: z.string().optional(),
|
|
6640
|
+
id: z.string(),
|
|
6641
|
+
title: z.string(),
|
|
6642
|
+
schemas: z.array(schemaSchema),
|
|
6643
|
+
layout: z.array(layoutSchema),
|
|
6644
|
+
description: z.string().optional(),
|
|
6645
|
+
model: jsonElementSchema.optional(),
|
|
6646
|
+
external: externalSchema.optional(),
|
|
6647
|
+
polling: pollingSchema.optional(),
|
|
6648
|
+
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
6649
|
+
analytics: z.record(z.string()).optional(),
|
|
6650
|
+
errors: stepErrorSchema.optional(),
|
|
6651
|
+
navigation: navigationSchema.optional(),
|
|
6652
|
+
refreshUrl: z.string().optional()
|
|
6641
6653
|
})
|
|
6642
6654
|
);
|
|
6643
6655
|
var validateStep = (step) => validate(step, stepSchema);
|
|
@@ -6784,84 +6796,34 @@ var createStepComponent = (stepProps) => {
|
|
|
6784
6796
|
});
|
|
6785
6797
|
};
|
|
6786
6798
|
|
|
6787
|
-
// src/revamp/flow/response-utils.ts
|
|
6788
|
-
var assertResponseIsValid = (response) => {
|
|
6789
|
-
if (!isResponse(response)) {
|
|
6790
|
-
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
6791
|
-
}
|
|
6792
|
-
if (response.bodyUsed) {
|
|
6793
|
-
throw new Error(
|
|
6794
|
-
"The body of the provided Response object has already been used. Every request must respond with a new Response object."
|
|
6795
|
-
);
|
|
6796
|
-
}
|
|
6797
|
-
};
|
|
6798
|
-
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
6799
|
-
var parseResponseBodyAsJsonElement = async (response) => {
|
|
6800
|
-
try {
|
|
6801
|
-
return await response.json();
|
|
6802
|
-
} catch (e) {
|
|
6803
|
-
return null;
|
|
6804
|
-
}
|
|
6805
|
-
};
|
|
6806
|
-
function isActionResponseBody(body) {
|
|
6807
|
-
return validateActionResponse(body).valid;
|
|
6808
|
-
}
|
|
6809
|
-
function assertActionResponseBody(body) {
|
|
6810
|
-
if (!isObject(body) || !isObject(body.action)) {
|
|
6811
|
-
throw new Error(
|
|
6812
|
-
"Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
|
|
6813
|
-
);
|
|
6814
|
-
}
|
|
6815
|
-
}
|
|
6816
|
-
function isErrorResponseBody(body) {
|
|
6817
|
-
return Boolean(
|
|
6818
|
-
isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
|
|
6819
|
-
);
|
|
6820
|
-
}
|
|
6821
|
-
function assertStepResponseBody(body) {
|
|
6822
|
-
if (!isObject(body)) {
|
|
6823
|
-
throw new Error("Incorrect response body in step response. Expected an object.");
|
|
6824
|
-
}
|
|
6825
|
-
}
|
|
6826
|
-
|
|
6827
6799
|
// src/revamp/domain/features/polling/getStepPolling.ts
|
|
6828
6800
|
var getStepPolling = ({
|
|
6829
|
-
httpClient,
|
|
6830
6801
|
pollingConfig,
|
|
6831
|
-
onAction
|
|
6802
|
+
onAction,
|
|
6803
|
+
onPoll
|
|
6832
6804
|
}) => {
|
|
6833
6805
|
const { interval, delay = interval, maxAttempts, url, onError } = pollingConfig;
|
|
6834
6806
|
let abortController = new AbortController();
|
|
6835
6807
|
if (delay == null) {
|
|
6836
6808
|
throw new Error("Polling configuration must include delay or interval");
|
|
6837
6809
|
}
|
|
6838
|
-
const onFailure = () => {
|
|
6839
|
-
stop();
|
|
6840
|
-
void onAction(onError.action);
|
|
6841
|
-
};
|
|
6842
6810
|
let attempts = 0;
|
|
6843
6811
|
const poll = () => {
|
|
6844
6812
|
attempts += 1;
|
|
6845
6813
|
abortController.abort();
|
|
6846
6814
|
abortController = new AbortController();
|
|
6847
6815
|
const { signal } = abortController;
|
|
6848
|
-
|
|
6849
|
-
if (
|
|
6850
|
-
|
|
6816
|
+
onPoll(url, onError.action, signal).then((result) => {
|
|
6817
|
+
if (result) {
|
|
6818
|
+
stop();
|
|
6851
6819
|
return;
|
|
6852
6820
|
}
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
}
|
|
6858
|
-
}).catch(() => {
|
|
6859
|
-
});
|
|
6821
|
+
if (attempts >= maxAttempts && !signal.aborted) {
|
|
6822
|
+
void onAction(onError.action);
|
|
6823
|
+
stop();
|
|
6824
|
+
}
|
|
6860
6825
|
}).catch(() => {
|
|
6861
6826
|
});
|
|
6862
|
-
if (attempts >= maxAttempts && !signal.aborted) {
|
|
6863
|
-
onFailure();
|
|
6864
|
-
}
|
|
6865
6827
|
};
|
|
6866
6828
|
poll();
|
|
6867
6829
|
const intervalRef = setInterval(poll, delay * 1e3);
|
|
@@ -7636,6 +7598,46 @@ var autocompleteTokenMap = {
|
|
|
7636
7598
|
pager: "pager"
|
|
7637
7599
|
};
|
|
7638
7600
|
|
|
7601
|
+
// src/revamp/flow/response-utils.ts
|
|
7602
|
+
var assertResponseIsValid = (response) => {
|
|
7603
|
+
if (!isResponse(response)) {
|
|
7604
|
+
throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
|
|
7605
|
+
}
|
|
7606
|
+
if (response.bodyUsed) {
|
|
7607
|
+
throw new Error(
|
|
7608
|
+
"The body of the provided Response object has already been used. Every request must respond with a new Response object."
|
|
7609
|
+
);
|
|
7610
|
+
}
|
|
7611
|
+
};
|
|
7612
|
+
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
7613
|
+
var parseResponseBodyAsJsonElement = async (response) => {
|
|
7614
|
+
try {
|
|
7615
|
+
return await response.json();
|
|
7616
|
+
} catch (e) {
|
|
7617
|
+
return null;
|
|
7618
|
+
}
|
|
7619
|
+
};
|
|
7620
|
+
function isActionResponseBody(body) {
|
|
7621
|
+
return validateActionResponse(body).valid;
|
|
7622
|
+
}
|
|
7623
|
+
function assertActionResponseBody(body) {
|
|
7624
|
+
if (!isObject(body) || !isObject(body.action)) {
|
|
7625
|
+
throw new Error(
|
|
7626
|
+
"Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
|
|
7627
|
+
);
|
|
7628
|
+
}
|
|
7629
|
+
}
|
|
7630
|
+
function isErrorResponseBody(body) {
|
|
7631
|
+
return Boolean(
|
|
7632
|
+
isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
|
|
7633
|
+
);
|
|
7634
|
+
}
|
|
7635
|
+
function assertStepResponseBody(body) {
|
|
7636
|
+
if (!isObject(body)) {
|
|
7637
|
+
throw new Error("Incorrect response body in step response. Expected an object.");
|
|
7638
|
+
}
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7639
7641
|
// src/revamp/domain/features/utils/response-utils.ts
|
|
7640
7642
|
var getAnalyticsFromErrorResponse = (json) => {
|
|
7641
7643
|
if (!isErrorResponseBody(json)) {
|
|
@@ -7836,7 +7838,7 @@ var schemaHasValidationAsync = (schema) => Boolean("validationAsync" in schema &
|
|
|
7836
7838
|
// src/revamp/domain/mappers/schema/numberSchemaToComponent.ts
|
|
7837
7839
|
var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
7838
7840
|
const { schema, model, localValue, required = false } = schemaMapperProps;
|
|
7839
|
-
const { autocompleteHint, validationMessages, default: defaultValue } = schema;
|
|
7841
|
+
const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
|
|
7840
7842
|
const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
|
|
7841
7843
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
7842
7844
|
const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
|
|
@@ -7859,6 +7861,8 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
7859
7861
|
getAboveMaximumCheck(schema, errorMessageFunctions)
|
|
7860
7862
|
],
|
|
7861
7863
|
value,
|
|
7864
|
+
maximum,
|
|
7865
|
+
minimum,
|
|
7862
7866
|
persistedState,
|
|
7863
7867
|
validationState,
|
|
7864
7868
|
performPersistAsync,
|
|
@@ -8183,7 +8187,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
|
|
|
8183
8187
|
// src/revamp/domain/mappers/schema/integerSchemaToComponent.ts
|
|
8184
8188
|
var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
8185
8189
|
const { schema, localValue, model, required = false } = schemaMapperProps;
|
|
8186
|
-
const { autocompleteHint, validationMessages, default: defaultValue } = schema;
|
|
8190
|
+
const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
|
|
8187
8191
|
const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
|
|
8188
8192
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
8189
8193
|
const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
|
|
@@ -8206,6 +8210,8 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8206
8210
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
8207
8211
|
autoComplete: getAutocompleteString(autocompleteHint),
|
|
8208
8212
|
checks,
|
|
8213
|
+
maximum,
|
|
8214
|
+
minimum,
|
|
8209
8215
|
persistedState,
|
|
8210
8216
|
value,
|
|
8211
8217
|
validationState,
|
|
@@ -8784,6 +8790,8 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8784
8790
|
default: defaultValue,
|
|
8785
8791
|
displayFormat,
|
|
8786
8792
|
format,
|
|
8793
|
+
maxLength,
|
|
8794
|
+
minLength,
|
|
8787
8795
|
validationMessages
|
|
8788
8796
|
} = schema;
|
|
8789
8797
|
const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
|
|
@@ -8811,6 +8819,8 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8811
8819
|
],
|
|
8812
8820
|
control: control != null ? control : controlForLegacyFormat,
|
|
8813
8821
|
displayFormat,
|
|
8822
|
+
maxLength,
|
|
8823
|
+
minLength,
|
|
8814
8824
|
value,
|
|
8815
8825
|
persistedState,
|
|
8816
8826
|
validationState,
|
|
@@ -8989,7 +8999,7 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
8989
8999
|
required = false,
|
|
8990
9000
|
validationErrors
|
|
8991
9001
|
} = schemaMapperProps;
|
|
8992
|
-
const { items, addItemTitle, editItemTitle, summary } = schema;
|
|
9002
|
+
const { items, addItemTitle, editItemTitle, maxItems, minItems, summary } = schema;
|
|
8993
9003
|
const value = isArray(localValue) ? localValue : [];
|
|
8994
9004
|
const components = initialModel == null ? void 0 : initialModel.map(
|
|
8995
9005
|
(item, index) => mapSchemaToComponent(
|
|
@@ -9026,6 +9036,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9026
9036
|
],
|
|
9027
9037
|
components: components != null ? components : [],
|
|
9028
9038
|
editItemTitle,
|
|
9039
|
+
maxItems,
|
|
9040
|
+
minItems,
|
|
9029
9041
|
summary,
|
|
9030
9042
|
createEditableComponent,
|
|
9031
9043
|
onValueChange
|
|
@@ -9338,7 +9350,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9338
9350
|
)
|
|
9339
9351
|
};
|
|
9340
9352
|
});
|
|
9341
|
-
const { title, validationMessages } = schema;
|
|
9353
|
+
const { maxItems, minItems, title, validationMessages } = schema;
|
|
9342
9354
|
const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
|
|
9343
9355
|
const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
|
|
9344
9356
|
const { performValidationAsync, validationState } = getValidationAsyncInitialState(
|
|
@@ -9355,6 +9367,8 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
9355
9367
|
getBelowMinItemsCheck(schema, errorMessageFunctions)
|
|
9356
9368
|
],
|
|
9357
9369
|
initialValue,
|
|
9370
|
+
maxItems,
|
|
9371
|
+
minItems,
|
|
9358
9372
|
options,
|
|
9359
9373
|
required,
|
|
9360
9374
|
title,
|
|
@@ -10215,14 +10229,16 @@ var mapStepToComponent = (_a) => {
|
|
|
10215
10229
|
var _b = _a, {
|
|
10216
10230
|
loadingState,
|
|
10217
10231
|
displayStepTitle,
|
|
10218
|
-
trackEvent
|
|
10232
|
+
trackEvent,
|
|
10233
|
+
onPoll
|
|
10219
10234
|
} = _b, restProps = __objRest(_b, [
|
|
10220
10235
|
"loadingState",
|
|
10221
10236
|
"displayStepTitle",
|
|
10222
|
-
"trackEvent"
|
|
10237
|
+
"trackEvent",
|
|
10238
|
+
"onPoll"
|
|
10223
10239
|
]);
|
|
10224
10240
|
var _a2, _b2;
|
|
10225
|
-
const {
|
|
10241
|
+
const { step, updateComponent } = restProps;
|
|
10226
10242
|
const { id, description, errors, external, key, layout = [], navigation, polling, title } = step;
|
|
10227
10243
|
const backNavigation = (_a2 = navigation == null ? void 0 : navigation.back) != null ? _a2 : navigation == null ? void 0 : navigation.backButton;
|
|
10228
10244
|
const back = backNavigation ? {
|
|
@@ -10252,7 +10268,7 @@ var mapStepToComponent = (_a) => {
|
|
|
10252
10268
|
}
|
|
10253
10269
|
};
|
|
10254
10270
|
const onRefresh = async (schemaId, url) => restProps.onRefresh(schemaId, url != null ? url : refreshUrl);
|
|
10255
|
-
const stepPolling = polling ? getStepPolling({
|
|
10271
|
+
const stepPolling = polling ? getStepPolling({ pollingConfig: polling, onAction: restProps.onAction, onPoll }) : void 0;
|
|
10256
10272
|
const mapperProps = __spreadProps(__spreadValues({}, restProps), { trackEvent, onAction, onRefresh });
|
|
10257
10273
|
const unreferencedSchemaFormComponents = mapUnreferencedSchemas(mapperProps);
|
|
10258
10274
|
const layoutComponents = layout.map(
|
|
@@ -10318,8 +10334,19 @@ var executeRefresh = async (props) => {
|
|
|
10318
10334
|
// src/revamp/flow/getResponseType.ts
|
|
10319
10335
|
var responseTypes = ["step", "action", "exit"];
|
|
10320
10336
|
var getResponseType = async (response) => {
|
|
10321
|
-
var _a, _b;
|
|
10322
10337
|
assertResponseIsValid(response);
|
|
10338
|
+
const headerResponseType = getResponseTypeFromHeader(response);
|
|
10339
|
+
if (headerResponseType) {
|
|
10340
|
+
return headerResponseType;
|
|
10341
|
+
}
|
|
10342
|
+
const jsonBody = await parseResponseBodyAsJsonElement(response.clone());
|
|
10343
|
+
if (isObject(jsonBody) && jsonBody.action) {
|
|
10344
|
+
return "action";
|
|
10345
|
+
}
|
|
10346
|
+
return "step";
|
|
10347
|
+
};
|
|
10348
|
+
var getResponseTypeFromHeader = (response) => {
|
|
10349
|
+
var _a, _b;
|
|
10323
10350
|
if ((_a = response.headers) == null ? void 0 : _a.has("X-Df-Response-Type")) {
|
|
10324
10351
|
const type = response.headers.get("X-Df-Response-Type");
|
|
10325
10352
|
assertDFResponseType(type);
|
|
@@ -10328,11 +10355,7 @@ var getResponseType = async (response) => {
|
|
|
10328
10355
|
if ((_b = response.headers) == null ? void 0 : _b.has("X-Df-Exit")) {
|
|
10329
10356
|
return "exit";
|
|
10330
10357
|
}
|
|
10331
|
-
|
|
10332
|
-
if (isObject(jsonBody) && jsonBody.action) {
|
|
10333
|
-
return "action";
|
|
10334
|
-
}
|
|
10335
|
-
return "step";
|
|
10358
|
+
return void 0;
|
|
10336
10359
|
};
|
|
10337
10360
|
function assertDFResponseType(type) {
|
|
10338
10361
|
if (!responseTypes.includes(type)) {
|
|
@@ -10623,6 +10646,48 @@ function useStableCallback(handler) {
|
|
|
10623
10646
|
return useCallback((...args) => ref.current ? ref.current(...args) : null, []);
|
|
10624
10647
|
}
|
|
10625
10648
|
|
|
10649
|
+
// src/revamp/flow/executePoll.ts
|
|
10650
|
+
var executePoll = async (props) => {
|
|
10651
|
+
const { errorAction, signal, url, httpClient } = props;
|
|
10652
|
+
try {
|
|
10653
|
+
const response = await httpClient(url != null ? url : "", {
|
|
10654
|
+
method: "GET",
|
|
10655
|
+
signal
|
|
10656
|
+
});
|
|
10657
|
+
if (!response.ok) {
|
|
10658
|
+
return { type: "action", action: errorAction };
|
|
10659
|
+
}
|
|
10660
|
+
const responseType = getResponseTypeFromHeader(response);
|
|
10661
|
+
const body = await parseResponseBodyAsJsonElement(response);
|
|
10662
|
+
try {
|
|
10663
|
+
switch (responseType) {
|
|
10664
|
+
case "step": {
|
|
10665
|
+
const etag = response.headers.get("etag") || null;
|
|
10666
|
+
assertStepResponseBody(body);
|
|
10667
|
+
return { type: "replace-step", step: body, etag };
|
|
10668
|
+
}
|
|
10669
|
+
case "exit": {
|
|
10670
|
+
return { type: "complete", result: body };
|
|
10671
|
+
}
|
|
10672
|
+
case "action": {
|
|
10673
|
+
assertActionResponseBody(body);
|
|
10674
|
+
return { type: "action", action: body.action };
|
|
10675
|
+
}
|
|
10676
|
+
default: {
|
|
10677
|
+
if (isActionResponseBody(body)) {
|
|
10678
|
+
return { type: "action", action: body.action };
|
|
10679
|
+
}
|
|
10680
|
+
return { type: "continue" };
|
|
10681
|
+
}
|
|
10682
|
+
}
|
|
10683
|
+
} catch (error) {
|
|
10684
|
+
return { type: "action", action: errorAction };
|
|
10685
|
+
}
|
|
10686
|
+
} catch (error) {
|
|
10687
|
+
return { type: "continue" };
|
|
10688
|
+
}
|
|
10689
|
+
};
|
|
10690
|
+
|
|
10626
10691
|
// src/revamp/useDynamicFlowCore.tsx
|
|
10627
10692
|
function useDynamicFlowCore(props) {
|
|
10628
10693
|
const _a = props, { flowId, initialAction, initialStep, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "displayStepTitle"]);
|
|
@@ -10691,6 +10756,7 @@ function useDynamicFlowCore(props) {
|
|
|
10691
10756
|
httpClient,
|
|
10692
10757
|
onAction,
|
|
10693
10758
|
onRefresh,
|
|
10759
|
+
onPoll,
|
|
10694
10760
|
onValueChange
|
|
10695
10761
|
});
|
|
10696
10762
|
setStepComponent(() => {
|
|
@@ -10824,6 +10890,31 @@ function useDynamicFlowCore(props) {
|
|
|
10824
10890
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10825
10891
|
[]
|
|
10826
10892
|
);
|
|
10893
|
+
const onPoll = useCallback2(
|
|
10894
|
+
async (url, errorAction, signal) => {
|
|
10895
|
+
const command = await executePoll({
|
|
10896
|
+
httpClient,
|
|
10897
|
+
url,
|
|
10898
|
+
errorAction,
|
|
10899
|
+
signal
|
|
10900
|
+
});
|
|
10901
|
+
switch (command.type) {
|
|
10902
|
+
case "replace-step":
|
|
10903
|
+
initialiseWithStep(command.step, command.etag);
|
|
10904
|
+
return true;
|
|
10905
|
+
case "action":
|
|
10906
|
+
void onAction(command.action);
|
|
10907
|
+
return true;
|
|
10908
|
+
case "complete":
|
|
10909
|
+
onCompletion(command.result);
|
|
10910
|
+
return true;
|
|
10911
|
+
case "continue":
|
|
10912
|
+
return false;
|
|
10913
|
+
}
|
|
10914
|
+
},
|
|
10915
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10916
|
+
[]
|
|
10917
|
+
);
|
|
10827
10918
|
return { stepComponentRef };
|
|
10828
10919
|
}
|
|
10829
10920
|
|
|
@@ -12580,6 +12671,8 @@ var TextInputRenderer = {
|
|
|
12580
12671
|
description,
|
|
12581
12672
|
help,
|
|
12582
12673
|
error,
|
|
12674
|
+
maxLength,
|
|
12675
|
+
minLength,
|
|
12583
12676
|
type,
|
|
12584
12677
|
value: initialValue
|
|
12585
12678
|
} = _a, rest = __objRest(_a, [
|
|
@@ -12589,6 +12682,8 @@ var TextInputRenderer = {
|
|
|
12589
12682
|
"description",
|
|
12590
12683
|
"help",
|
|
12591
12684
|
"error",
|
|
12685
|
+
"maxLength",
|
|
12686
|
+
"minLength",
|
|
12592
12687
|
"type",
|
|
12593
12688
|
"value"
|
|
12594
12689
|
]);
|