@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 CHANGED
@@ -1622,6 +1622,8 @@ var instructionsComponentToProps = ({
1622
1622
 
1623
1623
  // src/revamp/renderers/mappers/integerInputComponentToProps.ts
1624
1624
  var integerInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-integer")), {
1625
+ maximum: component.maximum,
1626
+ minimum: component.minimum,
1625
1627
  onChange: component.onChange.bind(component)
1626
1628
  });
1627
1629
 
@@ -1685,6 +1687,8 @@ var multiUploadInputComponentToProps = (component) => {
1685
1687
 
1686
1688
  // src/revamp/renderers/mappers/numberInputComponentToProps.ts
1687
1689
  var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-number")), {
1690
+ maximum: component.maximum,
1691
+ minimum: component.minimum,
1688
1692
  onChange: component.onChange.bind(component)
1689
1693
  });
1690
1694
 
@@ -1721,6 +1725,8 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
1721
1725
  description,
1722
1726
  editItemTitle,
1723
1727
  errors,
1728
+ maxItems,
1729
+ minItems,
1724
1730
  summaryDefaults,
1725
1731
  title = "",
1726
1732
  onEdit,
@@ -1743,13 +1749,15 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
1743
1749
  return {
1744
1750
  type: "repeatable",
1745
1751
  children,
1752
+ addItemTitle,
1746
1753
  control,
1747
- items: itemProps,
1748
- editableItem: editableItemChildren,
1749
- title,
1750
1754
  description,
1751
- addItemTitle,
1755
+ editableItem: editableItemChildren,
1752
1756
  editItemTitle,
1757
+ items: itemProps,
1758
+ maxItems,
1759
+ minItems,
1760
+ title,
1753
1761
  error: errors[0],
1754
1762
  onAdd: onAdd.bind(component),
1755
1763
  onEdit: onEdit.bind(component),
@@ -1858,14 +1866,18 @@ var statusListComponentToProps = ({
1858
1866
  // src/revamp/renderers/mappers/textInputComponentToProps.ts
1859
1867
  var textInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-text")), {
1860
1868
  displayFormat: component.displayFormat,
1869
+ maxLength: component.maxLength,
1870
+ minLength: component.minLength,
1861
1871
  onChange: component.onChange.bind(component)
1862
1872
  });
1863
1873
 
1864
1874
  // src/revamp/renderers/mappers/multiSelectComponentToProps.ts
1865
1875
  var multiSelectInputComponentToProps = (component) => {
1866
- const { options, selectedIndices, onSelect } = component;
1867
- const _a = inputComponentToProps(component, "input-multi-select"), { value } = _a, props = __objRest(_a, ["value"]);
1876
+ const { maxItems, minItems, options, selectedIndices, onSelect } = component;
1877
+ const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
1868
1878
  return __spreadProps(__spreadValues({}, props), {
1879
+ maxItems,
1880
+ minItems,
1869
1881
  options,
1870
1882
  selectedIndices,
1871
1883
  onSelect: onSelect.bind(component)
@@ -5839,21 +5851,13 @@ var z = /* @__PURE__ */ Object.freeze({
5839
5851
  quotelessJson,
5840
5852
  ZodError
5841
5853
  });
5842
- var imageSchema = z.object({
5843
- text: z.string().optional(),
5844
- url: z.string(),
5845
- accessibilityDescription: z.string().optional()
5846
- });
5847
- var httpMethodSchema = z.union([
5848
- z.literal("GET"),
5849
- z.literal("POST"),
5850
- z.literal("PUT"),
5851
- z.literal("PATCH"),
5852
- z.literal("DELETE")
5854
+ var sizeSchema = z.union([
5855
+ z.literal("xs"),
5856
+ z.literal("sm"),
5857
+ z.literal("md"),
5858
+ z.literal("lg"),
5859
+ z.literal("xl")
5853
5860
  ]);
5854
- var iconNamedSchema = z.object({
5855
- name: z.string()
5856
- });
5857
5861
  var contextSchema = z.union([
5858
5862
  z.literal("positive"),
5859
5863
  z.literal("neutral"),
@@ -5864,18 +5868,107 @@ var contextSchema = z.union([
5864
5868
  z.literal("info"),
5865
5869
  z.literal("primary")
5866
5870
  ]);
5867
- var iconTextSchema = z.object({
5868
- text: z.string()
5869
- });
5870
- var sizeSchema = z.union([
5871
- z.literal("xs"),
5872
- z.literal("sm"),
5873
- z.literal("md"),
5874
- z.literal("lg"),
5875
- z.literal("xl")
5871
+ var columnsLayoutBiasSchema = z.union([
5872
+ z.literal("none"),
5873
+ z.literal("left"),
5874
+ z.literal("right")
5875
+ ]);
5876
+ var statusListLayoutStatusSchema = z.union([
5877
+ z.literal("not-done"),
5878
+ z.literal("pending"),
5879
+ z.literal("done")
5876
5880
  ]);
5877
5881
  var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
5878
- var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
5882
+ var formLayoutSchemaReferenceSchema = z.object({
5883
+ $ref: z.string()
5884
+ });
5885
+ var modalLayoutTriggerSchema = z.object({
5886
+ title: z.string()
5887
+ });
5888
+ var httpMethodSchema = z.union([
5889
+ z.literal("GET"),
5890
+ z.literal("POST"),
5891
+ z.literal("PUT"),
5892
+ z.literal("PATCH"),
5893
+ z.literal("DELETE")
5894
+ ]);
5895
+ var dividerLayoutSchema = z.object({
5896
+ type: z.literal("divider"),
5897
+ control: z.string().optional(),
5898
+ margin: sizeSchema.optional()
5899
+ });
5900
+ var listLayoutStatusSchema = z.union([
5901
+ z.literal("warning"),
5902
+ z.literal("neutral"),
5903
+ z.literal("positive")
5904
+ ]);
5905
+ var headingLayoutSchema = z.object({
5906
+ type: z.literal("heading"),
5907
+ text: z.string(),
5908
+ size: sizeSchema.optional(),
5909
+ align: alignSchema.optional(),
5910
+ control: z.string().optional(),
5911
+ margin: sizeSchema.optional()
5912
+ });
5913
+ var formLayoutSchema = z.object({
5914
+ type: z.literal("form"),
5915
+ schema: formLayoutSchemaReferenceSchema.optional(),
5916
+ schemaId: z.string(),
5917
+ control: z.string().optional(),
5918
+ margin: sizeSchema.optional()
5919
+ });
5920
+ var imageLayoutSchema = z.object({
5921
+ type: z.literal("image"),
5922
+ text: z.string().optional(),
5923
+ url: z.string(),
5924
+ size: sizeSchema.optional(),
5925
+ accessibilityDescription: z.string().optional(),
5926
+ control: z.string().optional(),
5927
+ margin: sizeSchema.optional()
5928
+ });
5929
+ var infoLayoutSchema = z.object({
5930
+ type: z.literal("info"),
5931
+ markdown: z.string(),
5932
+ align: alignSchema.optional(),
5933
+ control: z.string().optional(),
5934
+ margin: sizeSchema.optional()
5935
+ });
5936
+ var loadingIndicatorLayoutSchema = z.object({
5937
+ type: z.literal("loading-indicator"),
5938
+ size: sizeSchema.optional(),
5939
+ control: z.string().optional(),
5940
+ margin: sizeSchema.optional()
5941
+ });
5942
+ var paragraphLayoutSchema = z.object({
5943
+ type: z.literal("paragraph"),
5944
+ text: z.string(),
5945
+ align: alignSchema.optional(),
5946
+ control: z.string().optional(),
5947
+ margin: sizeSchema.optional()
5948
+ });
5949
+ var instructionsLayoutItemSchema = z.object({
5950
+ text: z.string(),
5951
+ context: contextSchema
5952
+ });
5953
+ var helpSchema = z.object({
5954
+ markdown: z.string()
5955
+ });
5956
+ var imageSchema = z.object({
5957
+ text: z.string().optional(),
5958
+ url: z.string(),
5959
+ accessibilityDescription: z.string().optional()
5960
+ });
5961
+ var summaryProviderSchema = z.object({
5962
+ providesTitle: z.boolean().optional(),
5963
+ providesDescription: z.boolean().optional(),
5964
+ providesIcon: z.boolean().optional(),
5965
+ providesImage: z.boolean().optional()
5966
+ });
5967
+ var validateAsyncSchema = z.object({
5968
+ param: z.string(),
5969
+ method: httpMethodSchema,
5970
+ url: z.string()
5971
+ });
5879
5972
  var autocompleteTokenSchema = z.union([
5880
5973
  z.literal("on"),
5881
5974
  z.literal("name"),
@@ -5941,106 +6034,14 @@ var autocompleteTokenSchema = z.union([
5941
6034
  z.literal("fax"),
5942
6035
  z.literal("pager")
5943
6036
  ]);
5944
- var loadingIndicatorLayoutSchema = z.object({
5945
- type: z.literal("loading-indicator"),
5946
- size: sizeSchema.optional(),
5947
- control: z.string().optional(),
5948
- margin: sizeSchema.optional()
5949
- });
5950
- var paragraphLayoutSchema = z.object({
5951
- type: z.literal("paragraph"),
5952
- text: z.string(),
5953
- align: alignSchema.optional(),
5954
- control: z.string().optional(),
5955
- margin: sizeSchema.optional()
5956
- });
5957
- var dividerLayoutSchema = z.object({
5958
- type: z.literal("divider"),
5959
- control: z.string().optional(),
5960
- margin: sizeSchema.optional()
5961
- });
5962
- var listLayoutStatusSchema = z.union([
5963
- z.literal("warning"),
5964
- z.literal("neutral"),
5965
- z.literal("positive")
5966
- ]);
5967
- var formLayoutSchemaReferenceSchema = z.object({
5968
- $ref: z.string()
5969
- });
5970
- var imageLayoutSchema = z.object({
5971
- type: z.literal("image"),
5972
- text: z.string().optional(),
5973
- url: z.string(),
5974
- size: sizeSchema.optional(),
5975
- accessibilityDescription: z.string().optional(),
5976
- control: z.string().optional(),
5977
- margin: sizeSchema.optional()
5978
- });
5979
- var statusListLayoutStatusSchema = z.union([
5980
- z.literal("not-done"),
5981
- z.literal("pending"),
5982
- z.literal("done")
5983
- ]);
5984
- var instructionsLayoutItemSchema = z.object({
5985
- text: z.string(),
5986
- context: contextSchema
5987
- });
5988
- var modalLayoutTriggerSchema = z.object({
5989
- title: z.string()
5990
- });
5991
- var searchLayoutSchema = z.object({
5992
- type: z.literal("search"),
5993
- title: z.string(),
5994
- method: httpMethodSchema,
5995
- url: z.string(),
5996
- param: z.string(),
5997
- emptyMessage: z.string().optional(),
5998
- control: z.string().optional(),
5999
- margin: sizeSchema.optional()
6000
- });
6001
- var infoLayoutSchema = z.object({
6002
- type: z.literal("info"),
6003
- markdown: z.string(),
6004
- align: alignSchema.optional(),
6005
- control: z.string().optional(),
6006
- margin: sizeSchema.optional()
6007
- });
6008
- var formLayoutSchema = z.object({
6009
- type: z.literal("form"),
6010
- schema: formLayoutSchemaReferenceSchema.optional(),
6011
- schemaId: z.string(),
6012
- control: z.string().optional(),
6013
- margin: sizeSchema.optional()
6014
- });
6015
- var headingLayoutSchema = z.object({
6016
- type: z.literal("heading"),
6017
- text: z.string(),
6018
- size: sizeSchema.optional(),
6019
- align: alignSchema.optional(),
6020
- control: z.string().optional(),
6021
- margin: sizeSchema.optional()
6022
- });
6023
- var markdownLayoutSchema = z.object({
6024
- type: z.literal("markdown"),
6025
- content: z.string(),
6026
- align: alignSchema.optional(),
6027
- control: z.string().optional(),
6028
- margin: sizeSchema.optional()
6029
- });
6030
- var columnsLayoutBiasSchema = z.union([
6031
- z.literal("none"),
6032
- z.literal("left"),
6033
- z.literal("right")
6037
+ var stringSchemaFormatSchema = z.union([
6038
+ z.literal("date"),
6039
+ z.literal("email"),
6040
+ z.literal("numeric"),
6041
+ z.literal("password"),
6042
+ z.literal("phone-number"),
6043
+ z.literal("base64url")
6034
6044
  ]);
6035
- var helpSchema = z.object({
6036
- markdown: z.string()
6037
- });
6038
- var searchSearchRequestSchema = z.object({
6039
- url: z.string(),
6040
- method: httpMethodSchema,
6041
- param: z.string(),
6042
- query: z.string()
6043
- });
6044
6045
  var jsonElementSchema = z.lazy(
6045
6046
  () => z.union([
6046
6047
  z.string(),
@@ -6050,6 +6051,7 @@ var jsonElementSchema = z.lazy(
6050
6051
  z.array(jsonElementSchema)
6051
6052
  ]).nullable()
6052
6053
  );
6054
+ var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
6053
6055
  var externalSchema = z.object({
6054
6056
  url: z.string()
6055
6057
  });
@@ -6057,42 +6059,28 @@ var stepErrorSchema = z.object({
6057
6059
  error: z.string().optional(),
6058
6060
  validation: jsonElementSchema.optional()
6059
6061
  });
6060
- var stringSchemaFormatSchema = z.union([
6061
- z.literal("date"),
6062
- z.literal("email"),
6063
- z.literal("numeric"),
6064
- z.literal("password"),
6065
- z.literal("phone-number"),
6066
- z.literal("base64url")
6067
- ]);
6068
- var summarySummariserSchema = z.object({
6069
- defaultTitle: z.string().optional(),
6070
- defaultDescription: z.string().optional(),
6071
- defaultIcon: iconSchema.optional(),
6072
- defaultImage: imageLayoutSchema.optional(),
6073
- providesTitle: z.boolean().optional(),
6074
- providesDescription: z.boolean().optional(),
6075
- providesIcon: z.boolean().optional(),
6076
- providesImage: z.boolean().optional()
6062
+ var errorResponseBodySchema = z.object({
6063
+ refreshFormUrl: z.string().optional(),
6064
+ analytics: z.record(z.string()).optional(),
6065
+ error: z.string().optional(),
6066
+ validation: jsonElementSchema.optional(),
6067
+ refreshUrl: z.string().optional()
6077
6068
  });
6078
- var validateAsyncSchema = z.object({
6079
- param: z.string(),
6069
+ var searchSearchRequestSchema = z.object({
6070
+ url: z.string(),
6080
6071
  method: httpMethodSchema,
6081
- url: z.string()
6082
- });
6083
- var summaryProviderSchema = z.object({
6084
- providesTitle: z.boolean().optional(),
6085
- providesDescription: z.boolean().optional(),
6086
- providesIcon: z.boolean().optional(),
6087
- providesImage: z.boolean().optional()
6072
+ param: z.string(),
6073
+ query: z.string()
6088
6074
  });
6089
- var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
6090
6075
  var navigationStackBehaviorSchema = z.union([
6091
6076
  z.literal("default"),
6092
6077
  z.literal("remove-previous"),
6093
6078
  z.literal("remove-all"),
6094
6079
  z.literal("replace-current")
6095
6080
  ]);
6081
+ var linkSchema = z.object({
6082
+ url: z.string()
6083
+ });
6096
6084
  var actionTypeSchema = z.union([
6097
6085
  z.literal("primary"),
6098
6086
  z.literal("secondary"),
@@ -6100,9 +6088,11 @@ var actionTypeSchema = z.union([
6100
6088
  z.literal("positive"),
6101
6089
  z.literal("negative")
6102
6090
  ]);
6103
- var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
6104
- var linkSchema = z.object({
6105
- url: z.string()
6091
+ var iconNamedSchema = z.object({
6092
+ name: z.string()
6093
+ });
6094
+ var iconTextSchema = z.object({
6095
+ text: z.string()
6106
6096
  });
6107
6097
  var actionSchema = z.object({
6108
6098
  title: z.string().optional(),
@@ -6119,25 +6109,26 @@ var actionSchema = z.object({
6119
6109
  timeout: z.number().optional(),
6120
6110
  skipValidation: z.boolean().optional()
6121
6111
  });
6122
- var listLayoutItemSchema = z.object({
6123
- title: z.string(),
6124
- description: z.string().optional(),
6125
- icon: iconSchema,
6126
- status: listLayoutStatusSchema.optional()
6112
+ var markdownLayoutSchema = z.object({
6113
+ type: z.literal("markdown"),
6114
+ content: z.string(),
6115
+ align: alignSchema.optional(),
6116
+ control: z.string().optional(),
6117
+ margin: sizeSchema.optional()
6127
6118
  });
6128
- var decisionLayoutOptionSchema = z.object({
6129
- action: actionSchema,
6119
+ var searchLayoutSchema = z.object({
6120
+ type: z.literal("search"),
6130
6121
  title: z.string(),
6131
- description: z.string().optional(),
6132
- disabled: z.boolean().optional(),
6133
- icon: iconSchema.optional(),
6134
- image: imageLayoutSchema.optional()
6122
+ method: httpMethodSchema,
6123
+ url: z.string(),
6124
+ param: z.string(),
6125
+ emptyMessage: z.string().optional(),
6126
+ control: z.string().optional(),
6127
+ margin: sizeSchema.optional()
6135
6128
  });
6136
- var statusListLayoutItemSchema = z.object({
6129
+ var reviewLayoutCallToActionSchema = z.object({
6137
6130
  title: z.string(),
6138
- description: z.string().optional(),
6139
- icon: iconSchema,
6140
- status: statusListLayoutStatusSchema.optional()
6131
+ action: actionSchema
6141
6132
  });
6142
6133
  var instructionsLayoutSchema = z.object({
6143
6134
  type: z.literal("instructions"),
@@ -6146,26 +6137,39 @@ var instructionsLayoutSchema = z.object({
6146
6137
  control: z.string().optional(),
6147
6138
  margin: sizeSchema.optional()
6148
6139
  });
6149
- var buttonLayoutSchema = z.object({
6150
- type: z.literal("button"),
6151
- size: sizeSchema.optional(),
6152
- title: z.string().optional(),
6153
- action: actionSchema,
6154
- context: contextSchema.optional(),
6155
- disabled: z.boolean().optional(),
6156
- pinOrder: z.number().optional(),
6157
- control: z.string().optional(),
6158
- margin: sizeSchema.optional()
6159
- });
6140
+ var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
6160
6141
  var reviewLayoutFieldSchema = z.object({
6161
6142
  label: z.string(),
6162
6143
  value: z.string(),
6163
6144
  help: helpSchema.optional()
6164
6145
  });
6146
+ var statusListLayoutItemSchema = z.object({
6147
+ title: z.string(),
6148
+ description: z.string().optional(),
6149
+ icon: iconSchema,
6150
+ status: statusListLayoutStatusSchema.optional()
6151
+ });
6165
6152
  var behaviorSchema = z.object({
6166
6153
  action: actionSchema.optional(),
6167
6154
  link: linkSchema.optional()
6168
6155
  });
6156
+ var summarySummariserSchema = z.object({
6157
+ defaultTitle: z.string().optional(),
6158
+ defaultDescription: z.string().optional(),
6159
+ defaultIcon: iconSchema.optional(),
6160
+ defaultImage: imageLayoutSchema.optional(),
6161
+ providesTitle: z.boolean().optional(),
6162
+ providesDescription: z.boolean().optional(),
6163
+ providesIcon: z.boolean().optional(),
6164
+ providesImage: z.boolean().optional()
6165
+ });
6166
+ var linkHandlerSchema = z.object({
6167
+ regexPattern: z.string(),
6168
+ action: actionSchema
6169
+ });
6170
+ var actionResponseBodySchema = z.object({
6171
+ action: actionSchema
6172
+ });
6169
6173
  var searchResultSearchSchema = z.object({
6170
6174
  type: z.literal("search"),
6171
6175
  title: z.string(),
@@ -6182,20 +6186,6 @@ var searchResultActionSchema = z.object({
6182
6186
  image: imageLayoutSchema.optional(),
6183
6187
  value: actionSchema
6184
6188
  });
6185
- var actionResponseBodySchema = z.object({
6186
- action: actionSchema
6187
- });
6188
- var errorResponseBodySchema = z.object({
6189
- refreshFormUrl: z.string().optional(),
6190
- analytics: z.record(z.string()).optional(),
6191
- error: z.string().optional(),
6192
- validation: jsonElementSchema.optional(),
6193
- refreshUrl: z.string().optional()
6194
- });
6195
- var linkHandlerSchema = z.object({
6196
- regexPattern: z.string(),
6197
- action: actionSchema
6198
- });
6199
6189
  var pollingOnErrorSchema = z.object({
6200
6190
  action: actionSchema
6201
6191
  });
@@ -6203,26 +6193,33 @@ var navigationBackBehaviorSchema = z.object({
6203
6193
  title: z.string().optional(),
6204
6194
  action: actionSchema
6205
6195
  });
6206
- var reviewLayoutCallToActionSchema = z.object({
6207
- title: z.string(),
6208
- action: actionSchema
6209
- });
6210
- var alertLayoutCallToActionSchema = z.object({
6211
- title: z.string(),
6212
- accessibilityDescription: z.string().optional(),
6213
- behavior: behaviorSchema
6214
- });
6215
- var listLayoutSchema = z.object({
6216
- type: z.literal("list"),
6217
- items: z.array(listLayoutItemSchema),
6196
+ var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
6197
+ var buttonLayoutSchema = z.object({
6198
+ type: z.literal("button"),
6199
+ size: sizeSchema.optional(),
6218
6200
  title: z.string().optional(),
6201
+ action: actionSchema,
6202
+ context: contextSchema.optional(),
6203
+ disabled: z.boolean().optional(),
6204
+ pinOrder: z.number().optional(),
6219
6205
  control: z.string().optional(),
6220
6206
  margin: sizeSchema.optional()
6221
6207
  });
6222
- var decisionLayoutSchema = z.object({
6223
- type: z.literal("decision"),
6208
+ var decisionLayoutOptionSchema = z.object({
6209
+ action: actionSchema,
6210
+ title: z.string(),
6211
+ description: z.string().optional(),
6212
+ disabled: z.boolean().optional(),
6213
+ icon: iconSchema.optional(),
6214
+ image: imageLayoutSchema.optional()
6215
+ });
6216
+ var reviewLayoutSchema = z.object({
6217
+ type: z.literal("review"),
6218
+ orientation: z.string().optional(),
6219
+ action: actionSchema.optional(),
6220
+ fields: z.array(reviewLayoutFieldSchema),
6224
6221
  title: z.string().optional(),
6225
- options: z.array(decisionLayoutOptionSchema),
6222
+ callToAction: reviewLayoutCallToActionSchema.optional(),
6226
6223
  control: z.string().optional(),
6227
6224
  margin: sizeSchema.optional()
6228
6225
  });
@@ -6233,17 +6230,17 @@ var statusListLayoutSchema = z.object({
6233
6230
  control: z.string().optional(),
6234
6231
  margin: sizeSchema.optional()
6235
6232
  });
6236
- var reviewLayoutSchema = z.object({
6237
- type: z.literal("review"),
6238
- orientation: z.string().optional(),
6239
- action: actionSchema.optional(),
6240
- fields: z.array(reviewLayoutFieldSchema),
6241
- title: z.string().optional(),
6242
- callToAction: reviewLayoutCallToActionSchema.optional(),
6243
- control: z.string().optional(),
6244
- margin: sizeSchema.optional()
6233
+ var listLayoutItemSchema = z.object({
6234
+ title: z.string(),
6235
+ description: z.string().optional(),
6236
+ icon: iconSchema,
6237
+ status: listLayoutStatusSchema.optional()
6238
+ });
6239
+ var alertLayoutCallToActionSchema = z.object({
6240
+ title: z.string(),
6241
+ accessibilityDescription: z.string().optional(),
6242
+ behavior: behaviorSchema
6245
6243
  });
6246
- var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
6247
6244
  var pollingSchema = z.object({
6248
6245
  url: z.string(),
6249
6246
  interval: z.number().optional(),
@@ -6257,6 +6254,14 @@ var navigationSchema = z.object({
6257
6254
  back: navigationBackBehaviorSchema.optional(),
6258
6255
  stackBehavior: navigationStackBehaviorSchema.optional()
6259
6256
  });
6257
+ var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
6258
+ var decisionLayoutSchema = z.object({
6259
+ type: z.literal("decision"),
6260
+ title: z.string().optional(),
6261
+ options: z.array(decisionLayoutOptionSchema),
6262
+ control: z.string().optional(),
6263
+ margin: sizeSchema.optional()
6264
+ });
6260
6265
  var alertLayoutSchema = z.object({
6261
6266
  type: z.literal("alert"),
6262
6267
  markdown: z.string(),
@@ -6265,8 +6270,12 @@ var alertLayoutSchema = z.object({
6265
6270
  margin: sizeSchema.optional(),
6266
6271
  callToAction: alertLayoutCallToActionSchema.optional()
6267
6272
  });
6268
- var searchResponseBodySchema = z.object({
6269
- results: z.array(searchResultSchema)
6273
+ var listLayoutSchema = z.object({
6274
+ type: z.literal("list"),
6275
+ items: z.array(listLayoutItemSchema),
6276
+ title: z.string().optional(),
6277
+ control: z.string().optional(),
6278
+ margin: sizeSchema.optional()
6270
6279
  });
6271
6280
  var blobSchemaSchema = z.object({
6272
6281
  type: z.literal("blob"),
@@ -6306,6 +6315,19 @@ var constSchemaSchema = z.object({
6306
6315
  analyticsId: z.string().optional(),
6307
6316
  disabled: z.boolean().optional()
6308
6317
  });
6318
+ var searchResponseBodySchema = z.object({
6319
+ results: z.array(searchResultSchema)
6320
+ });
6321
+ var columnsLayoutSchema = z.lazy(
6322
+ () => z.object({
6323
+ type: z.literal("columns"),
6324
+ left: z.array(layoutSchema),
6325
+ right: z.array(layoutSchema),
6326
+ bias: columnsLayoutBiasSchema.optional(),
6327
+ control: z.string().optional(),
6328
+ margin: sizeSchema.optional()
6329
+ })
6330
+ );
6309
6331
  var layoutSchema = z.lazy(
6310
6332
  () => z.union([
6311
6333
  alertLayoutSchema,
@@ -6322,32 +6344,12 @@ var layoutSchema = z.lazy(
6322
6344
  listLayoutSchema,
6323
6345
  loadingIndicatorLayoutSchema,
6324
6346
  markdownLayoutSchema,
6325
- modalLayoutSchema,
6326
- paragraphLayoutSchema,
6327
- reviewLayoutSchema,
6328
- searchLayoutSchema,
6329
- statusListLayoutSchema
6330
- ])
6331
- );
6332
- var boxLayoutSchema = z.lazy(
6333
- () => z.object({
6334
- type: z.literal("box"),
6335
- components: z.array(layoutSchema),
6336
- width: sizeSchema.optional(),
6337
- border: z.boolean().optional(),
6338
- control: z.string().optional(),
6339
- margin: sizeSchema.optional()
6340
- })
6341
- );
6342
- var columnsLayoutSchema = z.lazy(
6343
- () => z.object({
6344
- type: z.literal("columns"),
6345
- left: z.array(layoutSchema),
6346
- right: z.array(layoutSchema),
6347
- bias: columnsLayoutBiasSchema.optional(),
6348
- control: z.string().optional(),
6349
- margin: sizeSchema.optional()
6350
- })
6347
+ modalLayoutSchema,
6348
+ paragraphLayoutSchema,
6349
+ reviewLayoutSchema,
6350
+ searchLayoutSchema,
6351
+ statusListLayoutSchema
6352
+ ])
6351
6353
  );
6352
6354
  var modalLayoutSchema = z.lazy(
6353
6355
  () => z.object({
@@ -6364,25 +6366,14 @@ var modalLayoutContentSchema = z.lazy(
6364
6366
  components: z.array(layoutSchema)
6365
6367
  })
6366
6368
  );
6367
- var stepSchema = z.lazy(
6369
+ var boxLayoutSchema = z.lazy(
6368
6370
  () => z.object({
6369
- key: z.string().optional(),
6370
- type: z.string().optional(),
6371
- actions: z.array(actionSchema).optional(),
6372
- refreshFormUrl: z.string().optional(),
6373
- id: z.string(),
6374
- title: z.string(),
6375
- schemas: z.array(schemaSchema),
6376
- layout: z.array(layoutSchema),
6377
- description: z.string().optional(),
6378
- model: jsonElementSchema.optional(),
6379
- external: externalSchema.optional(),
6380
- polling: pollingSchema.optional(),
6381
- linkHandlers: z.array(linkHandlerSchema).optional(),
6382
- analytics: z.record(z.string()).optional(),
6383
- errors: stepErrorSchema.optional(),
6384
- navigation: navigationSchema.optional(),
6385
- refreshUrl: z.string().optional()
6371
+ type: z.literal("box"),
6372
+ components: z.array(layoutSchema),
6373
+ width: sizeSchema.optional(),
6374
+ border: z.boolean().optional(),
6375
+ control: z.string().optional(),
6376
+ margin: sizeSchema.optional()
6386
6377
  })
6387
6378
  );
6388
6379
  var schemaSchema = z.lazy(
@@ -6608,17 +6599,21 @@ var stringSchemaSchema = z.lazy(
6608
6599
  help: helpSchema.optional()
6609
6600
  })
6610
6601
  );
6611
- var arraySchemaListSchema = z.lazy(
6602
+ var persistAsyncSchema = z.lazy(
6603
+ () => z.object({
6604
+ param: z.string(),
6605
+ idProperty: z.string(),
6606
+ schema: schemaSchema,
6607
+ url: z.string(),
6608
+ method: httpMethodSchema
6609
+ })
6610
+ );
6611
+ var arraySchemaTupleSchema = z.lazy(
6612
6612
  () => z.object({
6613
6613
  type: z.literal("array"),
6614
6614
  promoted: z.boolean().optional(),
6615
6615
  $id: z.string().optional(),
6616
- items: schemaSchema,
6617
- addItemTitle: z.string(),
6618
- editItemTitle: z.string(),
6619
- minItems: z.number().optional(),
6620
- maxItems: z.number().optional(),
6621
- placeholder: z.string().optional(),
6616
+ items: z.array(schemaSchema),
6622
6617
  title: z.string().optional(),
6623
6618
  description: z.string().optional(),
6624
6619
  control: z.string().optional(),
@@ -6626,30 +6621,24 @@ var arraySchemaListSchema = z.lazy(
6626
6621
  icon: iconSchema.optional(),
6627
6622
  image: imageSchema.optional(),
6628
6623
  keywords: z.array(z.string()).optional(),
6629
- summary: summarySummariserSchema.optional(),
6624
+ summary: summaryProviderSchema.optional(),
6630
6625
  analyticsId: z.string().optional(),
6631
6626
  persistAsync: persistAsyncSchema.optional(),
6632
6627
  validationAsync: validateAsyncSchema.optional(),
6633
- alert: alertLayoutSchema.optional(),
6634
- validationMessages: z.record(z.string()).optional(),
6635
- disabled: z.boolean().optional()
6636
- })
6637
- );
6638
- var persistAsyncSchema = z.lazy(
6639
- () => z.object({
6640
- param: z.string(),
6641
- idProperty: z.string(),
6642
- schema: schemaSchema,
6643
- url: z.string(),
6644
- method: httpMethodSchema
6628
+ alert: alertLayoutSchema.optional()
6645
6629
  })
6646
6630
  );
6647
- var arraySchemaTupleSchema = z.lazy(
6631
+ var arraySchemaListSchema = z.lazy(
6648
6632
  () => z.object({
6649
6633
  type: z.literal("array"),
6650
6634
  promoted: z.boolean().optional(),
6651
6635
  $id: z.string().optional(),
6652
- items: z.array(schemaSchema),
6636
+ items: schemaSchema,
6637
+ addItemTitle: z.string(),
6638
+ editItemTitle: z.string(),
6639
+ minItems: z.number().optional(),
6640
+ maxItems: z.number().optional(),
6641
+ placeholder: z.string().optional(),
6653
6642
  title: z.string().optional(),
6654
6643
  description: z.string().optional(),
6655
6644
  control: z.string().optional(),
@@ -6657,11 +6646,34 @@ var arraySchemaTupleSchema = z.lazy(
6657
6646
  icon: iconSchema.optional(),
6658
6647
  image: imageSchema.optional(),
6659
6648
  keywords: z.array(z.string()).optional(),
6660
- summary: summaryProviderSchema.optional(),
6649
+ summary: summarySummariserSchema.optional(),
6661
6650
  analyticsId: z.string().optional(),
6662
6651
  persistAsync: persistAsyncSchema.optional(),
6663
6652
  validationAsync: validateAsyncSchema.optional(),
6664
- alert: alertLayoutSchema.optional()
6653
+ alert: alertLayoutSchema.optional(),
6654
+ validationMessages: z.record(z.string()).optional(),
6655
+ disabled: z.boolean().optional()
6656
+ })
6657
+ );
6658
+ var stepSchema = z.lazy(
6659
+ () => z.object({
6660
+ key: z.string().optional(),
6661
+ type: z.string().optional(),
6662
+ actions: z.array(actionSchema).optional(),
6663
+ refreshFormUrl: z.string().optional(),
6664
+ id: z.string(),
6665
+ title: z.string(),
6666
+ schemas: z.array(schemaSchema),
6667
+ layout: z.array(layoutSchema),
6668
+ description: z.string().optional(),
6669
+ model: jsonElementSchema.optional(),
6670
+ external: externalSchema.optional(),
6671
+ polling: pollingSchema.optional(),
6672
+ linkHandlers: z.array(linkHandlerSchema).optional(),
6673
+ analytics: z.record(z.string()).optional(),
6674
+ errors: stepErrorSchema.optional(),
6675
+ navigation: navigationSchema.optional(),
6676
+ refreshUrl: z.string().optional()
6665
6677
  })
6666
6678
  );
6667
6679
  var validateStep = (step) => validate(step, stepSchema);
@@ -6808,84 +6820,34 @@ var createStepComponent = (stepProps) => {
6808
6820
  });
6809
6821
  };
6810
6822
 
6811
- // src/revamp/flow/response-utils.ts
6812
- var assertResponseIsValid = (response) => {
6813
- if (!isResponse(response)) {
6814
- throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
6815
- }
6816
- if (response.bodyUsed) {
6817
- throw new Error(
6818
- "The body of the provided Response object has already been used. Every request must respond with a new Response object."
6819
- );
6820
- }
6821
- };
6822
- var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
6823
- var parseResponseBodyAsJsonElement = async (response) => {
6824
- try {
6825
- return await response.json();
6826
- } catch (e) {
6827
- return null;
6828
- }
6829
- };
6830
- function isActionResponseBody(body) {
6831
- return validateActionResponse(body).valid;
6832
- }
6833
- function assertActionResponseBody(body) {
6834
- if (!isObject(body) || !isObject(body.action)) {
6835
- throw new Error(
6836
- "Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
6837
- );
6838
- }
6839
- }
6840
- function isErrorResponseBody(body) {
6841
- return Boolean(
6842
- isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
6843
- );
6844
- }
6845
- function assertStepResponseBody(body) {
6846
- if (!isObject(body)) {
6847
- throw new Error("Incorrect response body in step response. Expected an object.");
6848
- }
6849
- }
6850
-
6851
6823
  // src/revamp/domain/features/polling/getStepPolling.ts
6852
6824
  var getStepPolling = ({
6853
- httpClient,
6854
6825
  pollingConfig,
6855
- onAction
6826
+ onAction,
6827
+ onPoll
6856
6828
  }) => {
6857
6829
  const { interval, delay = interval, maxAttempts, url, onError } = pollingConfig;
6858
6830
  let abortController = new AbortController();
6859
6831
  if (delay == null) {
6860
6832
  throw new Error("Polling configuration must include delay or interval");
6861
6833
  }
6862
- const onFailure = () => {
6863
- stop();
6864
- void onAction(onError.action);
6865
- };
6866
6834
  let attempts = 0;
6867
6835
  const poll = () => {
6868
6836
  attempts += 1;
6869
6837
  abortController.abort();
6870
6838
  abortController = new AbortController();
6871
6839
  const { signal } = abortController;
6872
- httpClient(url, { signal }).then(async (response) => {
6873
- if (!response.ok) {
6874
- onFailure();
6840
+ onPoll(url, onError.action, signal).then((result) => {
6841
+ if (result) {
6842
+ stop();
6875
6843
  return;
6876
6844
  }
6877
- response.json().then((body) => {
6878
- if (isActionResponseBody(body)) {
6879
- void onAction(body.action);
6880
- stop();
6881
- }
6882
- }).catch(() => {
6883
- });
6845
+ if (attempts >= maxAttempts && !signal.aborted) {
6846
+ void onAction(onError.action);
6847
+ stop();
6848
+ }
6884
6849
  }).catch(() => {
6885
6850
  });
6886
- if (attempts >= maxAttempts && !signal.aborted) {
6887
- onFailure();
6888
- }
6889
6851
  };
6890
6852
  poll();
6891
6853
  const intervalRef = setInterval(poll, delay * 1e3);
@@ -7660,6 +7622,46 @@ var autocompleteTokenMap = {
7660
7622
  pager: "pager"
7661
7623
  };
7662
7624
 
7625
+ // src/revamp/flow/response-utils.ts
7626
+ var assertResponseIsValid = (response) => {
7627
+ if (!isResponse(response)) {
7628
+ throw new Error("Incorrect type of response from fetch. Expected object of type Response.");
7629
+ }
7630
+ if (response.bodyUsed) {
7631
+ throw new Error(
7632
+ "The body of the provided Response object has already been used. Every request must respond with a new Response object."
7633
+ );
7634
+ }
7635
+ };
7636
+ var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
7637
+ var parseResponseBodyAsJsonElement = async (response) => {
7638
+ try {
7639
+ return await response.json();
7640
+ } catch (e) {
7641
+ return null;
7642
+ }
7643
+ };
7644
+ function isActionResponseBody(body) {
7645
+ return validateActionResponse(body).valid;
7646
+ }
7647
+ function assertActionResponseBody(body) {
7648
+ if (!isObject(body) || !isObject(body.action)) {
7649
+ throw new Error(
7650
+ "Incorrect response body in action response. Expected an object satisfying the type { action: Action }."
7651
+ );
7652
+ }
7653
+ }
7654
+ function isErrorResponseBody(body) {
7655
+ return Boolean(
7656
+ isObject(body) && (body.refreshFormUrl || body.refreshUrl || body.validation || body.error || body.analytics)
7657
+ );
7658
+ }
7659
+ function assertStepResponseBody(body) {
7660
+ if (!isObject(body)) {
7661
+ throw new Error("Incorrect response body in step response. Expected an object.");
7662
+ }
7663
+ }
7664
+
7663
7665
  // src/revamp/domain/features/utils/response-utils.ts
7664
7666
  var getAnalyticsFromErrorResponse = (json) => {
7665
7667
  if (!isErrorResponseBody(json)) {
@@ -7860,7 +7862,7 @@ var schemaHasValidationAsync = (schema) => Boolean("validationAsync" in schema &
7860
7862
  // src/revamp/domain/mappers/schema/numberSchemaToComponent.ts
7861
7863
  var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
7862
7864
  const { schema, model, localValue, required = false } = schemaMapperProps;
7863
- const { autocompleteHint, validationMessages, default: defaultValue } = schema;
7865
+ const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
7864
7866
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
7865
7867
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
7866
7868
  const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
@@ -7883,6 +7885,8 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
7883
7885
  getAboveMaximumCheck(schema, errorMessageFunctions)
7884
7886
  ],
7885
7887
  value,
7888
+ maximum,
7889
+ minimum,
7886
7890
  persistedState,
7887
7891
  validationState,
7888
7892
  performPersistAsync,
@@ -8207,7 +8211,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8207
8211
  // src/revamp/domain/mappers/schema/integerSchemaToComponent.ts
8208
8212
  var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
8209
8213
  const { schema, localValue, model, required = false } = schemaMapperProps;
8210
- const { autocompleteHint, validationMessages, default: defaultValue } = schema;
8214
+ const { autocompleteHint, validationMessages, default: defaultValue, maximum, minimum } = schema;
8211
8215
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
8212
8216
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
8213
8217
  const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
@@ -8230,6 +8234,8 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
8230
8234
  __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
8231
8235
  autoComplete: getAutocompleteString(autocompleteHint),
8232
8236
  checks,
8237
+ maximum,
8238
+ minimum,
8233
8239
  persistedState,
8234
8240
  value,
8235
8241
  validationState,
@@ -8808,6 +8814,8 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8808
8814
  default: defaultValue,
8809
8815
  displayFormat,
8810
8816
  format,
8817
+ maxLength,
8818
+ minLength,
8811
8819
  validationMessages
8812
8820
  } = schema;
8813
8821
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
@@ -8835,6 +8843,8 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8835
8843
  ],
8836
8844
  control: control != null ? control : controlForLegacyFormat,
8837
8845
  displayFormat,
8846
+ maxLength,
8847
+ minLength,
8838
8848
  value,
8839
8849
  persistedState,
8840
8850
  validationState,
@@ -9013,7 +9023,7 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
9013
9023
  required = false,
9014
9024
  validationErrors
9015
9025
  } = schemaMapperProps;
9016
- const { items, addItemTitle, editItemTitle, summary } = schema;
9026
+ const { items, addItemTitle, editItemTitle, maxItems, minItems, summary } = schema;
9017
9027
  const value = isArray(localValue) ? localValue : [];
9018
9028
  const components = initialModel == null ? void 0 : initialModel.map(
9019
9029
  (item, index) => mapSchemaToComponent(
@@ -9050,6 +9060,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
9050
9060
  ],
9051
9061
  components: components != null ? components : [],
9052
9062
  editItemTitle,
9063
+ maxItems,
9064
+ minItems,
9053
9065
  summary,
9054
9066
  createEditableComponent,
9055
9067
  onValueChange
@@ -9362,7 +9374,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9362
9374
  )
9363
9375
  };
9364
9376
  });
9365
- const { title, validationMessages } = schema;
9377
+ const { maxItems, minItems, title, validationMessages } = schema;
9366
9378
  const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
9367
9379
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
9368
9380
  const { performValidationAsync, validationState } = getValidationAsyncInitialState(
@@ -9379,6 +9391,8 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9379
9391
  getBelowMinItemsCheck(schema, errorMessageFunctions)
9380
9392
  ],
9381
9393
  initialValue,
9394
+ maxItems,
9395
+ minItems,
9382
9396
  options,
9383
9397
  required,
9384
9398
  title,
@@ -10239,14 +10253,16 @@ var mapStepToComponent = (_a) => {
10239
10253
  var _b = _a, {
10240
10254
  loadingState,
10241
10255
  displayStepTitle,
10242
- trackEvent
10256
+ trackEvent,
10257
+ onPoll
10243
10258
  } = _b, restProps = __objRest(_b, [
10244
10259
  "loadingState",
10245
10260
  "displayStepTitle",
10246
- "trackEvent"
10261
+ "trackEvent",
10262
+ "onPoll"
10247
10263
  ]);
10248
10264
  var _a2, _b2;
10249
- const { httpClient, step, updateComponent } = restProps;
10265
+ const { step, updateComponent } = restProps;
10250
10266
  const { id, description, errors, external, key, layout = [], navigation, polling, title } = step;
10251
10267
  const backNavigation = (_a2 = navigation == null ? void 0 : navigation.back) != null ? _a2 : navigation == null ? void 0 : navigation.backButton;
10252
10268
  const back = backNavigation ? {
@@ -10276,7 +10292,7 @@ var mapStepToComponent = (_a) => {
10276
10292
  }
10277
10293
  };
10278
10294
  const onRefresh = async (schemaId, url) => restProps.onRefresh(schemaId, url != null ? url : refreshUrl);
10279
- const stepPolling = polling ? getStepPolling({ httpClient, pollingConfig: polling, onAction: restProps.onAction }) : void 0;
10295
+ const stepPolling = polling ? getStepPolling({ pollingConfig: polling, onAction: restProps.onAction, onPoll }) : void 0;
10280
10296
  const mapperProps = __spreadProps(__spreadValues({}, restProps), { trackEvent, onAction, onRefresh });
10281
10297
  const unreferencedSchemaFormComponents = mapUnreferencedSchemas(mapperProps);
10282
10298
  const layoutComponents = layout.map(
@@ -10342,8 +10358,19 @@ var executeRefresh = async (props) => {
10342
10358
  // src/revamp/flow/getResponseType.ts
10343
10359
  var responseTypes = ["step", "action", "exit"];
10344
10360
  var getResponseType = async (response) => {
10345
- var _a, _b;
10346
10361
  assertResponseIsValid(response);
10362
+ const headerResponseType = getResponseTypeFromHeader(response);
10363
+ if (headerResponseType) {
10364
+ return headerResponseType;
10365
+ }
10366
+ const jsonBody = await parseResponseBodyAsJsonElement(response.clone());
10367
+ if (isObject(jsonBody) && jsonBody.action) {
10368
+ return "action";
10369
+ }
10370
+ return "step";
10371
+ };
10372
+ var getResponseTypeFromHeader = (response) => {
10373
+ var _a, _b;
10347
10374
  if ((_a = response.headers) == null ? void 0 : _a.has("X-Df-Response-Type")) {
10348
10375
  const type = response.headers.get("X-Df-Response-Type");
10349
10376
  assertDFResponseType(type);
@@ -10352,11 +10379,7 @@ var getResponseType = async (response) => {
10352
10379
  if ((_b = response.headers) == null ? void 0 : _b.has("X-Df-Exit")) {
10353
10380
  return "exit";
10354
10381
  }
10355
- const jsonBody = await parseResponseBodyAsJsonElement(response.clone());
10356
- if (isObject(jsonBody) && jsonBody.action) {
10357
- return "action";
10358
- }
10359
- return "step";
10382
+ return void 0;
10360
10383
  };
10361
10384
  function assertDFResponseType(type) {
10362
10385
  if (!responseTypes.includes(type)) {
@@ -10647,6 +10670,48 @@ function useStableCallback(handler) {
10647
10670
  return (0, import_react2.useCallback)((...args) => ref.current ? ref.current(...args) : null, []);
10648
10671
  }
10649
10672
 
10673
+ // src/revamp/flow/executePoll.ts
10674
+ var executePoll = async (props) => {
10675
+ const { errorAction, signal, url, httpClient } = props;
10676
+ try {
10677
+ const response = await httpClient(url != null ? url : "", {
10678
+ method: "GET",
10679
+ signal
10680
+ });
10681
+ if (!response.ok) {
10682
+ return { type: "action", action: errorAction };
10683
+ }
10684
+ const responseType = getResponseTypeFromHeader(response);
10685
+ const body = await parseResponseBodyAsJsonElement(response);
10686
+ try {
10687
+ switch (responseType) {
10688
+ case "step": {
10689
+ const etag = response.headers.get("etag") || null;
10690
+ assertStepResponseBody(body);
10691
+ return { type: "replace-step", step: body, etag };
10692
+ }
10693
+ case "exit": {
10694
+ return { type: "complete", result: body };
10695
+ }
10696
+ case "action": {
10697
+ assertActionResponseBody(body);
10698
+ return { type: "action", action: body.action };
10699
+ }
10700
+ default: {
10701
+ if (isActionResponseBody(body)) {
10702
+ return { type: "action", action: body.action };
10703
+ }
10704
+ return { type: "continue" };
10705
+ }
10706
+ }
10707
+ } catch (error) {
10708
+ return { type: "action", action: errorAction };
10709
+ }
10710
+ } catch (error) {
10711
+ return { type: "continue" };
10712
+ }
10713
+ };
10714
+
10650
10715
  // src/revamp/useDynamicFlowCore.tsx
10651
10716
  function useDynamicFlowCore(props) {
10652
10717
  const _a = props, { flowId, initialAction, initialStep, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "displayStepTitle"]);
@@ -10715,6 +10780,7 @@ function useDynamicFlowCore(props) {
10715
10780
  httpClient,
10716
10781
  onAction,
10717
10782
  onRefresh,
10783
+ onPoll,
10718
10784
  onValueChange
10719
10785
  });
10720
10786
  setStepComponent(() => {
@@ -10848,6 +10914,31 @@ function useDynamicFlowCore(props) {
10848
10914
  // eslint-disable-next-line react-hooks/exhaustive-deps
10849
10915
  []
10850
10916
  );
10917
+ const onPoll = (0, import_react3.useCallback)(
10918
+ async (url, errorAction, signal) => {
10919
+ const command = await executePoll({
10920
+ httpClient,
10921
+ url,
10922
+ errorAction,
10923
+ signal
10924
+ });
10925
+ switch (command.type) {
10926
+ case "replace-step":
10927
+ initialiseWithStep(command.step, command.etag);
10928
+ return true;
10929
+ case "action":
10930
+ void onAction(command.action);
10931
+ return true;
10932
+ case "complete":
10933
+ onCompletion(command.result);
10934
+ return true;
10935
+ case "continue":
10936
+ return false;
10937
+ }
10938
+ },
10939
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10940
+ []
10941
+ );
10851
10942
  return { stepComponentRef };
10852
10943
  }
10853
10944
 
@@ -12598,6 +12689,8 @@ var TextInputRenderer = {
12598
12689
  description,
12599
12690
  help,
12600
12691
  error,
12692
+ maxLength,
12693
+ minLength,
12601
12694
  type,
12602
12695
  value: initialValue
12603
12696
  } = _a, rest = __objRest(_a, [
@@ -12607,6 +12700,8 @@ var TextInputRenderer = {
12607
12700
  "description",
12608
12701
  "help",
12609
12702
  "error",
12703
+ "maxLength",
12704
+ "minLength",
12610
12705
  "type",
12611
12706
  "value"
12612
12707
  ]);