@wise/dynamic-flow-client 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/build/common/constants/DateMode.js +2 -2
  2. package/build/common/constants/FormControlType.js +2 -2
  3. package/build/common/constants/MonthFormat.js +2 -2
  4. package/build/common/constants/SchemaType.js +2 -2
  5. package/build/common/constants/Size.js +2 -2
  6. package/build/common/constants/index.js +1 -1
  7. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +15 -27
  8. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +11 -9
  9. package/build/common/contexts/eventsContext/EventsContext.js +11 -28
  10. package/build/common/contexts/fetcherContexts/FetcherContexts.js +14 -27
  11. package/build/common/contexts/index.js +1 -1
  12. package/build/common/contexts/logContext/LogContext.js +12 -30
  13. package/build/common/hooks/index.js +1 -1
  14. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +3 -3
  15. package/build/common/hooks/useExternal/useExternal.js +8 -8
  16. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +20 -31
  17. package/build/common/hooks/usePersistAsync/usePersistAsync.js +60 -139
  18. package/build/common/hooks/usePolling/usePolling.js +20 -21
  19. package/build/common/hooks/usePrevious/usePrevious.js +5 -5
  20. package/build/common/hooks/useStepPolling/useStepPolling.js +15 -14
  21. package/build/common/makeFetcher/index.js +1 -1
  22. package/build/common/makeFetcher/makeFetcher.js +10 -24
  23. package/build/common/messages.js +5 -5
  24. package/build/common/utils/api-utils.js +3 -4
  25. package/build/common/utils/date-utils.js +11 -11
  26. package/build/common/utils/debounce.js +11 -15
  27. package/build/common/utils/file-utils.js +12 -25
  28. package/build/common/utils/id-utils.js +4 -5
  29. package/build/common/utils/index.js +1 -1
  30. package/build/common/utils/is-equal.js +8 -8
  31. package/build/common/utils/schema-utils.js +6 -6
  32. package/build/common/utils/step-utils.js +14 -14
  33. package/build/common/validators/index.js +7 -7
  34. package/build/common/validators/models/model-validators.js +8 -8
  35. package/build/common/validators/models/models.utils.js +29 -42
  36. package/build/common/validators/schemas/schema-validators.js +11 -13
  37. package/build/common/validators/types/type-validators.js +9 -13
  38. package/build/common/validators/validationFailures/validation-failures.js +14 -14
  39. package/build/common/validators/validationFailures/validation-failures.utils.js +5 -7
  40. package/build/common/validators/values/value-validators.js +4 -6
  41. package/build/dynamicFlow/DynamicFlow.js +185 -307
  42. package/build/dynamicFlow/DynamicFlowStep.js +12 -23
  43. package/build/dynamicFlow/DynamicFlowTypes.js +1 -1
  44. package/build/dynamicFlow/index.js +6 -14
  45. package/build/dynamicFlow/stories/DynamicFlow.story.js +20 -20
  46. package/build/dynamicFlow/stories/EditableDynamicFlow.js +20 -33
  47. package/build/dynamicFlow/stories/fixtureFetcher.js +46 -104
  48. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +22 -40
  49. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +6 -6
  50. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +10 -11
  51. package/build/dynamicFlow/utils/index.js +5 -2
  52. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +53 -118
  53. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +9 -9
  54. package/build/dynamicFlow/utils/useDynamicFlowState.js +51 -74
  55. package/build/dynamicFlow/utils/useLoader.js +9 -20
  56. package/build/fixtures/components/alert.js +8 -8
  57. package/build/fixtures/components/box.js +7 -7
  58. package/build/fixtures/components/button.js +25 -36
  59. package/build/fixtures/components/columns.js +10 -10
  60. package/build/fixtures/components/copyable.js +6 -6
  61. package/build/fixtures/components/decision.js +15 -15
  62. package/build/fixtures/components/heading.js +7 -7
  63. package/build/fixtures/components/image.js +10 -10
  64. package/build/fixtures/components/index.js +17 -25
  65. package/build/fixtures/components/info.js +22 -6
  66. package/build/fixtures/components/list.js +8 -8
  67. package/build/fixtures/components/loading-indicator.js +5 -5
  68. package/build/fixtures/components/paragraph.js +9 -9
  69. package/build/fixtures/components/review.js +11 -11
  70. package/build/fixtures/examples/camera-capture.js +29 -29
  71. package/build/fixtures/examples/index.js +9 -17
  72. package/build/fixtures/examples/recipient-update.js +69 -69
  73. package/build/fixtures/examples/recipient.js +63 -63
  74. package/build/fixtures/examples/single-file-upload.js +21 -21
  75. package/build/fixtures/examples/step-validation-errors.js +21 -21
  76. package/build/fixtures/features/action-response.js +8 -8
  77. package/build/fixtures/features/external.js +8 -8
  78. package/build/fixtures/features/index.js +9 -17
  79. package/build/fixtures/features/persist-async.js +11 -11
  80. package/build/fixtures/features/polling.js +9 -9
  81. package/build/fixtures/features/validation-async.js +10 -10
  82. package/build/fixtures/index.js +11 -22
  83. package/build/fixtures/jsonSchemaForm/allOf.js +30 -30
  84. package/build/fixtures/jsonSchemaForm/audRecipient.js +271 -271
  85. package/build/fixtures/jsonSchemaForm/currency.js +12 -12
  86. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +11 -11
  87. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +11 -11
  88. package/build/fixtures/jsonSchemaForm/oneOf.js +27 -27
  89. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +16 -16
  90. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +17 -17
  91. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +30 -30
  92. package/build/fixtures/jsonSchemaForm/simple.js +16 -16
  93. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +19 -19
  94. package/build/fixtures/jsonSchemaForm/validationAsync.js +8 -8
  95. package/build/fixtures/layouts/all.js +37 -37
  96. package/build/fixtures/layouts/final-step-layout.js +9 -9
  97. package/build/fixtures/layouts/index.js +10 -18
  98. package/build/fixtures/layouts/list.js +10 -10
  99. package/build/fixtures/layouts/pay-in.js +23 -23
  100. package/build/fixtures/layouts/review.js +38 -38
  101. package/build/fixtures/layouts/success.js +15 -15
  102. package/build/fixtures/responses/action-response-final.js +8 -8
  103. package/build/fixtures/responses/action.js +3 -3
  104. package/build/fixtures/responses/exit.js +3 -3
  105. package/build/fixtures/responses/index.js +8 -16
  106. package/build/fixtures/responses/recipient-update-final.js +8 -8
  107. package/build/fixtures/schemas/basic-form.js +11 -11
  108. package/build/fixtures/schemas/index.js +8 -16
  109. package/build/fixtures/schemas/number-and-integer.js +11 -11
  110. package/build/fixtures/schemas/one-of.js +43 -46
  111. package/build/fixtures/schemas/string-formats.js +15 -15
  112. package/build/fixtures/utils/image-util.js +8 -8
  113. package/build/formControl/FormControl.js +118 -148
  114. package/build/formControl/index.js +6 -14
  115. package/build/formControl/utils/index.js +1 -1
  116. package/build/formControl/utils/value-utils.js +18 -23
  117. package/build/i18n/index.js +31 -31
  118. package/build/index.js +13 -10
  119. package/build/jsonSchemaForm/JsonSchemaForm.js +12 -24
  120. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +24 -37
  121. package/build/jsonSchemaForm/allOfSchema/index.js +6 -14
  122. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +9 -20
  123. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +9 -20
  124. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +6 -14
  125. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +56 -115
  126. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +7 -7
  127. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +6 -14
  128. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +1 -1
  129. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +19 -71
  130. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +10 -11
  131. package/build/jsonSchemaForm/arrayTypeSchema/index.js +6 -14
  132. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +45 -62
  133. package/build/jsonSchemaForm/basicTypeSchema/index.js +6 -14
  134. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +39 -50
  135. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +18 -18
  136. package/build/jsonSchemaForm/controlFeedback/index.js +6 -14
  137. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +52 -61
  138. package/build/jsonSchemaForm/genericSchema/index.js +6 -14
  139. package/build/jsonSchemaForm/help/Help.js +9 -9
  140. package/build/jsonSchemaForm/help/Help.messages.js +5 -5
  141. package/build/jsonSchemaForm/help/index.js +6 -14
  142. package/build/jsonSchemaForm/index.js +6 -14
  143. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +28 -49
  144. package/build/jsonSchemaForm/objectSchema/index.js +6 -14
  145. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +54 -74
  146. package/build/jsonSchemaForm/oneOfSchema/index.js +6 -14
  147. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +3 -3
  148. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +1 -1
  149. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +19 -20
  150. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +11 -22
  151. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +5 -5
  152. package/build/jsonSchemaForm/persistAsyncSchema/index.js +6 -14
  153. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +73 -127
  154. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +6 -14
  155. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +45 -110
  156. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +17 -17
  157. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +6 -14
  158. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +28 -47
  159. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +6 -14
  160. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +4 -4
  161. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +13 -24
  162. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +11 -22
  163. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +12 -23
  164. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +24 -26
  165. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +6 -6
  166. package/build/jsonSchemaForm/readOnlySchema/index.js +6 -14
  167. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +26 -39
  168. package/build/jsonSchemaForm/schemaFormControl/index.js +6 -14
  169. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +5 -5
  170. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +1 -1
  171. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +30 -47
  172. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +57 -119
  173. package/build/jsonSchemaForm/validationAsyncSchema/index.js +6 -14
  174. package/build/layout/DynamicLayout.js +10 -21
  175. package/build/layout/alert/DynamicAlert.js +9 -9
  176. package/build/layout/box/DynamicBox.js +12 -23
  177. package/build/layout/button/DynamicButton.js +16 -27
  178. package/build/layout/columns/DynamicColumns.js +13 -24
  179. package/build/layout/decision/DynamicDecision.js +16 -27
  180. package/build/layout/divider/DynamicDivider.js +7 -8
  181. package/build/layout/external/DynamicExternal.js +16 -28
  182. package/build/layout/external/DynamicExternal.messages.js +5 -5
  183. package/build/layout/form/DynamicForm.js +10 -21
  184. package/build/layout/heading/DynamicHeading.js +12 -23
  185. package/build/layout/icon/DynamicIcon.js +9 -10
  186. package/build/layout/image/DynamicImage.js +43 -93
  187. package/build/layout/index.js +21 -29
  188. package/build/layout/info/DynamicInfo.js +7 -19
  189. package/build/layout/list/DynamicList.js +14 -26
  190. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +8 -9
  191. package/build/layout/paragraph/DynamicParagraph.js +19 -37
  192. package/build/layout/paragraph/DynamicParagraph.messages.js +6 -6
  193. package/build/layout/paragraph/useSnackBarIfAvailable.js +4 -4
  194. package/build/layout/review/DynamicReview.js +14 -26
  195. package/build/layout/utils.js +4 -6
  196. package/build/step/cameraStep/CameraStep.js +42 -88
  197. package/build/step/cameraStep/cameraCapture/CameraCapture.js +48 -105
  198. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +7 -7
  199. package/build/step/cameraStep/cameraCapture/components/index.js +10 -28
  200. package/build/step/cameraStep/cameraCapture/hooks/index.js +17 -72
  201. package/build/step/cameraStep/cameraCapture/index.js +6 -14
  202. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +33 -45
  203. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +8 -19
  204. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +6 -6
  205. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +9 -21
  206. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +7 -7
  207. package/build/step/cameraStep/cameraCapture/screens/index.js +6 -14
  208. package/build/step/cameraStep/cameraCapture/tracking/index.js +17 -99
  209. package/build/step/cameraStep/cameraCapture/utils/index.js +33 -96
  210. package/build/step/cameraStep/index.js +6 -14
  211. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +20 -21
  212. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +8 -8
  213. package/build/step/externalConfirmationStep/index.js +6 -14
  214. package/build/step/index.js +7 -15
  215. package/build/step/layoutStep/LayoutStep.js +19 -19
  216. package/build/step/layoutStep/index.js +6 -14
  217. package/build/step/layoutStep/utils/index.js +3 -14
  218. package/build/step/layoutStep/utils/inline-reference-utils.js +29 -46
  219. package/build/step/layoutStep/utils/layout-utils.js +34 -53
  220. package/build/types/common/FormControl.js +1 -1
  221. package/build/types/index.js +13 -13
  222. package/build/types/specification/Action.js +1 -1
  223. package/build/types/specification/FileUploadSchema.js +1 -1
  224. package/build/types/specification/LayoutComponent.js +1 -1
  225. package/build/types/specification/Model.js +9 -17
  226. package/build/types/specification/PersistAsync.js +1 -1
  227. package/build/types/specification/Polling.js +1 -1
  228. package/build/types/specification/Promotion.js +1 -1
  229. package/build/types/specification/Schema.js +8 -8
  230. package/build/types/specification/Step.js +3 -5
  231. package/build/types/specification/ValidationAsync.js +1 -1
  232. package/build/types/specification/core.js +1 -1
  233. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var step = {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const step = {
4
4
  key: 'Examples/Recipient Update',
5
5
  type: 'form',
6
6
  title: 'Edit recipient',
@@ -10,7 +10,7 @@ var step = {
10
10
  url: '/responses/recipientUpdate/?delay=5000',
11
11
  type: 'primary',
12
12
  method: 'PATCH',
13
- $id: 'submit'
13
+ $id: 'submit',
14
14
  },
15
15
  ],
16
16
  schemas: [
@@ -30,23 +30,23 @@ var step = {
30
30
  title: 'GBP',
31
31
  analyticsId: 'GBP',
32
32
  icon: {
33
- name: 'flag-gbp'
33
+ name: 'flag-gbp',
34
34
  },
35
35
  description: 'British pound',
36
- "const": 'GBP'
36
+ const: 'GBP',
37
37
  },
38
38
  ],
39
- readOnly: true
40
- }
39
+ readOnly: true,
40
+ },
41
41
  },
42
- required: []
42
+ required: [],
43
43
  },
44
44
  {
45
45
  title: 'Bank details',
46
46
  type: 'object',
47
47
  analyticsId: 'SortCode',
48
48
  icon: {
49
- name: 'bank'
49
+ name: 'bank',
50
50
  },
51
51
  displayOrder: ['name', 'details', 'address'],
52
52
  properties: {
@@ -62,16 +62,16 @@ var step = {
62
62
  validationMessages: {
63
63
  minLength: 'Name needs to be between 2 and 140 characters long.',
64
64
  maxLength: 'Recipient name cannot be longer than 140 characters.',
65
- pattern: 'This recipient name may contain invalid characters or is not the full name. Please try again.'
65
+ pattern: 'This recipient name may contain invalid characters or is not the full name. Please try again.',
66
66
  },
67
67
  autofillProvider: 'contact',
68
68
  autofillKey: 'contact.fullName',
69
69
  pattern: "^[0-9A-Za-zÀ-ÖØ-öø-ÿ-_()'*,.]+ +[0-9A-Za-zÀ-ÖØ-öø-ÿ-_()'*,.]+([0-9A-Za-zÀ-ÖØ-öø-ÿ-_()'*,. ]*)$",
70
70
  minLength: 2,
71
- maxLength: 140
72
- }
71
+ maxLength: 140,
72
+ },
73
73
  },
74
- required: []
74
+ required: [],
75
75
  },
76
76
  details: {
77
77
  type: 'object',
@@ -84,13 +84,13 @@ var step = {
84
84
  disabled: true,
85
85
  readOnly: true,
86
86
  validationMessages: {
87
- pattern: 'Please enter a valid bank code.'
87
+ pattern: 'Please enter a valid bank code.',
88
88
  },
89
89
  pattern: '^\\d{2}-?\\d{2}-?\\d{2}$',
90
90
  minLength: 6,
91
91
  maxLength: 8,
92
92
  format: 'numeric',
93
- displayFormat: '**-**-**'
93
+ displayFormat: '**-**-**',
94
94
  },
95
95
  accountNumber: {
96
96
  title: 'Account number',
@@ -101,15 +101,15 @@ var step = {
101
101
  validationMessages: {
102
102
  minLength: 'Account number is too short.',
103
103
  maxLength: 'Account number is too large.',
104
- pattern: 'Please enter a valid account number.'
104
+ pattern: 'Please enter a valid account number.',
105
105
  },
106
106
  pattern: '[0-9]{8}',
107
107
  minLength: 8,
108
108
  maxLength: 8,
109
- format: 'numeric'
110
- }
109
+ format: 'numeric',
110
+ },
111
111
  },
112
- required: []
112
+ required: [],
113
113
  },
114
114
  address: {
115
115
  title: 'Recipient address',
@@ -121,37 +121,37 @@ var step = {
121
121
  type: 'string',
122
122
  placeholder: 'Choose a country',
123
123
  oneOf: [
124
- { title: 'Argentina', "const": 'AR' },
125
- { title: 'Brazil', "const": 'BR' },
126
- { title: 'Canada', "const": 'CA' },
127
- { title: 'Denmark', "const": 'DK' },
128
- { title: 'Egypt', "const": 'EG' },
129
- { title: 'France', "const": 'FR' },
130
- { title: 'Germany', "const": 'DE' },
131
- { title: 'Honduras', "const": 'HN' },
132
- { title: 'Italy', "const": 'IT' },
133
- { title: 'Japan', "const": 'JP' },
134
- { title: 'Korea, Republic of', "const": 'KR' },
135
- { title: 'Liberia', "const": 'LR' },
136
- { title: 'Morocco', "const": 'MA' },
137
- { title: 'New Zealand', "const": 'NZ' },
138
- { title: 'Oman', "const": 'OM' },
139
- { title: 'Peru', "const": 'PE' },
140
- { title: 'Qatar', "const": 'QA' },
141
- { title: 'Russian Federation', "const": 'RU' },
142
- { title: 'Spain', "const": 'ES' },
143
- { title: 'Turkey', "const": 'TR' },
144
- { title: 'United Kingdom of Great Britain and Northern Ireland', "const": 'GB' },
145
- { title: 'United States of America', "const": 'US' },
146
- { title: 'Viet Nam', "const": 'VN' },
147
- { title: 'Yemen', "const": 'YE' },
148
- { title: 'Zimbabwe', "const": 'ZW' },
124
+ { title: 'Argentina', const: 'AR' },
125
+ { title: 'Brazil', const: 'BR' },
126
+ { title: 'Canada', const: 'CA' },
127
+ { title: 'Denmark', const: 'DK' },
128
+ { title: 'Egypt', const: 'EG' },
129
+ { title: 'France', const: 'FR' },
130
+ { title: 'Germany', const: 'DE' },
131
+ { title: 'Honduras', const: 'HN' },
132
+ { title: 'Italy', const: 'IT' },
133
+ { title: 'Japan', const: 'JP' },
134
+ { title: 'Korea, Republic of', const: 'KR' },
135
+ { title: 'Liberia', const: 'LR' },
136
+ { title: 'Morocco', const: 'MA' },
137
+ { title: 'New Zealand', const: 'NZ' },
138
+ { title: 'Oman', const: 'OM' },
139
+ { title: 'Peru', const: 'PE' },
140
+ { title: 'Qatar', const: 'QA' },
141
+ { title: 'Russian Federation', const: 'RU' },
142
+ { title: 'Spain', const: 'ES' },
143
+ { title: 'Turkey', const: 'TR' },
144
+ { title: 'United Kingdom of Great Britain and Northern Ireland', const: 'GB' },
145
+ { title: 'United States of America', const: 'US' },
146
+ { title: 'Viet Nam', const: 'VN' },
147
+ { title: 'Yemen', const: 'YE' },
148
+ { title: 'Zimbabwe', const: 'ZW' },
149
149
  ],
150
150
  validationMessages: {
151
- required: 'Please select a country.'
151
+ required: 'Please select a country.',
152
152
  },
153
153
  autofillProvider: 'contact',
154
- autofillKey: 'contact.countryCode'
154
+ autofillKey: 'contact.countryCode',
155
155
  },
156
156
  city: {
157
157
  title: 'City',
@@ -160,7 +160,7 @@ var step = {
160
160
  autofillKey: 'contact.city',
161
161
  pattern: '^.{1,255}$',
162
162
  minLength: 1,
163
- maxLength: 255
163
+ maxLength: 255,
164
164
  },
165
165
  firstLine: {
166
166
  title: 'Recipient address',
@@ -169,31 +169,31 @@ var step = {
169
169
  autofillKey: 'contact.firstLine',
170
170
  pattern: '^.{1,255}$',
171
171
  minLength: 1,
172
- maxLength: 255
172
+ maxLength: 255,
173
173
  },
174
174
  postCode: {
175
175
  title: 'Post code',
176
176
  type: 'string',
177
177
  validationMessages: {
178
178
  pattern: 'Please specify a valid post code.',
179
- required: "Please specify the recipient's post code."
179
+ required: "Please specify the recipient's post code.",
180
180
  },
181
181
  autofillProvider: 'contact',
182
182
  autofillKey: 'contact.postalCode',
183
183
  pattern: '^.{1,32}$',
184
184
  minLength: 1,
185
- maxLength: 32
186
- }
185
+ maxLength: 32,
186
+ },
187
187
  },
188
188
  required: ['country', 'city', 'firstLine', 'postCode'],
189
189
  help: {
190
- markdown: "For legal reasons, we need to ask for the recipient's address (not the bank's address). Don't worry, they won't get any post from us."
191
- }
192
- }
190
+ markdown: "For legal reasons, we need to ask for the recipient's address (not the bank's address). Don't worry, they won't get any post from us.",
191
+ },
192
+ },
193
193
  },
194
- required: ['address']
194
+ required: ['address'],
195
195
  },
196
- ]
196
+ ],
197
197
  },
198
198
  ],
199
199
  errors: {
@@ -202,9 +202,9 @@ var step = {
202
202
  country: 'Please select a country.',
203
203
  city: 'Please enter a city.',
204
204
  postCode: 'Please enter a post code.',
205
- firstLine: 'Please enter a residential address.'
206
- }
207
- }
205
+ firstLine: 'Please enter a residential address.',
206
+ },
207
+ },
208
208
  },
209
209
  refreshFormUrl: '/steps/recipientUpdate/?refresh',
210
210
  model: {
@@ -219,34 +219,34 @@ var step = {
219
219
  profileId: 5461759,
220
220
  legalEntityType: 'PERSON',
221
221
  name: {
222
- fullName: 'Fergus Jordan'
222
+ fullName: 'Fergus Jordan',
223
223
  },
224
224
  currency: 'GBP',
225
225
  details: {
226
226
  accountNumber: '27832001',
227
227
  sortCode: '040004',
228
- hashedByLooseHashAlgorithm: '5c577703b845c613532bf0e08bbb38ce37644f76af58e1af6fa7447df7041a27'
228
+ hashedByLooseHashAlgorithm: '5c577703b845c613532bf0e08bbb38ce37644f76af58e1af6fa7447df7041a27',
229
229
  },
230
230
  id: 67912450,
231
231
  hash: 'fe319d809ce8a4f155412afe1b62bc2f1abf6e4af89f762a85a47811f54dab53',
232
232
  commonFieldMap: {
233
233
  bankCodeField: 'sortCode',
234
- accountNumberField: 'accountNumber'
235
- }
234
+ accountNumberField: 'accountNumber',
235
+ },
236
236
  },
237
237
  layout: [
238
238
  {
239
239
  schema: {
240
- $ref: 'form'
240
+ $ref: 'form',
241
241
  },
242
- type: 'form'
242
+ type: 'form',
243
243
  },
244
244
  {
245
245
  type: 'button',
246
246
  action: {
247
- $ref: 'submit'
248
- }
247
+ $ref: 'submit',
248
+ },
249
249
  },
250
- ]
250
+ ],
251
251
  };
252
- exports["default"] = step;
252
+ exports.default = step;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var step = {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const step = {
4
4
  key: 'Examples/Recipient Creation',
5
5
  type: 'form',
6
6
  title: 'Recipient Creation Example',
@@ -17,7 +17,7 @@ var step = {
17
17
  profileId: {
18
18
  type: 'number',
19
19
  hidden: true,
20
- "const": 123456789
20
+ const: 123456789,
21
21
  },
22
22
  currency: {
23
23
  title: 'Currency',
@@ -28,44 +28,44 @@ var step = {
28
28
  title: 'EUR',
29
29
  analyticsId: 'currency-eur',
30
30
  icon: {
31
- name: 'flag-eur'
31
+ name: 'flag-eur',
32
32
  },
33
33
  description: 'Euro',
34
- "const": 'EUR'
34
+ const: 'EUR',
35
35
  },
36
36
  {
37
37
  title: 'GBP',
38
38
  analyticsId: 'currency-gbp',
39
39
  icon: {
40
- name: 'flag-gbp'
40
+ name: 'flag-gbp',
41
41
  },
42
42
  description: 'British pound',
43
- "const": 'GBP'
43
+ const: 'GBP',
44
44
  },
45
45
  {
46
46
  title: 'INR',
47
47
  analyticsId: 'currency-inr',
48
48
  icon: {
49
- name: 'flag-inr'
49
+ name: 'flag-inr',
50
50
  },
51
51
  description: 'Indian rupee',
52
- "const": 'INR'
52
+ const: 'INR',
53
53
  },
54
54
  {
55
55
  title: 'USD',
56
56
  analyticsId: 'currency-usd',
57
57
  icon: {
58
- name: 'flag-usd'
58
+ name: 'flag-usd',
59
59
  },
60
60
  description: 'United States dollar',
61
- "const": 'USD'
61
+ const: 'USD',
62
62
  },
63
63
  ],
64
64
  validationMessages: {
65
- required: 'Please enter currency.'
65
+ required: 'Please enter currency.',
66
66
  },
67
- "default": 'EUR',
68
- refreshFormOnChange: true
67
+ default: 'EUR',
68
+ refreshFormOnChange: true,
69
69
  },
70
70
  legalEntityType: {
71
71
  title: 'Select recipient type',
@@ -75,18 +75,18 @@ var step = {
75
75
  {
76
76
  title: 'Person',
77
77
  analyticsId: 'legalEntityType-person',
78
- "const": 'PERSON'
78
+ const: 'PERSON',
79
79
  },
80
80
  {
81
81
  title: 'Business',
82
82
  analyticsId: 'legalEntityType-business',
83
- "const": 'INSTITUTION'
83
+ const: 'INSTITUTION',
84
84
  },
85
85
  ],
86
86
  validationMessages: {
87
- required: 'Please specify the type of recipient.'
87
+ required: 'Please specify the type of recipient.',
88
88
  },
89
- refreshFormOnChange: true
89
+ refreshFormOnChange: true,
90
90
  },
91
91
  email: {
92
92
  title: 'Their email',
@@ -95,17 +95,17 @@ var step = {
95
95
  placeholder: 'example@example.ex',
96
96
  validationMessages: {
97
97
  maxLength: 'The email you have entered is too long.',
98
- pattern: 'The email address is invalid.'
98
+ pattern: 'The email address is invalid.',
99
99
  },
100
100
  refreshFormOnChange: true,
101
101
  autofillProvider: 'contact',
102
102
  autofillKey: 'contact.email',
103
103
  refreshFormUrl: '/steps/recipient',
104
104
  pattern: "\\s*[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+\\s*",
105
- maxLength: 255
106
- }
105
+ maxLength: 255,
106
+ },
107
107
  },
108
- required: ['currency', 'legalEntityType']
108
+ required: ['currency', 'legalEntityType'],
109
109
  },
110
110
  {
111
111
  title: 'Bank details',
@@ -128,22 +128,22 @@ var step = {
128
128
  minLength: 'Name needs to be between 2 and 140 characters long.',
129
129
  maxLength: 'Recipient name cannot be longer than 140 characters.',
130
130
  pattern: 'This recipient name contains invalid characters. Please use latin characters only.',
131
- required: 'Name cannot be empty.'
131
+ required: 'Name cannot be empty.',
132
132
  },
133
133
  autofillProvider: 'contact',
134
134
  autofillKey: 'contact.fullName',
135
135
  pattern: '^[0-9A-Za-zÀ-ÖØ-öø-ÿ-_()\'*,.%#^@&{}~<>+$"\\[\\]\\\\ ]+$',
136
136
  minLength: 2,
137
- maxLength: 140
138
- }
137
+ maxLength: 140,
138
+ },
139
139
  },
140
- required: ['fullName']
140
+ required: ['fullName'],
141
141
  },
142
142
  ownedByCustomer: {
143
143
  title: 'My own Account',
144
144
  type: 'boolean',
145
145
  hidden: true,
146
- "const": false
146
+ const: false,
147
147
  },
148
148
  details: {
149
149
  type: 'object',
@@ -157,11 +157,11 @@ var step = {
157
157
  validationMessages: {
158
158
  minLength: 'The BIC you have entered is too short.',
159
159
  maxLength: 'The BIC you have entered is too long.',
160
- pattern: 'Please specify a valid BIC.'
160
+ pattern: 'Please specify a valid BIC.',
161
161
  },
162
162
  pattern: '^[A-Za-z]{6}[A-Za-z\\d]{2}([A-Za-z\\d]{3})?$',
163
163
  minLength: 8,
164
- maxLength: 11
164
+ maxLength: 11,
165
165
  },
166
166
  iban: {
167
167
  title: 'IBAN',
@@ -169,33 +169,33 @@ var step = {
169
169
  placeholder: 'DE12345678901234567890',
170
170
  displayFormat: '**** **** **** **** **** **** **** ****',
171
171
  help: {
172
- markdown: 'IBANs are long account numbers used by banks for cross-border transfers. Each country structures this number differently, but it always starts with a 2 digit country code (e.g. DE for Germany).'
172
+ markdown: 'IBANs are long account numbers used by banks for cross-border transfers. Each country structures this number differently, but it always starts with a 2 digit country code (e.g. DE for Germany).',
173
173
  },
174
174
  validationMessages: {
175
175
  minLength: 'The IBAN you have entered is too short.',
176
176
  maxLength: 'The IBAN you have entered is too long.',
177
177
  pattern: 'Please specify a valid IBAN.',
178
- required: 'Please specify an IBAN.'
178
+ required: 'Please specify an IBAN.',
179
179
  },
180
180
  refreshFormOnChange: true,
181
181
  pattern: '^[a-zA-Z]{2}[a-zA-Z0-9 ]{12,40}$',
182
182
  minLength: 14,
183
- maxLength: 42
184
- }
183
+ maxLength: 42,
184
+ },
185
185
  },
186
- required: ['iban']
186
+ required: ['iban'],
187
187
  },
188
188
  type: {
189
189
  title: 'Type',
190
190
  type: 'string',
191
191
  hidden: true,
192
- "const": 'Iban'
193
- }
192
+ const: 'Iban',
193
+ },
194
194
  },
195
195
  required: ['type', 'name', 'details'],
196
196
  icon: {
197
- name: 'bank'
198
- }
197
+ name: 'bank',
198
+ },
199
199
  },
200
200
  {
201
201
  title: 'Outside Europe',
@@ -214,22 +214,22 @@ var step = {
214
214
  minLength: 'Name needs to be between 2 and 140 characters long.',
215
215
  maxLength: 'Recipient name cannot be longer than 140 characters.',
216
216
  pattern: 'This recipient name contains invalid characters. Please use latin characters only.',
217
- required: 'Name cannot be empty.'
217
+ required: 'Name cannot be empty.',
218
218
  },
219
219
  autofillProvider: 'contact',
220
220
  autofillKey: 'contact.fullName',
221
221
  pattern: '^[0-9A-Za-zÀ-ÖØ-öø-ÿ-_()\'*,.%#^@&{}~<>+$"\\[\\]\\\\ ]+$',
222
222
  minLength: 2,
223
- maxLength: 140
224
- }
223
+ maxLength: 140,
224
+ },
225
225
  },
226
- required: ['fullName']
226
+ required: ['fullName'],
227
227
  },
228
228
  ownedByCustomer: {
229
229
  title: 'My own Account',
230
230
  type: 'boolean',
231
231
  hidden: true,
232
- "const": false
232
+ const: false,
233
233
  },
234
234
  details: {
235
235
  type: 'object',
@@ -243,11 +243,11 @@ var step = {
243
243
  minLength: 'The BIC you have entered is too short.',
244
244
  maxLength: 'The BIC you have entered is too long.',
245
245
  pattern: 'Please specify a valid BIC.',
246
- required: 'Please specify a BIC.'
246
+ required: 'Please specify a BIC.',
247
247
  },
248
248
  pattern: '^[a-zA-Z]{6}(([a-zA-Z0-9]{2})|([a-zA-Z0-9]{5}))$',
249
249
  minLength: 8,
250
- maxLength: 11
250
+ maxLength: 11,
251
251
  },
252
252
  accountNumber: {
253
253
  title: 'IBAN / Account Number',
@@ -257,36 +257,36 @@ var step = {
257
257
  minLength: 'Account number is too short.',
258
258
  maxLength: 'Account number is too large.',
259
259
  pattern: 'Please enter a valid account number.',
260
- required: 'Please enter an IBAN or account number.'
260
+ required: 'Please enter an IBAN or account number.',
261
261
  },
262
262
  pattern: '^[a-zA-Z0-9]{4,34}$',
263
263
  minLength: 4,
264
- maxLength: 34
265
- }
264
+ maxLength: 34,
265
+ },
266
266
  },
267
- required: ['bic', 'accountNumber']
267
+ required: ['bic', 'accountNumber'],
268
268
  },
269
269
  type: {
270
270
  title: 'Type',
271
271
  type: 'string',
272
272
  hidden: true,
273
- "const": 'SwiftCode'
274
- }
273
+ const: 'SwiftCode',
274
+ },
275
275
  },
276
276
  required: ['type', 'name', 'details'],
277
277
  icon: {
278
- name: 'bank'
278
+ name: 'bank',
279
279
  },
280
280
  alert: {
281
281
  context: 'warning',
282
- markdown: 'To send EUR to this account, we need to use the SWIFT network. It’s slower, so the transfer might take a day or two longer. Also note that intermediary banks and your recipient’s bank might charge extra fees to the amount received.'
283
- }
282
+ markdown: 'To send EUR to this account, we need to use the SWIFT network. It’s slower, so the transfer might take a day or two longer. Also note that intermediary banks and your recipient’s bank might charge extra fees to the amount received.',
283
+ },
284
284
  },
285
285
  ],
286
286
  control: 'tab',
287
- placeholder: 'Please select where you are sending to...'
287
+ placeholder: 'Please select where you are sending to...',
288
288
  },
289
- ]
289
+ ],
290
290
  },
291
291
  ],
292
292
  refreshFormUrl: '/steps/recipient',
@@ -294,8 +294,8 @@ var step = {
294
294
  {
295
295
  type: 'form',
296
296
  schema: {
297
- $ref: '#new-recipient'
298
- }
297
+ $ref: '#new-recipient',
298
+ },
299
299
  },
300
300
  {
301
301
  type: 'button',
@@ -303,13 +303,13 @@ var step = {
303
303
  type: 'primary',
304
304
  title: 'Confirm',
305
305
  url: '/v2/accounts',
306
- method: 'POST'
307
- }
306
+ method: 'POST',
307
+ },
308
308
  },
309
309
  ],
310
310
  model: {
311
311
  ownedByCustomer: false,
312
- details: {}
313
- }
312
+ details: {},
313
+ },
314
314
  };
315
- exports["default"] = step;
315
+ exports.default = step;