@wise/dynamic-flow-client 5.8.1 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/DynamicFlowCore.js +5 -0
- package/build/common/errorBoundary/ErrorBoundary.js +26 -0
- package/build/common/errorBoundary/ErrorBoundary.test.js +29 -0
- package/build/common/errorBoundary/ErrorBoundaryAlert.js +11 -0
- package/build/common/makeHttpClient/api-utils.js +3 -0
- package/build/common/makeHttpClient/index.js +1 -0
- package/build/common/makeHttpClient/makeHttpClient.js +10 -0
- package/build/common/makeHttpClient/makeHttpClient.test.js +186 -0
- package/build/common/messages/external-confirmation.messages.js +23 -0
- package/build/common/messages/file-upload.messages.js +13 -0
- package/build/common/messages/generic-error.messages.js +18 -0
- package/build/common/messages/help.messages.js +8 -0
- package/build/common/messages/multi-file-upload.messages.js +18 -0
- package/build/common/messages/multi-select.messages.js +8 -0
- package/build/common/messages/paragraph.messages.js +13 -0
- package/build/common/messages/repeatable.messages.js +23 -0
- package/build/common/messages/search.messages.js +8 -0
- package/build/common/messages/validation.array.messages.js +13 -0
- package/build/common/messages/validation.messages.js +53 -0
- package/build/controller/FlowController.js +368 -0
- package/build/controller/executePoll.js +49 -0
- package/build/controller/executeRefresh.js +39 -0
- package/build/controller/executeRequest.js +77 -0
- package/build/controller/executeSubmission.js +69 -0
- package/build/controller/getErrorMessage.js +7 -0
- package/build/controller/getRequestAbortController.js +13 -0
- package/build/controller/getResponseType.js +35 -0
- package/build/controller/getSafeHttpClient.js +8 -0
- package/build/controller/getStepCounter.js +16 -0
- package/build/controller/handleErrorResponse.js +26 -0
- package/build/controller/makeSafeHttpClient.js +8 -0
- package/build/controller/response-utils.js +72 -0
- package/build/domain/components/AlertComponent.js +1 -0
- package/build/domain/components/AllOfComponent.js +40 -0
- package/build/domain/components/BooleanInputComponent.js +50 -0
- package/build/domain/components/BoxComponent.js +3 -0
- package/build/domain/components/ButtonComponent.js +1 -0
- package/build/domain/components/ColumnsComponent.js +3 -0
- package/build/domain/components/ConstComponent.js +18 -0
- package/build/domain/components/ContainerComponent.js +3 -0
- package/build/domain/components/DateInputComponent.js +75 -0
- package/build/domain/components/DecisionComponent.js +1 -0
- package/build/domain/components/DividerComponent.js +1 -0
- package/build/domain/components/FormComponent.js +3 -0
- package/build/domain/components/FormattedValueComponent.js +44 -0
- package/build/domain/components/HeadingComponent.js +1 -0
- package/build/domain/components/ImageComponent.js +1 -0
- package/build/domain/components/InstructionsComponent.js +1 -0
- package/build/domain/components/IntegerInputComponent.js +74 -0
- package/build/domain/components/ListComponent.js +1 -0
- package/build/domain/components/LoadingIndicatorComponent.js +1 -0
- package/build/domain/components/MarkdownComponent.js +1 -0
- package/build/domain/components/MediaComponent.js +1 -0
- package/build/domain/components/ModalComponent.js +16 -0
- package/build/domain/components/ModalLayoutComponent.js +3 -0
- package/build/domain/components/MoneyInputComponent.js +57 -0
- package/build/domain/components/MultiSelectInputComponent.js +81 -0
- package/build/domain/components/MultiUploadInputComponent.js +88 -0
- package/build/domain/components/NumberInputComponent.js +73 -0
- package/build/domain/components/ObjectComponent.js +45 -0
- package/build/domain/components/ParagraphComponent.js +1 -0
- package/build/domain/components/PersistAsyncComponent.js +92 -0
- package/build/domain/components/ProgressComponent.js +1 -0
- package/build/domain/components/RepeatableComponent.js +103 -0
- package/build/domain/components/ReviewComponent.js +1 -0
- package/build/domain/components/RootDomainComponent.js +173 -0
- package/build/domain/components/SectionComponent.js +5 -0
- package/build/domain/components/SelectInputComponent.js +88 -0
- package/build/domain/components/StatusListComponent.js +1 -0
- package/build/domain/components/SubflowDomainComponent.js +9 -0
- package/build/domain/components/TabsComponent.js +1 -0
- package/build/domain/components/TextInputComponent.js +76 -0
- package/build/domain/components/TupleComponent.js +41 -0
- package/build/domain/components/UploadInputComponent.js +83 -0
- package/build/domain/components/UpsellComponent.js +25 -0
- package/build/domain/components/searchComponent/SearchComponent.js +92 -0
- package/build/domain/components/searchComponent/SearchComponent.test.js +190 -0
- package/build/domain/components/step/ExternalConfirmationComponent.js +28 -0
- package/build/domain/components/step/StepDomainComponent.js +73 -0
- package/build/domain/components/step/ToolbarComponent.js +1 -0
- package/build/domain/components/utils/WithUpdate.js +1 -0
- package/build/domain/components/utils/component-utils.js +12 -0
- package/build/domain/components/utils/debounce.js +34 -0
- package/build/domain/components/utils/debounce.test.js +67 -0
- package/build/domain/components/utils/file-utils.js +21 -0
- package/build/domain/components/utils/file-utils.test.js +27 -0
- package/build/domain/components/utils/getRandomId.js +1 -0
- package/build/domain/components/utils/isExactLocalValueMatch.js +14 -0
- package/build/domain/components/utils/isOrWasValid.js +5 -0
- package/build/domain/components/utils/isPartialModelMatch.js +18 -0
- package/build/domain/components/utils/isPartialModelMatch.test.js +74 -0
- package/build/domain/features/eventNames.js +24 -0
- package/build/domain/features/events.js +1 -0
- package/build/domain/features/persistAsync/getComponentMultiPersistAsync.js +50 -0
- package/build/domain/features/persistAsync/getInitialPersistedState.js +7 -0
- package/build/domain/features/persistAsync/getPerformPersistAsync.js +43 -0
- package/build/domain/features/persistAsync/getPerformPersistAsync.test.js +139 -0
- package/build/domain/features/polling/getStepPolling.js +43 -0
- package/build/domain/features/polling/getStepPolling.test.js +90 -0
- package/build/domain/features/prefetch/getStepPrefetch.js +43 -0
- package/build/domain/features/prefetch/request-cache.js +49 -0
- package/build/domain/features/prefetch/request-cache.test.js +70 -0
- package/build/domain/features/refreshAfter/getStepRefreshAfter.js +24 -0
- package/build/domain/features/refreshAfter/getStepRefreshAfter.test.js +40 -0
- package/build/domain/features/schema-on-change/getDebouncedSchemaOnChange.js +50 -0
- package/build/domain/features/schema-on-change/getSchemaOnChange.js +34 -0
- package/build/domain/features/search/getPerformSearchFunction.js +75 -0
- package/build/domain/features/search/getPerformSearchFunction.test.js +301 -0
- package/build/domain/features/summary/summary-utils.js +40 -0
- package/build/domain/features/summary/summary-utils.test.js +125 -0
- package/build/domain/features/utils/http-utils.js +21 -0
- package/build/domain/features/utils/response-utils.js +9 -0
- package/build/domain/features/validation/spec-utils.js +19 -0
- package/build/domain/features/validation/validateStringPattern.js +24 -0
- package/build/domain/features/validation/validation-functions.js +6 -0
- package/build/domain/features/validation/validation-functions.test.js +108 -0
- package/build/domain/features/validation/value-checks.js +125 -0
- package/build/domain/features/validation/value-checks.test.js +262 -0
- package/build/domain/features/validationAsync/getComponentValidationAsync.js +53 -0
- package/build/domain/features/validationAsync/getComponentValidationAsync.test.js +67 -0
- package/build/domain/features/validationAsync/getInitialValidationAsyncState.js +5 -0
- package/build/domain/features/validationAsync/getPerformValidationAsync.js +45 -0
- package/build/domain/features/validationAsync/getPerformValidationAsync.test.js +143 -0
- package/build/domain/mappers/layout/alertLayoutToComponent.js +16 -0
- package/build/domain/mappers/layout/boxLayoutToComponent.js +13 -0
- package/build/domain/mappers/layout/buttonLayoutToComponent.js +77 -0
- package/build/domain/mappers/layout/columnsLayoutToComponent.js +13 -0
- package/build/domain/mappers/layout/decisionLayoutToComponent.js +22 -0
- package/build/domain/mappers/layout/deprecatedListLayoutToComponent.js +30 -0
- package/build/domain/mappers/layout/dividerLayoutToComponent.js +2 -0
- package/build/domain/mappers/layout/formLayoutToComponent.js +19 -0
- package/build/domain/mappers/layout/headingLayoutToComponent.js +12 -0
- package/build/domain/mappers/layout/imageLayoutToComponent.js +20 -0
- package/build/domain/mappers/layout/infoLayoutToComponent.js +12 -0
- package/build/domain/mappers/layout/instructionsLayoutToComponent.js +12 -0
- package/build/domain/mappers/layout/listLayoutToComponent.js +39 -0
- package/build/domain/mappers/layout/loadingIndicatorLayoutToComponent.js +9 -0
- package/build/domain/mappers/layout/markdownLayoutToComponent.js +12 -0
- package/build/domain/mappers/layout/mediaLayoutToComponent.js +12 -0
- package/build/domain/mappers/layout/modalLayoutToComponent.js +17 -0
- package/build/domain/mappers/layout/modalToComponent.js +8 -0
- package/build/domain/mappers/layout/paragraphLayoutToComponent.js +12 -0
- package/build/domain/mappers/layout/progressLayoutToComponent.js +15 -0
- package/build/domain/mappers/layout/reviewLayoutToComponent.js +48 -0
- package/build/domain/mappers/layout/searchLayoutToComponent.js +44 -0
- package/build/domain/mappers/layout/sectionLayoutToComponent.js +15 -0
- package/build/domain/mappers/layout/statusListLayoutToComponent.js +15 -0
- package/build/domain/mappers/layout/tabsLayoutToComponent.js +16 -0
- package/build/domain/mappers/layout/upsellLayoutToComponent.js +25 -0
- package/build/domain/mappers/mapLayoutToComponent.js +81 -0
- package/build/domain/mappers/mapSchemaToComponent.js +61 -0
- package/build/domain/mappers/mapSchemaToComponent.test.js +112 -0
- package/build/domain/mappers/mapStepSchemas.js +17 -0
- package/build/domain/mappers/mapStepToComponent.js +132 -0
- package/build/domain/mappers/mapStepToComponent.test.js +221 -0
- package/build/domain/mappers/mapToolbarToComponent.js +15 -0
- package/build/domain/mappers/schema/allOfSchemaToComponent.js +16 -0
- package/build/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.js +26 -0
- package/build/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.js +55 -0
- package/build/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.js +67 -0
- package/build/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +57 -0
- package/build/domain/mappers/schema/arraySchemaToComponent/arraySchemaToTupleComponent.js +20 -0
- package/build/domain/mappers/schema/blobSchemaToComponent.js +15 -0
- package/build/domain/mappers/schema/booleanSchemaToComponent.js +29 -0
- package/build/domain/mappers/schema/constSchemaToComponent.js +23 -0
- package/build/domain/mappers/schema/integerSchemaToComponent.js +28 -0
- package/build/domain/mappers/schema/numberSchemaToComponent.js +26 -0
- package/build/domain/mappers/schema/objectSchemaToComponent/assertDisplayOrder.js +23 -0
- package/build/domain/mappers/schema/objectSchemaToComponent/objectSchemaToFormattedValueComponent.js +9 -0
- package/build/domain/mappers/schema/objectSchemaToComponent/objectSchemaToMoneyInputComponent.js +119 -0
- package/build/domain/mappers/schema/objectSchemaToComponent/objectSchemaToMoneyInputComponent.test.js +96 -0
- package/build/domain/mappers/schema/objectSchemaToComponent/objectSchemaToObjectComponent.js +31 -0
- package/build/domain/mappers/schema/objectSchemaToComponent/objectSchemaToObjectComponent.test.js +99 -0
- package/build/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +76 -0
- package/build/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.test.js +265 -0
- package/build/domain/mappers/schema/persistAsyncSchemaToComponent.js +29 -0
- package/build/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.js +18 -0
- package/build/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.test.js +133 -0
- package/build/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +48 -0
- package/build/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +37 -0
- package/build/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.js +28 -0
- package/build/domain/mappers/schema/tests/test-utils.js +16 -0
- package/build/domain/mappers/schema/types.js +1 -0
- package/build/domain/mappers/schema/utils/getPerformPersistAsyncFn.js +19 -0
- package/build/domain/mappers/schema/utils/getValidationAsyncInitialState.js +23 -0
- package/build/domain/mappers/schema/utils/mapCommonSchemaProps.js +16 -0
- package/build/domain/mappers/types.js +1 -0
- package/build/domain/mappers/utils/FeatureFlags.js +22 -0
- package/build/domain/mappers/utils/behavior-utils.js +44 -0
- package/build/domain/mappers/utils/call-to-action-utils.js +21 -0
- package/build/domain/mappers/utils/getAutocompleteString.js +76 -0
- package/build/domain/mappers/utils/getAutocompleteString.test.js +21 -0
- package/build/domain/mappers/utils/groupLayoutByPinned.js +38 -0
- package/build/domain/mappers/utils/groupLayoutByPinned.test.js +166 -0
- package/build/domain/mappers/utils/image.js +9 -0
- package/build/domain/mappers/utils/layout-utils.js +11 -0
- package/build/domain/mappers/utils/legacy-utils.js +49 -0
- package/build/domain/mappers/utils/media-utils.js +14 -0
- package/build/domain/mappers/utils/suggestions-utils.js +26 -0
- package/build/domain/mappers/utils/suggestions-utils.test.js +36 -0
- package/build/domain/mappers/utils/tags-utils.js +1 -0
- package/build/domain/mappers/utils/utils.js +35 -0
- package/build/domain/types.js +1 -0
- package/build/getSubflowCallbacks.js +38 -0
- package/build/i18n/index.js +40 -0
- package/build/index.js +8 -0
- package/build/main.js +112 -54
- package/build/main.mjs +111 -53
- package/build/renderers/CoreContainerRenderer.js +5 -0
- package/build/renderers/CoreRootRenderer.js +12 -0
- package/build/renderers/EmptyLoadingStateRenderer.js +5 -0
- package/build/renderers/getRenderFunction.js +24 -0
- package/build/renderers/getSchemaErrorMessageFunction.js +97 -0
- package/build/renderers/mappers/alertComponentToProps.js +2 -0
- package/build/renderers/mappers/allOfComponentToProps.js +6 -0
- package/build/renderers/mappers/booleanInputComponentToProps.js +5 -0
- package/build/renderers/mappers/boxComponentToProps.js +13 -0
- package/build/renderers/mappers/buttonComponentToProps.js +4 -0
- package/build/renderers/mappers/columnsComponentToProps.js +11 -0
- package/build/renderers/mappers/componentToRendererProps.js +164 -0
- package/build/renderers/mappers/constComponentToProps.js +5 -0
- package/build/renderers/mappers/containerComponentToProps.js +7 -0
- package/build/renderers/mappers/dateInputComponentToProps.js +2 -0
- package/build/renderers/mappers/decisionComponentToProps.js +16 -0
- package/build/renderers/mappers/dividerComponentToProps.js +2 -0
- package/build/renderers/mappers/externalComponentToProps.js +3 -0
- package/build/renderers/mappers/formComponentToProps.js +12 -0
- package/build/renderers/mappers/formattedValueComponentToProps.js +5 -0
- package/build/renderers/mappers/headingComponentToProps.js +2 -0
- package/build/renderers/mappers/hiddenComponentToProps.js +4 -0
- package/build/renderers/mappers/imageComponentToProps.js +2 -0
- package/build/renderers/mappers/instructionsComponentToProps.js +2 -0
- package/build/renderers/mappers/integerInputComponentToProps.js +2 -0
- package/build/renderers/mappers/listComponentToProps.js +2 -0
- package/build/renderers/mappers/loadingIndicatorComponentToProps.js +2 -0
- package/build/renderers/mappers/markdownComponentToProps.js +2 -0
- package/build/renderers/mappers/mediaComponentToProps.js +2 -0
- package/build/renderers/mappers/modalComponentToProps.js +11 -0
- package/build/renderers/mappers/modalLayoutComponentToProps.js +16 -0
- package/build/renderers/mappers/moneyInputComponentToProps.js +36 -0
- package/build/renderers/mappers/multiSelectComponentToProps.js +23 -0
- package/build/renderers/mappers/multiUploadInputComponentToProps.js +12 -0
- package/build/renderers/mappers/numberInputComponentToProps.js +2 -0
- package/build/renderers/mappers/objectComponentToProps.js +8 -0
- package/build/renderers/mappers/paragraphComponentToProps.js +2 -0
- package/build/renderers/mappers/persistAsyncComponentToProps.js +8 -0
- package/build/renderers/mappers/progressComponentToProps.js +2 -0
- package/build/renderers/mappers/repeatableComponentToProps.js +30 -0
- package/build/renderers/mappers/reviewComponentToProps.js +2 -0
- package/build/renderers/mappers/rootComponentToProps.js +21 -0
- package/build/renderers/mappers/searchComponentToProps.js +57 -0
- package/build/renderers/mappers/sectionComponentToProps.js +6 -0
- package/build/renderers/mappers/selectInputComponentToProps.js +26 -0
- package/build/renderers/mappers/statusListComponentToProps.js +2 -0
- package/build/renderers/mappers/subflowComponentToRendererProps.js +4 -0
- package/build/renderers/mappers/tabsComponentToProps.js +14 -0
- package/build/renderers/mappers/textInputComponentToProps.js +2 -0
- package/build/renderers/mappers/tupleComponentToProps.js +8 -0
- package/build/renderers/mappers/uploadInputComponentToProps.js +8 -0
- package/build/renderers/mappers/upsellComponentToProps.js +2 -0
- package/build/renderers/mappers/utils/getValidationState.js +12 -0
- package/build/renderers/mappers/utils/inputComponentToProps.js +26 -0
- package/build/renderers/mappers/utils/mapErrorsToValidationState.js +9 -0
- package/build/renderers/mappers/utils/pick.js +8 -0
- package/build/renderers/mappers/utils/selectInputOptionsToProps.js +11 -0
- package/build/renderers/stepComponentToProps.js +32 -0
- package/build/renderers/utils.js +69 -0
- package/build/renderers/utils.test.js +70 -0
- package/build/stories/dev-tools/ContainerQueries.story.js +66 -0
- package/build/stories/dev-tools/Debugger.story.js +38 -0
- package/build/stories/dev-tools/FixtureSelect.story.js +23 -0
- package/build/stories/dev-tools/TestServer.story.js +32 -0
- package/build/stories/examples/NativeFlow.story.js +80 -0
- package/build/stories/examples/Recipients.story.js +568 -0
- package/build/stories/spec/behavior/Copy.story.js +59 -0
- package/build/stories/spec/behavior/Modal.story.js +76 -0
- package/build/stories/spec/behavior/Subflow.story.js +267 -0
- package/build/stories/spec/layouts/Decision.story.js +241 -0
- package/build/stories/spec/layouts/Image.story.js +42 -0
- package/build/stories/spec/layouts/Modal.story.js +81 -0
- package/build/stories/spec/layouts/Search.story.js +325 -0
- package/build/stories/spec/layouts/Upsell.story.js +55 -0
- package/build/stories/spec/layouts/button/Button.story.js +100 -0
- package/build/stories/spec/layouts/button/PinnedButton.story.js +81 -0
- package/build/stories/spec/response/ActionResponse.story.js +66 -0
- package/build/stories/spec/schemas/MultiSelect.story.js +148 -0
- package/build/stories/spec/schemas/Upload.story.js +168 -0
- package/build/stories/spec/schemas/const/ConstLayout.story.js +159 -0
- package/build/stories/spec/schemas/const/ObjectConst.story.js +94 -0
- package/build/stories/spec/schemas/features/PersistAsync.story.js +176 -0
- package/build/stories/spec/schemas/features/ValidationAsync.story.js +103 -0
- package/build/stories/spec/schemas/object/FormattedValue.story.js +92 -0
- package/build/stories/spec/schemas/object/MoneyInput.story.js +240 -0
- package/build/stories/spec/schemas/oneOf/OneOfInitialisation.story.js +55 -0
- package/build/stories/spec/step/Controls.story.js +109 -0
- package/build/stories/spec/step/DFModal.story.js +58 -0
- package/build/stories/spec/step/Footer.story.js +70 -0
- package/build/stories/spec/step/Navigation.story.js +20 -0
- package/build/stories/spec/step/Tags.story.js +39 -0
- package/build/stories/spec/step/ToolBar.story.js +60 -0
- package/build/stories/spec/step/features/ErrorHandling.story.js +92 -0
- package/build/stories/spec/step/features/External.story.js +44 -0
- package/build/stories/spec/step/features/Polling.story.js +108 -0
- package/build/stories/spec/step/features/RefreshAfter.story.js +92 -0
- package/build/stories/spec/step/features/refresh/Refresh.story.js +258 -0
- package/build/stories/spec/step/features/refresh/RefreshWithPersistAsync.story.js +958 -0
- package/build/stories/types.js +1 -0
- package/build/stories/utils/fixtureHttpClient.js +70 -0
- package/build/stories/utils/getBasicStep.js +223 -0
- package/build/stories/utils/mockSearchHandler.js +71 -0
- package/build/stories/utils/render-utils.js +41 -0
- package/build/stories/visual-tests/layouts/NotUsingListItem.story.js +17 -0
- package/build/test-utils/DynamicFlowWise.js +32 -0
- package/build/test-utils/DynamicFlowWiseModal.js +34 -0
- package/build/test-utils/NeptuneProviders.js +11 -0
- package/build/test-utils/component-utils.js +5 -0
- package/build/test-utils/fetch-utils.js +45 -0
- package/build/test-utils/getMergedTestRenderers.js +34 -0
- package/build/test-utils/getRandomId.js +1 -0
- package/build/test-utils/index.js +3 -0
- package/build/test-utils/rtl-utils.js +7 -0
- package/build/test-utils/step-utils.js +6 -0
- package/build/test-utils/wait.js +3 -0
- package/build/tests/AlertLayout.test.js +78 -0
- package/build/tests/ArrayTuple.test.js +118 -0
- package/build/tests/ButtonLayout.test.js +308 -0
- package/build/tests/ConstLayout.test.js +95 -0
- package/build/tests/DateInput.test.js +163 -0
- package/build/tests/DecisionLayout.test.js +146 -0
- package/build/tests/DynamicFlow.test.js +147 -0
- package/build/tests/External.test.js +169 -0
- package/build/tests/Flow.test.js +328 -0
- package/build/tests/FormLayout.test.js +28 -0
- package/build/tests/FormattedValue.test.js +107 -0
- package/build/tests/ImageRenderer.test.js +78 -0
- package/build/tests/InitialAction.test.js +179 -0
- package/build/tests/InitialStep.test.js +168 -0
- package/build/tests/InstructionsLayout.test.js +45 -0
- package/build/tests/ListLayout.test.js +145 -0
- package/build/tests/Logging.test.js +53 -0
- package/build/tests/ModalBehavior.test.js +149 -0
- package/build/tests/MoneyInput.test.js +316 -0
- package/build/tests/MultiUpload.test.js +293 -0
- package/build/tests/NativeBack.test.js +267 -0
- package/build/tests/OneOfInitialisation.test.js +571 -0
- package/build/tests/PersistAsync.test.js +653 -0
- package/build/tests/Polling.test.js +617 -0
- package/build/tests/Prefetching.test.js +230 -0
- package/build/tests/RefreshAfter.test.js +63 -0
- package/build/tests/RefreshOnChange.ResponseHandling.test.js +205 -0
- package/build/tests/RefreshOnChange.test.js +233 -0
- package/build/tests/RefreshOnChange.with.Segmented.test.js +348 -0
- package/build/tests/RefreshOnChange.with.Tabs.test.js +358 -0
- package/build/tests/RefreshOnChangePreserve.test.js +224 -0
- package/build/tests/RendererProps.test.js +342 -0
- package/build/tests/Repeatable.test.js +107 -0
- package/build/tests/Rerendering.test.js +67 -0
- package/build/tests/ReviewLayout.test.js +274 -0
- package/build/tests/SchemaOnChange.test.js +133 -0
- package/build/tests/ScrollToError.test.js +217 -0
- package/build/tests/SegmentedControl.test.js +49 -0
- package/build/tests/SingleFileUpload.test.js +88 -0
- package/build/tests/StatusList.test.js +85 -0
- package/build/tests/Subflow.test.js +710 -0
- package/build/tests/Submission.ResponseHandling.test.js +557 -0
- package/build/tests/Submission.merging.test.js +202 -0
- package/build/tests/Submission.test.js +523 -0
- package/build/tests/Tags.test.js +475 -0
- package/build/tests/Upsell.test.js +126 -0
- package/build/tests/ValidationAsync.test.js +295 -0
- package/build/tests/legacy/Actions.test.js +158 -0
- package/build/tests/legacy/BackButton.test.js +114 -0
- package/build/tests/legacy/HiddenSchemas.test.js +246 -0
- package/build/tests/legacy/MultiSelect.test.js +497 -0
- package/build/tests/legacy/MultipleFileUploadSchema.test.js +341 -0
- package/build/tests/legacy/PersistAsync.blob-schema.test.js +224 -0
- package/build/tests/legacy/PersistAsync.string-schema.test.js +211 -0
- package/build/tests/legacy/RefreshStepOnChange.debouncing.test.js +209 -0
- package/build/tests/legacy/RefreshStepOnChange.test.js +424 -0
- package/build/tests/legacy/Search.test.js +437 -0
- package/build/tests/renderers/MultiSelectInputRendererProps.test.js +58 -0
- package/build/tests/renderers/SelectInputRendererProps.test.js +42 -0
- package/build/tests/renderers/TextInputRenderer.test.js +51 -0
- package/build/types/domain/components/UpsellComponent.d.ts +2 -3
- package/build/types/domain/components/UpsellComponent.d.ts.map +1 -1
- package/build/types/domain/components/searchComponent/SearchComponent.d.ts +5 -4
- package/build/types/domain/components/searchComponent/SearchComponent.d.ts.map +1 -1
- package/build/types/domain/features/search/getPerformSearchFunction.d.ts +1 -1
- package/build/types/domain/features/search/getPerformSearchFunction.d.ts.map +1 -1
- package/build/types/domain/mappers/layout/searchLayoutToComponent.d.ts +2 -1
- package/build/types/domain/mappers/layout/searchLayoutToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/layout/upsellLayoutToComponent.d.ts +1 -1
- package/build/types/domain/mappers/layout/upsellLayoutToComponent.d.ts.map +1 -1
- package/build/types/renderers/EmptyLoadingStateRenderer.d.ts +3 -0
- package/build/types/renderers/EmptyLoadingStateRenderer.d.ts.map +1 -0
- package/build/types/renderers/mappers/rootComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/searchComponentToProps.d.ts +1 -1
- package/build/types/renderers/mappers/searchComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/upsellComponentToProps.d.ts +2 -2
- package/build/types/renderers/mappers/upsellComponentToProps.d.ts.map +1 -1
- package/build/types/test-utils/getMergedTestRenderers.d.ts +1 -1
- package/build/types/test-utils/getMergedTestRenderers.d.ts.map +1 -1
- package/build/types/useDynamicFlow.d.ts.map +1 -1
- package/build/types.js +1 -0
- package/build/useDynamicFlow.js +104 -0
- package/build/useDynamicFlowModal.js +58 -0
- package/build/utils/analyse-step.js +14 -0
- package/build/utils/component-utils.js +8 -0
- package/build/utils/component-utils.test.js +113 -0
- package/build/utils/getScrollToTop.js +12 -0
- package/build/utils/normalise-flow-id.js +1 -0
- package/build/utils/normalise-flow-id.test.js +24 -0
- package/build/utils/openLinkInNewTab.js +10 -0
- package/build/utils/recursiveMerge.js +40 -0
- package/build/utils/recursiveMerge.test.js +93 -0
- package/build/utils/type-utils.js +21 -0
- package/build/utils/type-validators.js +11 -0
- package/build/utils/type-validators.test.js +180 -0
- package/build/utils/useStableCallback.js +15 -0
- package/package.json +4 -4
|
@@ -0,0 +1,958 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { action } from 'storybook/actions';
|
|
3
|
+
import { getMockHttpClient } from '../../../../../test-utils';
|
|
4
|
+
import { abortableDelay, respondWith } from '../../../../../test-utils/fetch-utils';
|
|
5
|
+
import DynamicFlowWise from '../../../../../test-utils/DynamicFlowWise';
|
|
6
|
+
const getRespondWithDelay = (delayMs) => async (_, init) => {
|
|
7
|
+
var _a;
|
|
8
|
+
await abortableDelay(delayMs, (_a = init === null || init === void 0 ? void 0 : init.signal) !== null && _a !== void 0 ? _a : null);
|
|
9
|
+
return respondWith(refreshedStep);
|
|
10
|
+
};
|
|
11
|
+
const httpClient = getMockHttpClient({
|
|
12
|
+
'/refresh': getRespondWithDelay(500),
|
|
13
|
+
'/persist': async () => respondWith({ cardToken: 'X_njjb1uoi0j4jrqgr1pn69mtqrb' }),
|
|
14
|
+
});
|
|
15
|
+
export default {
|
|
16
|
+
component: DynamicFlowWise,
|
|
17
|
+
title: 'Spec/Step/Features/Refresh On Change',
|
|
18
|
+
parameters: {
|
|
19
|
+
chromatic: { disableSnapshot: true },
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export function RefreshWithPersistAsync() {
|
|
23
|
+
return renderWithStep(initialStep);
|
|
24
|
+
}
|
|
25
|
+
const renderWithStep = (step) => (_jsx(DynamicFlowWise, { flowId: "new-df-flow-id", httpClient: async (input, init) => {
|
|
26
|
+
action('httpClient')(input, init === null || init === void 0 ? void 0 : init.body);
|
|
27
|
+
return httpClient(input, init);
|
|
28
|
+
}, initialStep: step, onCompletion: action('onCompletion'), onEvent: action('onEvent'), onError: action('onEvent'), onLog: action('onLog') }));
|
|
29
|
+
const initialStep = {
|
|
30
|
+
key: 'account',
|
|
31
|
+
type: 'form',
|
|
32
|
+
title: 'Enter their account details',
|
|
33
|
+
actions: [
|
|
34
|
+
{
|
|
35
|
+
title: 'Confirm',
|
|
36
|
+
url: '/v2/contacts',
|
|
37
|
+
type: 'primary',
|
|
38
|
+
method: 'POST',
|
|
39
|
+
$id: 'submit',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
schemas: [
|
|
43
|
+
{
|
|
44
|
+
allOf: [
|
|
45
|
+
{
|
|
46
|
+
type: 'object',
|
|
47
|
+
displayOrder: ['currency'],
|
|
48
|
+
properties: {
|
|
49
|
+
currency: {
|
|
50
|
+
title: 'Currency',
|
|
51
|
+
type: 'string',
|
|
52
|
+
analyticsId: 'currency-select',
|
|
53
|
+
oneOf: [
|
|
54
|
+
{
|
|
55
|
+
title: 'EUR',
|
|
56
|
+
analyticsId: 'EUR',
|
|
57
|
+
icon: { name: 'flag-eur', type: 'icon' },
|
|
58
|
+
description: 'Euro',
|
|
59
|
+
const: 'EUR',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: 'GBP',
|
|
63
|
+
analyticsId: 'GBP',
|
|
64
|
+
icon: { name: 'flag-gbp', type: 'icon' },
|
|
65
|
+
description: 'British pound',
|
|
66
|
+
const: 'GBP',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: 'USD',
|
|
70
|
+
analyticsId: 'USD',
|
|
71
|
+
icon: { name: 'flag-usd', type: 'icon' },
|
|
72
|
+
description: 'United States dollar',
|
|
73
|
+
const: 'USD',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
default: 'USD',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['currency', 'legalEntityType'],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: 'Bank details',
|
|
83
|
+
analyticsId: 'recipient-type',
|
|
84
|
+
oneOf: [
|
|
85
|
+
{
|
|
86
|
+
title: 'ACH',
|
|
87
|
+
type: 'object',
|
|
88
|
+
analyticsId: 'Aba',
|
|
89
|
+
icon: { name: 'bank', type: 'icon' },
|
|
90
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
91
|
+
properties: {
|
|
92
|
+
name: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
displayOrder: ['fullName'],
|
|
95
|
+
properties: {
|
|
96
|
+
fullName: {
|
|
97
|
+
title: 'Full name of the account holder',
|
|
98
|
+
type: 'string',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
required: ['fullName'],
|
|
102
|
+
},
|
|
103
|
+
ownedByCustomer: {
|
|
104
|
+
title: 'My own account',
|
|
105
|
+
type: 'boolean',
|
|
106
|
+
analyticsId: 'My own account',
|
|
107
|
+
hidden: true,
|
|
108
|
+
const: false,
|
|
109
|
+
},
|
|
110
|
+
details: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
displayOrder: ['abartn', 'accountNumber', 'accountType'],
|
|
113
|
+
properties: {
|
|
114
|
+
abartn: {
|
|
115
|
+
title: 'ACH routing number',
|
|
116
|
+
type: 'string',
|
|
117
|
+
placeholder: '020123456',
|
|
118
|
+
refreshFormOnChange: true,
|
|
119
|
+
format: 'numeric',
|
|
120
|
+
},
|
|
121
|
+
accountNumber: {
|
|
122
|
+
title: 'Account number',
|
|
123
|
+
type: 'string',
|
|
124
|
+
placeholder: '12345678',
|
|
125
|
+
refreshFormOnChange: true,
|
|
126
|
+
format: 'numeric',
|
|
127
|
+
},
|
|
128
|
+
accountType: {
|
|
129
|
+
title: 'Account type',
|
|
130
|
+
type: 'string',
|
|
131
|
+
oneOf: [
|
|
132
|
+
{ title: 'Checking', const: 'CHECKING' },
|
|
133
|
+
{ title: 'Savings', const: 'SAVINGS' },
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
required: ['abartn', 'accountNumber', 'accountType'],
|
|
138
|
+
},
|
|
139
|
+
address: {
|
|
140
|
+
title: 'Recipient address',
|
|
141
|
+
type: 'object',
|
|
142
|
+
displayOrder: ['country', 'city', 'firstLine', 'postCode'],
|
|
143
|
+
properties: {
|
|
144
|
+
country: {
|
|
145
|
+
title: 'Country',
|
|
146
|
+
type: 'string',
|
|
147
|
+
placeholder: 'Choose a country',
|
|
148
|
+
oneOf: [
|
|
149
|
+
{ title: 'United States', const: 'US' },
|
|
150
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
151
|
+
],
|
|
152
|
+
refreshFormOnChange: true,
|
|
153
|
+
},
|
|
154
|
+
city: {
|
|
155
|
+
title: 'City',
|
|
156
|
+
type: 'string',
|
|
157
|
+
},
|
|
158
|
+
firstLine: {
|
|
159
|
+
title: 'Recipient address',
|
|
160
|
+
type: 'string',
|
|
161
|
+
},
|
|
162
|
+
postCode: {
|
|
163
|
+
title: 'Post code',
|
|
164
|
+
type: 'string',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
required: ['country', 'city', 'firstLine', 'postCode'],
|
|
168
|
+
},
|
|
169
|
+
type: {
|
|
170
|
+
title: 'Type',
|
|
171
|
+
type: 'string',
|
|
172
|
+
analyticsId: 'Type',
|
|
173
|
+
hidden: true,
|
|
174
|
+
const: 'Aba',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
required: ['type', 'address', 'name', 'details'],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
title: 'Wire',
|
|
181
|
+
type: 'object',
|
|
182
|
+
analyticsId: 'FedWireLocal',
|
|
183
|
+
icon: { name: 'bank', type: 'icon' },
|
|
184
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
185
|
+
properties: {
|
|
186
|
+
name: {
|
|
187
|
+
type: 'object',
|
|
188
|
+
displayOrder: ['fullName'],
|
|
189
|
+
properties: {
|
|
190
|
+
fullName: {
|
|
191
|
+
title: 'Full name of the account holder',
|
|
192
|
+
type: 'string',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
required: ['fullName'],
|
|
196
|
+
},
|
|
197
|
+
ownedByCustomer: {
|
|
198
|
+
title: 'My own account',
|
|
199
|
+
type: 'boolean',
|
|
200
|
+
analyticsId: 'My own account',
|
|
201
|
+
hidden: true,
|
|
202
|
+
const: false,
|
|
203
|
+
},
|
|
204
|
+
details: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
displayOrder: ['abartn', 'accountNumber', 'accountType'],
|
|
207
|
+
properties: {
|
|
208
|
+
abartn: {
|
|
209
|
+
title: 'Fedwire routing number',
|
|
210
|
+
type: 'string',
|
|
211
|
+
placeholder: '020123456',
|
|
212
|
+
},
|
|
213
|
+
accountNumber: {
|
|
214
|
+
title: 'Account number',
|
|
215
|
+
type: 'string',
|
|
216
|
+
placeholder: '12345678',
|
|
217
|
+
format: 'numeric',
|
|
218
|
+
},
|
|
219
|
+
accountType: {
|
|
220
|
+
title: 'Account type',
|
|
221
|
+
type: 'string',
|
|
222
|
+
oneOf: [
|
|
223
|
+
{ title: 'Checking', const: 'CHECKING' },
|
|
224
|
+
{ title: 'Savings', const: 'SAVINGS' },
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
required: ['abartn', 'accountNumber', 'accountType'],
|
|
229
|
+
},
|
|
230
|
+
address: {
|
|
231
|
+
title: 'Recipient address',
|
|
232
|
+
type: 'object',
|
|
233
|
+
displayOrder: ['country', 'city', 'firstLine', 'postCode'],
|
|
234
|
+
properties: {
|
|
235
|
+
country: {
|
|
236
|
+
title: 'Country',
|
|
237
|
+
type: 'string',
|
|
238
|
+
placeholder: 'Choose a country',
|
|
239
|
+
oneOf: [
|
|
240
|
+
{ title: 'United States', const: 'US' },
|
|
241
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
242
|
+
],
|
|
243
|
+
refreshFormOnChange: true,
|
|
244
|
+
},
|
|
245
|
+
city: {
|
|
246
|
+
title: 'City',
|
|
247
|
+
type: 'string',
|
|
248
|
+
},
|
|
249
|
+
firstLine: {
|
|
250
|
+
title: 'Recipient address',
|
|
251
|
+
type: 'string',
|
|
252
|
+
},
|
|
253
|
+
postCode: {
|
|
254
|
+
title: 'Post code',
|
|
255
|
+
type: 'string',
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
required: ['country', 'city', 'firstLine', 'postCode'],
|
|
259
|
+
},
|
|
260
|
+
type: {
|
|
261
|
+
title: 'Type',
|
|
262
|
+
type: 'string',
|
|
263
|
+
analyticsId: 'Type',
|
|
264
|
+
hidden: true,
|
|
265
|
+
const: 'FedWireLocal',
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
required: ['type', 'address', 'name', 'details'],
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
title: 'SWIFT',
|
|
272
|
+
type: 'object',
|
|
273
|
+
analyticsId: 'SwiftCode',
|
|
274
|
+
icon: { name: 'bank', type: 'icon' },
|
|
275
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
276
|
+
properties: {
|
|
277
|
+
name: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
displayOrder: ['fullName'],
|
|
280
|
+
properties: {
|
|
281
|
+
fullName: {
|
|
282
|
+
title: 'Full name of the account holder',
|
|
283
|
+
type: 'string',
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
required: ['fullName'],
|
|
287
|
+
},
|
|
288
|
+
ownedByCustomer: {
|
|
289
|
+
title: 'My own account',
|
|
290
|
+
type: 'boolean',
|
|
291
|
+
analyticsId: 'My own account',
|
|
292
|
+
hidden: true,
|
|
293
|
+
const: false,
|
|
294
|
+
},
|
|
295
|
+
details: {
|
|
296
|
+
type: 'object',
|
|
297
|
+
displayOrder: ['bic', 'accountNumber'],
|
|
298
|
+
properties: {
|
|
299
|
+
bic: {
|
|
300
|
+
title: 'SWIFT / BIC code',
|
|
301
|
+
type: 'string',
|
|
302
|
+
placeholder: 'BUKBGB22',
|
|
303
|
+
},
|
|
304
|
+
accountNumber: {
|
|
305
|
+
title: 'IBAN / Account number',
|
|
306
|
+
type: 'string',
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
required: ['bic', 'accountNumber'],
|
|
310
|
+
},
|
|
311
|
+
address: {
|
|
312
|
+
title: 'Recipient address',
|
|
313
|
+
type: 'object',
|
|
314
|
+
displayOrder: ['country', 'city', 'firstLine', 'postCode'],
|
|
315
|
+
properties: {
|
|
316
|
+
country: {
|
|
317
|
+
title: 'Country',
|
|
318
|
+
type: 'string',
|
|
319
|
+
placeholder: 'Choose a country',
|
|
320
|
+
oneOf: [
|
|
321
|
+
{ title: 'United States', const: 'US' },
|
|
322
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
323
|
+
],
|
|
324
|
+
refreshFormOnChange: true,
|
|
325
|
+
},
|
|
326
|
+
city: {
|
|
327
|
+
title: 'City',
|
|
328
|
+
type: 'string',
|
|
329
|
+
},
|
|
330
|
+
firstLine: {
|
|
331
|
+
title: 'Recipient address',
|
|
332
|
+
type: 'string',
|
|
333
|
+
},
|
|
334
|
+
postCode: {
|
|
335
|
+
title: 'Post code',
|
|
336
|
+
type: 'string',
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
required: ['country', 'city', 'firstLine', 'postCode'],
|
|
340
|
+
},
|
|
341
|
+
type: {
|
|
342
|
+
title: 'Type',
|
|
343
|
+
type: 'string',
|
|
344
|
+
analyticsId: 'Type',
|
|
345
|
+
hidden: true,
|
|
346
|
+
const: 'SwiftCode',
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
required: ['type', 'address', 'name', 'details'],
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
title: 'US card',
|
|
353
|
+
type: 'object',
|
|
354
|
+
analyticsId: 'Card',
|
|
355
|
+
image: {
|
|
356
|
+
url: 'https://wise.com/public-resources/assets/recipients/unionpay.png',
|
|
357
|
+
type: 'image',
|
|
358
|
+
},
|
|
359
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
360
|
+
properties: {
|
|
361
|
+
name: {
|
|
362
|
+
type: 'object',
|
|
363
|
+
displayOrder: ['fullName'],
|
|
364
|
+
properties: {
|
|
365
|
+
fullName: {
|
|
366
|
+
title: 'Full name of the account holder',
|
|
367
|
+
type: 'string',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
required: ['fullName'],
|
|
371
|
+
},
|
|
372
|
+
ownedByCustomer: {
|
|
373
|
+
title: 'My own account',
|
|
374
|
+
type: 'boolean',
|
|
375
|
+
analyticsId: 'My own account',
|
|
376
|
+
hidden: true,
|
|
377
|
+
const: false,
|
|
378
|
+
},
|
|
379
|
+
details: {
|
|
380
|
+
type: 'object',
|
|
381
|
+
displayOrder: ['expiryMonth', 'expiryYear', 'cardToken'],
|
|
382
|
+
properties: {
|
|
383
|
+
expiryMonth: {
|
|
384
|
+
title: 'Expiry month',
|
|
385
|
+
type: 'string',
|
|
386
|
+
hidden: true,
|
|
387
|
+
placeholder: '08',
|
|
388
|
+
format: 'numeric',
|
|
389
|
+
},
|
|
390
|
+
expiryYear: {
|
|
391
|
+
title: 'Expiry year',
|
|
392
|
+
type: 'string',
|
|
393
|
+
hidden: true,
|
|
394
|
+
placeholder: '2022',
|
|
395
|
+
format: 'numeric',
|
|
396
|
+
},
|
|
397
|
+
cardToken: {
|
|
398
|
+
title: 'Card token',
|
|
399
|
+
type: 'string',
|
|
400
|
+
hidden: true,
|
|
401
|
+
persistAsync: {
|
|
402
|
+
method: 'POST',
|
|
403
|
+
url: '/persist',
|
|
404
|
+
param: 'cardNumber',
|
|
405
|
+
idProperty: 'cardToken',
|
|
406
|
+
schema: {
|
|
407
|
+
title: 'Card number',
|
|
408
|
+
type: 'string',
|
|
409
|
+
placeholder: '1234567890123456',
|
|
410
|
+
format: 'numeric',
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
required: ['cardToken'],
|
|
416
|
+
},
|
|
417
|
+
address: {
|
|
418
|
+
title: 'Recipient address',
|
|
419
|
+
type: 'object',
|
|
420
|
+
displayOrder: ['country', 'city', 'firstLine'],
|
|
421
|
+
properties: {
|
|
422
|
+
country: {
|
|
423
|
+
title: 'Country',
|
|
424
|
+
type: 'string',
|
|
425
|
+
placeholder: 'Choose a country',
|
|
426
|
+
oneOf: [
|
|
427
|
+
{ title: 'United States', const: 'US' },
|
|
428
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
429
|
+
],
|
|
430
|
+
refreshFormOnChange: true,
|
|
431
|
+
},
|
|
432
|
+
city: {
|
|
433
|
+
title: 'City',
|
|
434
|
+
type: 'string',
|
|
435
|
+
},
|
|
436
|
+
firstLine: {
|
|
437
|
+
title: 'Recipient address',
|
|
438
|
+
type: 'string',
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
required: ['country', 'city', 'firstLine'],
|
|
442
|
+
},
|
|
443
|
+
type: {
|
|
444
|
+
title: 'Type',
|
|
445
|
+
type: 'string',
|
|
446
|
+
analyticsId: 'Type',
|
|
447
|
+
hidden: true,
|
|
448
|
+
const: 'Card',
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
required: ['type', 'address', 'name', 'details'],
|
|
452
|
+
},
|
|
453
|
+
],
|
|
454
|
+
control: 'tab',
|
|
455
|
+
placeholder: 'Please select where you are sending to',
|
|
456
|
+
},
|
|
457
|
+
],
|
|
458
|
+
$id: 'form',
|
|
459
|
+
},
|
|
460
|
+
],
|
|
461
|
+
refreshFormUrl: '/refresh',
|
|
462
|
+
model: {
|
|
463
|
+
ownedByCustomer: false,
|
|
464
|
+
profileId: 14518756,
|
|
465
|
+
legalEntityType: 'PERSON',
|
|
466
|
+
name: {},
|
|
467
|
+
currency: 'USD',
|
|
468
|
+
details: {},
|
|
469
|
+
},
|
|
470
|
+
layout: [{ schemaId: 'form', type: 'form' }],
|
|
471
|
+
};
|
|
472
|
+
const refreshedStep = {
|
|
473
|
+
key: 'account',
|
|
474
|
+
type: 'form',
|
|
475
|
+
title: 'Enter their account details',
|
|
476
|
+
actions: [],
|
|
477
|
+
schemas: [
|
|
478
|
+
{
|
|
479
|
+
allOf: [
|
|
480
|
+
{
|
|
481
|
+
type: 'object',
|
|
482
|
+
displayOrder: ['profileId', 'currency', 'legalEntityType'],
|
|
483
|
+
properties: {
|
|
484
|
+
profileId: {
|
|
485
|
+
title: 'Profile ID (optional)',
|
|
486
|
+
type: 'number',
|
|
487
|
+
analyticsId: 'Profile ID (optional)',
|
|
488
|
+
hidden: true,
|
|
489
|
+
const: 14518756,
|
|
490
|
+
},
|
|
491
|
+
currency: {
|
|
492
|
+
title: 'Currency',
|
|
493
|
+
type: 'string',
|
|
494
|
+
analyticsId: 'currency-select',
|
|
495
|
+
oneOf: [
|
|
496
|
+
{
|
|
497
|
+
title: 'EUR',
|
|
498
|
+
analyticsId: 'EUR',
|
|
499
|
+
icon: { name: 'flag-eur', type: 'icon' },
|
|
500
|
+
description: 'Euro',
|
|
501
|
+
const: 'EUR',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
title: 'GBP',
|
|
505
|
+
analyticsId: 'GBP',
|
|
506
|
+
icon: { name: 'flag-gbp', type: 'icon' },
|
|
507
|
+
description: 'British pound',
|
|
508
|
+
const: 'GBP',
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
title: 'USD',
|
|
512
|
+
analyticsId: 'USD',
|
|
513
|
+
icon: { name: 'flag-usd', type: 'icon' },
|
|
514
|
+
description: 'United States dollar',
|
|
515
|
+
const: 'USD',
|
|
516
|
+
},
|
|
517
|
+
],
|
|
518
|
+
default: 'USD',
|
|
519
|
+
},
|
|
520
|
+
legalEntityType: {
|
|
521
|
+
title: 'Select recipient type',
|
|
522
|
+
type: 'string',
|
|
523
|
+
analyticsId: 'Select recipient type',
|
|
524
|
+
hidden: true,
|
|
525
|
+
const: 'PERSON',
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
required: ['currency', 'legalEntityType'],
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
title: 'Bank details',
|
|
532
|
+
analyticsId: 'recipient-type',
|
|
533
|
+
oneOf: [
|
|
534
|
+
{
|
|
535
|
+
title: 'ACH',
|
|
536
|
+
type: 'object',
|
|
537
|
+
analyticsId: 'Aba',
|
|
538
|
+
icon: { name: 'bank', type: 'icon' },
|
|
539
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
540
|
+
properties: {
|
|
541
|
+
name: {
|
|
542
|
+
type: 'object',
|
|
543
|
+
displayOrder: ['fullName'],
|
|
544
|
+
properties: {
|
|
545
|
+
fullName: {
|
|
546
|
+
title: 'Full name of the account holder',
|
|
547
|
+
type: 'string',
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
required: ['fullName'],
|
|
551
|
+
},
|
|
552
|
+
ownedByCustomer: {
|
|
553
|
+
title: 'My own account',
|
|
554
|
+
type: 'boolean',
|
|
555
|
+
analyticsId: 'My own account',
|
|
556
|
+
hidden: true,
|
|
557
|
+
const: false,
|
|
558
|
+
},
|
|
559
|
+
details: {
|
|
560
|
+
type: 'object',
|
|
561
|
+
displayOrder: ['abartn', 'accountNumber', 'accountType'],
|
|
562
|
+
properties: {
|
|
563
|
+
abartn: {
|
|
564
|
+
title: 'ACH routing number',
|
|
565
|
+
type: 'string',
|
|
566
|
+
placeholder: '020123456',
|
|
567
|
+
format: 'numeric',
|
|
568
|
+
},
|
|
569
|
+
accountNumber: {
|
|
570
|
+
title: 'Account number',
|
|
571
|
+
type: 'string',
|
|
572
|
+
placeholder: '12345678',
|
|
573
|
+
format: 'numeric',
|
|
574
|
+
},
|
|
575
|
+
accountType: {
|
|
576
|
+
title: 'Account type',
|
|
577
|
+
type: 'string',
|
|
578
|
+
oneOf: [
|
|
579
|
+
{ title: 'Checking', const: 'CHECKING' },
|
|
580
|
+
{ title: 'Savings', const: 'SAVINGS' },
|
|
581
|
+
],
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
required: ['abartn', 'accountNumber', 'accountType'],
|
|
585
|
+
},
|
|
586
|
+
address: {
|
|
587
|
+
title: 'Recipient address',
|
|
588
|
+
type: 'object',
|
|
589
|
+
displayOrder: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
590
|
+
properties: {
|
|
591
|
+
country: {
|
|
592
|
+
title: 'Country',
|
|
593
|
+
type: 'string',
|
|
594
|
+
placeholder: 'Choose a country',
|
|
595
|
+
oneOf: [
|
|
596
|
+
{ title: 'United States', const: 'US' },
|
|
597
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
598
|
+
],
|
|
599
|
+
refreshFormOnChange: true,
|
|
600
|
+
},
|
|
601
|
+
city: {
|
|
602
|
+
title: 'City',
|
|
603
|
+
type: 'string',
|
|
604
|
+
},
|
|
605
|
+
firstLine: {
|
|
606
|
+
title: 'Recipient address',
|
|
607
|
+
type: 'string',
|
|
608
|
+
},
|
|
609
|
+
state: {
|
|
610
|
+
title: 'State',
|
|
611
|
+
type: 'string',
|
|
612
|
+
oneOf: [
|
|
613
|
+
{ title: 'Alabama', const: 'AL' },
|
|
614
|
+
{ title: 'Alaska', const: 'AK' },
|
|
615
|
+
],
|
|
616
|
+
},
|
|
617
|
+
postCode: {
|
|
618
|
+
title: 'ZIP code',
|
|
619
|
+
type: 'string',
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
required: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
623
|
+
},
|
|
624
|
+
type: {
|
|
625
|
+
title: 'Type',
|
|
626
|
+
type: 'string',
|
|
627
|
+
analyticsId: 'Type',
|
|
628
|
+
hidden: true,
|
|
629
|
+
const: 'Aba',
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
required: ['type', 'address', 'name', 'details'],
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
title: 'Wire',
|
|
636
|
+
type: 'object',
|
|
637
|
+
analyticsId: 'FedWireLocal',
|
|
638
|
+
icon: { name: 'bank', type: 'icon' },
|
|
639
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
640
|
+
properties: {
|
|
641
|
+
name: {
|
|
642
|
+
type: 'object',
|
|
643
|
+
displayOrder: ['fullName'],
|
|
644
|
+
properties: {
|
|
645
|
+
fullName: {
|
|
646
|
+
title: 'Full name of the account holder',
|
|
647
|
+
type: 'string',
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
required: ['fullName'],
|
|
651
|
+
},
|
|
652
|
+
ownedByCustomer: {
|
|
653
|
+
title: 'My own account',
|
|
654
|
+
type: 'boolean',
|
|
655
|
+
analyticsId: 'My own account',
|
|
656
|
+
hidden: true,
|
|
657
|
+
const: false,
|
|
658
|
+
},
|
|
659
|
+
details: {
|
|
660
|
+
type: 'object',
|
|
661
|
+
displayOrder: ['abartn', 'accountNumber', 'accountType'],
|
|
662
|
+
properties: {
|
|
663
|
+
abartn: {
|
|
664
|
+
title: 'Fedwire routing number',
|
|
665
|
+
type: 'string',
|
|
666
|
+
placeholder: '020123456',
|
|
667
|
+
format: 'numeric',
|
|
668
|
+
},
|
|
669
|
+
accountNumber: {
|
|
670
|
+
title: 'Account number',
|
|
671
|
+
type: 'string',
|
|
672
|
+
placeholder: '12345678',
|
|
673
|
+
format: 'numeric',
|
|
674
|
+
},
|
|
675
|
+
accountType: {
|
|
676
|
+
title: 'Account type',
|
|
677
|
+
type: 'string',
|
|
678
|
+
oneOf: [
|
|
679
|
+
{ title: 'Checking', const: 'CHECKING' },
|
|
680
|
+
{ title: 'Savings', const: 'SAVINGS' },
|
|
681
|
+
],
|
|
682
|
+
},
|
|
683
|
+
},
|
|
684
|
+
required: ['abartn', 'accountNumber', 'accountType'],
|
|
685
|
+
},
|
|
686
|
+
address: {
|
|
687
|
+
title: 'Recipient address',
|
|
688
|
+
type: 'object',
|
|
689
|
+
displayOrder: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
690
|
+
properties: {
|
|
691
|
+
country: {
|
|
692
|
+
title: 'Country',
|
|
693
|
+
type: 'string',
|
|
694
|
+
placeholder: 'Choose a country',
|
|
695
|
+
oneOf: [
|
|
696
|
+
{ title: 'United States', const: 'US' },
|
|
697
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
698
|
+
],
|
|
699
|
+
refreshFormOnChange: true,
|
|
700
|
+
},
|
|
701
|
+
city: {
|
|
702
|
+
title: 'City',
|
|
703
|
+
type: 'string',
|
|
704
|
+
},
|
|
705
|
+
firstLine: {
|
|
706
|
+
title: 'Recipient address',
|
|
707
|
+
type: 'string',
|
|
708
|
+
},
|
|
709
|
+
state: {
|
|
710
|
+
title: 'State',
|
|
711
|
+
type: 'string',
|
|
712
|
+
oneOf: [
|
|
713
|
+
{ title: 'Alabama', const: 'AL' },
|
|
714
|
+
{ title: 'Alaska', const: 'AK' },
|
|
715
|
+
{ title: 'Arizona', const: 'AZ' },
|
|
716
|
+
],
|
|
717
|
+
},
|
|
718
|
+
postCode: {
|
|
719
|
+
title: 'ZIP code',
|
|
720
|
+
type: 'string',
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
required: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
724
|
+
},
|
|
725
|
+
type: {
|
|
726
|
+
title: 'Type',
|
|
727
|
+
type: 'string',
|
|
728
|
+
analyticsId: 'Type',
|
|
729
|
+
hidden: true,
|
|
730
|
+
const: 'FedWireLocal',
|
|
731
|
+
},
|
|
732
|
+
},
|
|
733
|
+
required: ['type', 'address', 'name', 'details'],
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
title: 'SWIFT',
|
|
737
|
+
type: 'object',
|
|
738
|
+
analyticsId: 'SwiftCode',
|
|
739
|
+
icon: { name: 'bank', type: 'icon' },
|
|
740
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
741
|
+
properties: {
|
|
742
|
+
name: {
|
|
743
|
+
type: 'object',
|
|
744
|
+
displayOrder: ['fullName'],
|
|
745
|
+
properties: {
|
|
746
|
+
fullName: {
|
|
747
|
+
title: 'Full name of the account holder',
|
|
748
|
+
type: 'string',
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
required: ['fullName'],
|
|
752
|
+
},
|
|
753
|
+
ownedByCustomer: {
|
|
754
|
+
title: 'My own account',
|
|
755
|
+
type: 'boolean',
|
|
756
|
+
analyticsId: 'My own account',
|
|
757
|
+
hidden: true,
|
|
758
|
+
const: false,
|
|
759
|
+
},
|
|
760
|
+
details: {
|
|
761
|
+
type: 'object',
|
|
762
|
+
displayOrder: ['bic', 'accountNumber'],
|
|
763
|
+
properties: {
|
|
764
|
+
bic: {
|
|
765
|
+
title: 'SWIFT / BIC code',
|
|
766
|
+
type: 'string',
|
|
767
|
+
placeholder: 'BUKBGB22',
|
|
768
|
+
},
|
|
769
|
+
accountNumber: {
|
|
770
|
+
title: 'IBAN / Account number',
|
|
771
|
+
type: 'string',
|
|
772
|
+
},
|
|
773
|
+
},
|
|
774
|
+
required: ['bic', 'accountNumber'],
|
|
775
|
+
},
|
|
776
|
+
address: {
|
|
777
|
+
title: 'Recipient address',
|
|
778
|
+
type: 'object',
|
|
779
|
+
displayOrder: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
780
|
+
properties: {
|
|
781
|
+
country: {
|
|
782
|
+
title: 'Country',
|
|
783
|
+
type: 'string',
|
|
784
|
+
placeholder: 'Choose a country',
|
|
785
|
+
oneOf: [
|
|
786
|
+
{ title: 'United States', const: 'US' },
|
|
787
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
788
|
+
],
|
|
789
|
+
refreshFormOnChange: true,
|
|
790
|
+
},
|
|
791
|
+
city: {
|
|
792
|
+
title: 'City',
|
|
793
|
+
type: 'string',
|
|
794
|
+
},
|
|
795
|
+
firstLine: {
|
|
796
|
+
title: 'Recipient address',
|
|
797
|
+
type: 'string',
|
|
798
|
+
},
|
|
799
|
+
state: {
|
|
800
|
+
title: 'State',
|
|
801
|
+
type: 'string',
|
|
802
|
+
oneOf: [
|
|
803
|
+
{ title: 'Alabama', const: 'AL' },
|
|
804
|
+
{ title: 'Alaska', const: 'AK' },
|
|
805
|
+
],
|
|
806
|
+
},
|
|
807
|
+
postCode: {
|
|
808
|
+
title: 'ZIP code',
|
|
809
|
+
type: 'string',
|
|
810
|
+
},
|
|
811
|
+
},
|
|
812
|
+
required: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
813
|
+
},
|
|
814
|
+
type: {
|
|
815
|
+
title: 'Type',
|
|
816
|
+
type: 'string',
|
|
817
|
+
analyticsId: 'Type',
|
|
818
|
+
hidden: true,
|
|
819
|
+
const: 'SwiftCode',
|
|
820
|
+
},
|
|
821
|
+
},
|
|
822
|
+
required: ['type', 'address', 'name', 'details'],
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
title: 'US card',
|
|
826
|
+
type: 'object',
|
|
827
|
+
analyticsId: 'Card',
|
|
828
|
+
image: {
|
|
829
|
+
url: 'https://wise.com/public-resources/assets/recipients/unionpay.png',
|
|
830
|
+
type: 'image',
|
|
831
|
+
},
|
|
832
|
+
displayOrder: ['name', 'ownedByCustomer', 'details', 'address', 'type'],
|
|
833
|
+
properties: {
|
|
834
|
+
name: {
|
|
835
|
+
type: 'object',
|
|
836
|
+
displayOrder: ['fullName'],
|
|
837
|
+
properties: {
|
|
838
|
+
fullName: {
|
|
839
|
+
title: 'Full name of the account holder',
|
|
840
|
+
type: 'string',
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
required: ['fullName'],
|
|
844
|
+
},
|
|
845
|
+
ownedByCustomer: {
|
|
846
|
+
title: 'My own account',
|
|
847
|
+
type: 'boolean',
|
|
848
|
+
analyticsId: 'My own account',
|
|
849
|
+
hidden: true,
|
|
850
|
+
const: false,
|
|
851
|
+
},
|
|
852
|
+
details: {
|
|
853
|
+
type: 'object',
|
|
854
|
+
displayOrder: ['expiryMonth', 'expiryYear', 'cardToken'],
|
|
855
|
+
properties: {
|
|
856
|
+
expiryMonth: {
|
|
857
|
+
title: 'Expiry month',
|
|
858
|
+
type: 'string',
|
|
859
|
+
hidden: true,
|
|
860
|
+
placeholder: '08',
|
|
861
|
+
format: 'numeric',
|
|
862
|
+
},
|
|
863
|
+
expiryYear: {
|
|
864
|
+
title: 'Expiry year',
|
|
865
|
+
type: 'string',
|
|
866
|
+
hidden: true,
|
|
867
|
+
placeholder: '2022',
|
|
868
|
+
format: 'numeric',
|
|
869
|
+
},
|
|
870
|
+
cardToken: {
|
|
871
|
+
title: 'Card token',
|
|
872
|
+
type: 'string',
|
|
873
|
+
hidden: true,
|
|
874
|
+
persistAsync: {
|
|
875
|
+
method: 'POST',
|
|
876
|
+
url: '/persist',
|
|
877
|
+
param: 'cardNumber',
|
|
878
|
+
idProperty: 'cardToken',
|
|
879
|
+
schema: {
|
|
880
|
+
title: 'Card number',
|
|
881
|
+
type: 'string',
|
|
882
|
+
placeholder: '1234567890123456',
|
|
883
|
+
format: 'numeric',
|
|
884
|
+
},
|
|
885
|
+
},
|
|
886
|
+
},
|
|
887
|
+
},
|
|
888
|
+
required: ['cardToken'],
|
|
889
|
+
},
|
|
890
|
+
address: {
|
|
891
|
+
title: 'Recipient address',
|
|
892
|
+
type: 'object',
|
|
893
|
+
displayOrder: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
894
|
+
properties: {
|
|
895
|
+
country: {
|
|
896
|
+
title: 'Country',
|
|
897
|
+
type: 'string',
|
|
898
|
+
placeholder: 'Choose a country',
|
|
899
|
+
oneOf: [
|
|
900
|
+
{ title: 'United States', const: 'US' },
|
|
901
|
+
{ title: 'United Kingdom', const: 'GB' },
|
|
902
|
+
],
|
|
903
|
+
refreshFormOnChange: true,
|
|
904
|
+
},
|
|
905
|
+
city: {
|
|
906
|
+
title: 'City',
|
|
907
|
+
type: 'string',
|
|
908
|
+
},
|
|
909
|
+
firstLine: {
|
|
910
|
+
title: 'Recipient address',
|
|
911
|
+
type: 'string',
|
|
912
|
+
},
|
|
913
|
+
state: {
|
|
914
|
+
title: 'State',
|
|
915
|
+
type: 'string',
|
|
916
|
+
oneOf: [
|
|
917
|
+
{ title: 'Alabama', const: 'AL' },
|
|
918
|
+
{ title: 'Alaska', const: 'AK' },
|
|
919
|
+
],
|
|
920
|
+
},
|
|
921
|
+
postCode: {
|
|
922
|
+
title: 'ZIP code',
|
|
923
|
+
type: 'string',
|
|
924
|
+
},
|
|
925
|
+
},
|
|
926
|
+
required: ['country', 'city', 'firstLine', 'state', 'postCode'],
|
|
927
|
+
},
|
|
928
|
+
type: {
|
|
929
|
+
title: 'Type',
|
|
930
|
+
type: 'string',
|
|
931
|
+
analyticsId: 'Type',
|
|
932
|
+
hidden: true,
|
|
933
|
+
const: 'Card',
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
required: ['type', 'address', 'name', 'details'],
|
|
937
|
+
},
|
|
938
|
+
],
|
|
939
|
+
control: 'tab',
|
|
940
|
+
placeholder: 'Please select where you are sending to',
|
|
941
|
+
},
|
|
942
|
+
],
|
|
943
|
+
$id: 'form',
|
|
944
|
+
},
|
|
945
|
+
],
|
|
946
|
+
refreshFormUrl: '/refresh',
|
|
947
|
+
model: {
|
|
948
|
+
ownedByCustomer: false,
|
|
949
|
+
address: { country: 'US' },
|
|
950
|
+
profileId: 14518756,
|
|
951
|
+
legalEntityType: 'PERSON',
|
|
952
|
+
name: {},
|
|
953
|
+
currency: 'USD',
|
|
954
|
+
details: { cardToken: 'X_njjb1uoi0j4jrqgr1pn69mtqrb' },
|
|
955
|
+
type: 'Card',
|
|
956
|
+
},
|
|
957
|
+
layout: [{ schemaId: 'form', type: 'form' }],
|
|
958
|
+
};
|