@wise/dynamic-flow-client 0.1.1 → 0.1.3
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/common/api/utils.d.ts +4 -0
- package/build/common/api/utils.js +13 -0
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.d.ts +11 -0
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.js +36 -0
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.d.ts +4 -0
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.js +13 -0
- package/build/common/contexts/fetcherContext/fetcherContext.d.ts +18 -0
- package/build/common/contexts/fetcherContext/fetcherContext.js +35 -0
- package/build/common/contexts/fetcherContext/index.d.ts +2 -0
- package/build/common/contexts/fetcherContext/index.js +2 -0
- package/build/common/contexts/fetcherContext/makeFetcher.d.ts +2 -0
- package/build/common/contexts/fetcherContext/makeFetcher.js +33 -0
- package/build/common/general/index.d.ts +2 -0
- package/build/common/general/index.js +22 -0
- package/build/common/hooks/useDebouncedFunction.d.ts +2 -0
- package/build/common/hooks/useDebouncedFunction.js +9 -0
- package/build/common/hooks/useDebouncedFunction.test.d.ts +1 -0
- package/build/common/hooks/useDebouncedFunction.test.js +59 -0
- package/build/common/hooks/usePersistAsync.d.ts +7 -0
- package/build/common/hooks/usePersistAsync.js +170 -0
- package/build/common/hooks/usePolling.d.ts +11 -0
- package/build/common/hooks/usePolling.js +48 -0
- package/build/common/hooks/usePrevious.d.ts +2 -0
- package/build/common/hooks/usePrevious.js +9 -0
- package/build/common/index.d.ts +4 -0
- package/build/common/index.js +4 -0
- package/build/common/logging/index.d.ts +22 -0
- package/build/common/logging/index.js +39 -0
- package/build/common/logging/spec.d.ts +1 -0
- package/build/common/logging/spec.js +45 -0
- package/build/common/messages.d.ts +8 -0
- package/build/common/messages.js +8 -0
- package/build/common/propsValues/dateMode.d.ts +4 -0
- package/build/common/propsValues/dateMode.js +4 -0
- package/build/common/propsValues/formControlType.d.ts +17 -0
- package/build/common/propsValues/formControlType.js +17 -0
- package/build/common/propsValues/monthFormat.d.ts +4 -0
- package/build/common/propsValues/monthFormat.js +4 -0
- package/build/common/propsValues/size.d.ts +7 -0
- package/build/common/propsValues/size.js +7 -0
- package/build/common/requirements.d.ts +10 -0
- package/build/common/requirements.js +50 -0
- package/build/common/schemaTypes/schemaTypes.d.ts +23 -0
- package/build/common/schemaTypes/schemaTypes.js +53 -0
- package/build/common/schemaTypes/shouldDebounceSchema.d.ts +2 -0
- package/build/common/schemaTypes/shouldDebounceSchema.js +6 -0
- package/build/common/stepTypes/stepTypes.d.ts +7 -0
- package/build/common/stepTypes/stepTypes.js +42 -0
- package/build/common/tracking/index.d.ts +15 -0
- package/build/common/tracking/index.js +33 -0
- package/build/common/tracking/spec.d.ts +1 -0
- package/build/common/tracking/spec.js +49 -0
- package/build/common/utils/file-utils.d.ts +4 -0
- package/build/common/utils/file-utils.js +45 -0
- package/build/common/utils/generate-random-id.d.ts +1 -0
- package/build/common/utils/generate-random-id.js +5 -0
- package/build/common/utils/generate-random-id.test.d.ts +1 -0
- package/build/common/utils/generate-random-id.test.js +12 -0
- package/build/common/validation/rule-validators/index.d.ts +10 -0
- package/build/common/validation/rule-validators/index.js +40 -0
- package/build/common/validation/rule-validators/spec.d.ts +1 -0
- package/build/common/validation/rule-validators/spec.js +145 -0
- package/build/common/validation/schema-validators/index.d.ts +9 -0
- package/build/common/validation/schema-validators/index.js +98 -0
- package/build/common/validation/schema-validators/spec.d.ts +1 -0
- package/build/common/validation/schema-validators/spec.js +137 -0
- package/build/common/validation/valid-model/index.d.ts +5 -0
- package/build/common/validation/valid-model/index.js +64 -0
- package/build/common/validation/valid-model/spec.d.ts +1 -0
- package/build/common/validation/valid-model/spec.js +605 -0
- package/build/common/validation/valid-model/utils.d.ts +11 -0
- package/build/common/validation/valid-model/utils.js +118 -0
- package/build/common/validation/validation-failures/index.d.ts +23 -0
- package/build/common/validation/validation-failures/index.js +140 -0
- package/build/common/validation/validation-failures/spec.d.ts +1 -0
- package/build/common/validation/validation-failures/spec.js +185 -0
- package/build/dynamic-flow-types/Action.d.ts +19 -0
- package/build/dynamic-flow-types/Action.js +1 -0
- package/build/dynamic-flow-types/FileUploadSchema.d.ts +23 -0
- package/build/dynamic-flow-types/FileUploadSchema.js +3 -0
- package/build/dynamic-flow-types/LayoutComponent.d.ts +129 -0
- package/build/dynamic-flow-types/LayoutComponent.js +1 -0
- package/build/dynamic-flow-types/Model.d.ts +12 -0
- package/build/dynamic-flow-types/Model.js +28 -0
- package/build/dynamic-flow-types/PersistAsync.d.ts +8 -0
- package/build/dynamic-flow-types/PersistAsync.js +1 -0
- package/build/dynamic-flow-types/Polling.d.ts +12 -0
- package/build/dynamic-flow-types/Polling.js +1 -0
- package/build/dynamic-flow-types/Promotion.d.ts +20 -0
- package/build/dynamic-flow-types/Promotion.js +1 -0
- package/build/dynamic-flow-types/Schema.d.ts +184 -0
- package/build/dynamic-flow-types/Schema.js +49 -0
- package/build/dynamic-flow-types/Step.d.ts +127 -0
- package/build/dynamic-flow-types/Step.js +4 -0
- package/build/dynamic-flow-types/ValidationAsync.d.ts +6 -0
- package/build/dynamic-flow-types/ValidationAsync.js +1 -0
- package/build/dynamic-flow-types/core.d.ts +29 -0
- package/build/dynamic-flow-types/core.js +1 -0
- package/build/dynamic-flow-types/index.d.ts +14 -0
- package/build/dynamic-flow-types/index.js +12 -0
- package/build/field/Field.d.ts +69 -0
- package/build/field/Field.js +311 -0
- package/build/field/index.d.ts +2 -0
- package/build/field/index.js +2 -0
- package/build/flow/DynamicFlow.d.ts +4 -0
- package/build/flow/DynamicFlow.js +368 -0
- package/build/flow/DynamicFlowStep.d.ts +9 -0
- package/build/flow/DynamicFlowStep.js +32 -0
- package/build/flow/errorBoundary/ErrorBoundary.d.ts +20 -0
- package/build/flow/errorBoundary/ErrorBoundary.js +45 -0
- package/build/flow/errorBoundary/ErrorBoundary.messages.d.ts +13 -0
- package/build/flow/errorBoundary/ErrorBoundary.messages.js +13 -0
- package/build/flow/errorBoundary/ErrorBoundaryAlert.d.ts +6 -0
- package/build/flow/errorBoundary/ErrorBoundaryAlert.js +12 -0
- package/build/flow/errorBoundary/index.d.ts +1 -0
- package/build/flow/errorBoundary/index.js +1 -0
- package/build/flow/fixtures/components/alert.d.ts +3 -0
- package/build/flow/fixtures/components/alert.js +31 -0
- package/build/flow/fixtures/components/box.d.ts +3 -0
- package/build/flow/fixtures/components/box.js +20 -0
- package/build/flow/fixtures/components/button.d.ts +3 -0
- package/build/flow/fixtures/components/button.js +65 -0
- package/build/flow/fixtures/components/columns.d.ts +3 -0
- package/build/flow/fixtures/components/columns.js +36 -0
- package/build/flow/fixtures/components/copyable.d.ts +3 -0
- package/build/flow/fixtures/components/copyable.js +22 -0
- package/build/flow/fixtures/components/decision.d.ts +3 -0
- package/build/flow/fixtures/components/decision.js +54 -0
- package/build/flow/fixtures/components/heading.d.ts +3 -0
- package/build/flow/fixtures/components/heading.js +14 -0
- package/build/flow/fixtures/components/image.d.ts +3 -0
- package/build/flow/fixtures/components/image.js +22 -0
- package/build/flow/fixtures/components/info.d.ts +3 -0
- package/build/flow/fixtures/components/info.js +17 -0
- package/build/flow/fixtures/components/list.d.ts +3 -0
- package/build/flow/fixtures/components/list.js +34 -0
- package/build/flow/fixtures/components/loading-indicator.d.ts +3 -0
- package/build/flow/fixtures/components/loading-indicator.js +16 -0
- package/build/flow/fixtures/components/paragraph.d.ts +3 -0
- package/build/flow/fixtures/components/paragraph.js +28 -0
- package/build/flow/fixtures/components/review.d.ts +3 -0
- package/build/flow/fixtures/components/review.js +60 -0
- package/build/flow/fixtures/examples/camera-capture.d.ts +3 -0
- package/build/flow/fixtures/examples/camera-capture.js +121 -0
- package/build/flow/fixtures/examples/recipient-update.d.ts +3 -0
- package/build/flow/fixtures/examples/recipient-update.js +250 -0
- package/build/flow/fixtures/examples/recipient.d.ts +3 -0
- package/build/flow/fixtures/examples/recipient.js +313 -0
- package/build/flow/fixtures/examples/single-file-upload.d.ts +3 -0
- package/build/flow/fixtures/examples/single-file-upload.js +96 -0
- package/build/flow/fixtures/examples/step-validation-errors.d.ts +3 -0
- package/build/flow/fixtures/examples/step-validation-errors.js +75 -0
- package/build/flow/fixtures/features/action-response.d.ts +3 -0
- package/build/flow/fixtures/features/action-response.js +29 -0
- package/build/flow/fixtures/features/external.d.ts +3 -0
- package/build/flow/fixtures/features/external.js +31 -0
- package/build/flow/fixtures/features/persist-async.d.ts +3 -0
- package/build/flow/fixtures/features/persist-async.js +44 -0
- package/build/flow/fixtures/features/polling.d.ts +3 -0
- package/build/flow/fixtures/features/polling.js +33 -0
- package/build/flow/fixtures/index.d.ts +42 -0
- package/build/flow/fixtures/index.js +66 -0
- package/build/flow/fixtures/responses/action-response-final.d.ts +3 -0
- package/build/flow/fixtures/responses/action-response-final.js +24 -0
- package/build/flow/fixtures/responses/action.d.ts +5 -0
- package/build/flow/fixtures/responses/action.js +2 -0
- package/build/flow/fixtures/responses/exit.d.ts +6 -0
- package/build/flow/fixtures/responses/exit.js +2 -0
- package/build/flow/fixtures/responses/recipient-update-final.d.ts +3 -0
- package/build/flow/fixtures/responses/recipient-update-final.js +24 -0
- package/build/flow/fixtures/schemas/basic-form.d.ts +3 -0
- package/build/flow/fixtures/schemas/basic-form.js +39 -0
- package/build/flow/fixtures/schemas/number-and-integer.d.ts +3 -0
- package/build/flow/fixtures/schemas/number-and-integer.js +41 -0
- package/build/flow/fixtures/schemas/one-of.d.ts +3 -0
- package/build/flow/fixtures/schemas/one-of.js +223 -0
- package/build/flow/fixtures/schemas/string-formats.d.ts +3 -0
- package/build/flow/fixtures/schemas/string-formats.js +58 -0
- package/build/flow/index.d.ts +1 -0
- package/build/flow/index.js +1 -0
- package/build/flow/response-parsers/index.d.ts +17 -0
- package/build/flow/response-parsers/index.js +112 -0
- package/build/flow/response-parsers/spec.d.ts +1 -0
- package/build/flow/response-parsers/spec.js +263 -0
- package/build/flow/stories/EditableDynamicFlow.d.ts +5 -0
- package/build/flow/stories/EditableDynamicFlow.js +61 -0
- package/build/flow/types.d.ts +77 -0
- package/build/flow/types.js +3 -0
- package/build/flow/useDebouncedRefresh/index.d.ts +1 -0
- package/build/flow/useDebouncedRefresh/index.js +1 -0
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.d.ts +5 -0
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.js +24 -0
- package/build/flow/useDynamicFlowState.d.ts +18 -0
- package/build/flow/useDynamicFlowState.js +111 -0
- package/build/flow/useLoader.d.ts +9 -0
- package/build/flow/useLoader.js +22 -0
- package/build/formControl/FormControl.d.ts +86 -0
- package/build/formControl/FormControl.js +241 -0
- package/build/formControl/index.d.ts +1 -0
- package/build/formControl/index.js +1 -0
- package/build/formControl/types.d.ts +57 -0
- package/build/formControl/types.js +1 -0
- package/build/formControl/value-utils.d.ts +9 -0
- package/build/formControl/value-utils.js +108 -0
- package/build/i18n/cs.json +8 -0
- package/build/i18n/de.json +34 -0
- package/build/i18n/en.json +38 -0
- package/build/i18n/es.json +34 -0
- package/build/i18n/fr.json +34 -0
- package/build/i18n/hu.json +34 -0
- package/build/i18n/id.json +34 -0
- package/build/i18n/index.d.ts +2 -0
- package/build/i18n/index.js +31 -0
- package/build/i18n/it.json +34 -0
- package/build/i18n/ja.json +34 -0
- package/build/i18n/pl.json +11 -0
- package/build/i18n/pt.json +34 -0
- package/build/i18n/ro.json +34 -0
- package/build/i18n/ru.json +34 -0
- package/build/i18n/th.json +34 -0
- package/build/i18n/tr.json +11 -0
- package/build/i18n/uk.json +8 -0
- package/build/i18n/zh-CN.json +34 -0
- package/build/i18n/zh.json +34 -0
- package/build/index.d.ts +12 -0
- package/build/index.js +11 -0
- package/build/jsonSchemaForm/JsonSchemaForm.d.ts +66 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +31 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +14 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +54 -0
- package/build/jsonSchemaForm/allOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +15 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +25 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +26 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +141 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +24 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.d.ts +9 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.js +14 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.d.ts +6 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.js +85 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +22 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +105 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +31 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +79 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts +53 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +53 -0
- package/build/jsonSchemaForm/controlFeedback/index.d.ts +1 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +1 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +19 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +122 -0
- package/build/jsonSchemaForm/genericSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/genericSchema/index.js +1 -0
- package/build/jsonSchemaForm/help/Help.d.ts +8 -0
- package/build/jsonSchemaForm/help/Help.js +9 -0
- package/build/jsonSchemaForm/help/Help.messages.d.ts +8 -0
- package/build/jsonSchemaForm/help/Help.messages.js +8 -0
- package/build/jsonSchemaForm/help/index.d.ts +1 -0
- package/build/jsonSchemaForm/help/index.js +1 -0
- package/build/jsonSchemaForm/index.d.ts +1 -0
- package/build/jsonSchemaForm/index.js +1 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +16 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +78 -0
- package/build/jsonSchemaForm/objectSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/objectSchema/index.js +1 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +15 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +153 -0
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.d.ts +3 -0
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.js +40 -0
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.js +27 -0
- package/build/jsonSchemaForm/oneOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.d.ts +3 -0
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.js +7 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +26 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +8 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +8 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.d.ts +21 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.js +168 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.d.ts +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.js +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.d.ts +20 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.js +127 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.d.ts +17 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.js +32 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.d.ts +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.js +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +9 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +72 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.d.ts +2 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.js +8 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.d.ts +7 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.js +27 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.d.ts +23 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.js +31 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.d.ts +9 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.js +32 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +8 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +55 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +16 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +13 -0
- package/build/jsonSchemaForm/readOnlySchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +25 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +106 -0
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.d.ts +3 -0
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.js +73 -0
- package/build/jsonSchemaForm/schemaFormControl/index.d.ts +1 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.d.ts +40 -0
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.js +89 -0
- package/build/jsonSchemaForm/schemas/allOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/allOf.json.js +119 -0
- package/build/jsonSchemaForm/schemas/audRecipient.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/audRecipient.json.js +1104 -0
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.js +37 -0
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.js +36 -0
- package/build/jsonSchemaForm/schemas/currency.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/currency.json.js +48 -0
- package/build/jsonSchemaForm/schemas/oneOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/oneOf.json.js +119 -0
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.js +53 -0
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.js +56 -0
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.js +102 -0
- package/build/jsonSchemaForm/schemas/simple.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/simple.json.js +48 -0
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.js +71 -0
- package/build/jsonSchemaForm/schemas/validationAsync.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/validationAsync.json.js +23 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +17 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +149 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +1 -0
- package/build/layout/DynamicLayout.d.ts +17 -0
- package/build/layout/DynamicLayout.js +75 -0
- package/build/layout/alert/index.d.ts +6 -0
- package/build/layout/alert/index.js +29 -0
- package/build/layout/box/index.d.ts +8 -0
- package/build/layout/box/index.js +41 -0
- package/build/layout/button/index.d.ts +8 -0
- package/build/layout/button/index.js +58 -0
- package/build/layout/columns/index.d.ts +8 -0
- package/build/layout/columns/index.js +38 -0
- package/build/layout/decision/index.d.ts +9 -0
- package/build/layout/decision/index.js +38 -0
- package/build/layout/divider/index.d.ts +7 -0
- package/build/layout/divider/index.js +9 -0
- package/build/layout/external/DynamicExternal.d.ts +8 -0
- package/build/layout/external/DynamicExternal.js +30 -0
- package/build/layout/external/DynamicExternal.messages.d.ts +8 -0
- package/build/layout/external/DynamicExternal.messages.js +8 -0
- package/build/layout/external/index.d.ts +1 -0
- package/build/layout/external/index.js +1 -0
- package/build/layout/external/useExternalStepPolling.d.ts +11 -0
- package/build/layout/external/useExternalStepPolling.js +68 -0
- package/build/layout/form/index.d.ts +8 -0
- package/build/layout/form/index.js +22 -0
- package/build/layout/heading/index.d.ts +6 -0
- package/build/layout/heading/index.js +31 -0
- package/build/layout/icon/index.d.ts +7 -0
- package/build/layout/icon/index.js +22 -0
- package/build/layout/image/index.d.ts +6 -0
- package/build/layout/image/index.js +126 -0
- package/build/layout/index.d.ts +1 -0
- package/build/layout/index.js +1 -0
- package/build/layout/info/index.d.ts +7 -0
- package/build/layout/info/index.js +19 -0
- package/build/layout/layouts/all.json.d.ts +3 -0
- package/build/layout/layouts/all.json.js +176 -0
- package/build/layout/layouts/final-step-layout.json.d.ts +3 -0
- package/build/layout/layouts/final-step-layout.json.js +39 -0
- package/build/layout/layouts/finalStep.json.d.ts +3 -0
- package/build/layout/layouts/finalStep.json.js +24 -0
- package/build/layout/layouts/list.json.d.ts +3 -0
- package/build/layout/layouts/list.json.js +33 -0
- package/build/layout/layouts/pay-in.json.d.ts +3 -0
- package/build/layout/layouts/pay-in.json.js +97 -0
- package/build/layout/layouts/review.json.d.ts +3 -0
- package/build/layout/layouts/review.json.js +160 -0
- package/build/layout/layouts/success.json.d.ts +3 -0
- package/build/layout/layouts/success.json.js +66 -0
- package/build/layout/list/index.d.ts +8 -0
- package/build/layout/list/index.js +30 -0
- package/build/layout/loading-indicator/index.d.ts +7 -0
- package/build/layout/loading-indicator/index.js +10 -0
- package/build/layout/loading-indicator/spec.d.ts +1 -0
- package/build/layout/loading-indicator/spec.js +11 -0
- package/build/layout/paragraph/DynamicParagraph.d.ts +7 -0
- package/build/layout/paragraph/DynamicParagraph.js +42 -0
- package/build/layout/paragraph/DynamicParagraph.messages.d.ts +13 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +13 -0
- package/build/layout/paragraph/index.d.ts +1 -0
- package/build/layout/paragraph/index.js +1 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.d.ts +10 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +9 -0
- package/build/layout/review/index.d.ts +9 -0
- package/build/layout/review/index.js +33 -0
- package/build/layout/utils.d.ts +7 -0
- package/build/layout/utils.js +31 -0
- package/build/main.css +143 -0
- package/build/schema.d.ts +1 -0
- package/build/schema.js +1 -0
- package/build/step/cameraStep/CameraStep.d.ts +8 -0
- package/build/step/cameraStep/CameraStep.js +125 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +16 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +122 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +18 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +18 -0
- package/build/step/cameraStep/cameraCapture/components/index.d.ts +8 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +28 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.d.ts +4 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +80 -0
- package/build/step/cameraStep/cameraCapture/index.d.ts +1 -0
- package/build/step/cameraStep/cameraCapture/index.js +1 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +11 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +78 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +3 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +19 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +13 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +13 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +6 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +21 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +18 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +18 -0
- package/build/step/cameraStep/cameraCapture/screens/index.d.ts +2 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +2 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.d.ts +7 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +101 -0
- package/build/step/cameraStep/cameraCapture/utils/index.d.ts +8 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +103 -0
- package/build/step/cameraStep/index.d.ts +1 -0
- package/build/step/cameraStep/index.js +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +7 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +64 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +23 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +23 -0
- package/build/step/externalConfirmationStep/index.d.ts +1 -0
- package/build/step/externalConfirmationStep/index.js +1 -0
- package/build/step/features/external/useExternal.d.ts +4 -0
- package/build/step/features/external/useExternal.js +15 -0
- package/build/step/features/index.d.ts +2 -0
- package/build/step/features/index.js +2 -0
- package/build/step/features/polling/useStepPolling.d.ts +2 -0
- package/build/step/features/polling/useStepPolling.js +44 -0
- package/build/step/index.d.ts +3 -0
- package/build/step/index.js +3 -0
- package/build/step/layoutStep/LayoutStep.d.ts +11 -0
- package/build/step/layoutStep/LayoutStep.js +34 -0
- package/build/step/layoutStep/index.d.ts +1 -0
- package/build/step/layoutStep/index.js +1 -0
- package/build/step/layoutStep/layoutService/convertStepToLayout.d.ts +8 -0
- package/build/step/layoutStep/layoutService/convertStepToLayout.js +217 -0
- package/build/step/layoutStep/layoutService/index.d.ts +2 -0
- package/build/step/layoutStep/layoutService/index.js +2 -0
- package/build/step/layoutStep/layoutService/inlineReferences.d.ts +7 -0
- package/build/step/layoutStep/layoutService/inlineReferences.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
var currencies = [
|
|
2
|
+
['EUR', 'Euro'],
|
|
3
|
+
['GBP', 'British pound'],
|
|
4
|
+
['INR', 'Indian rupee'],
|
|
5
|
+
['USD', 'United States dollar'],
|
|
6
|
+
['AED', 'United Arab Emirates dirham'],
|
|
7
|
+
['ARS', 'Argentine peso'],
|
|
8
|
+
['AUD', 'Australian dollar'],
|
|
9
|
+
['BDT', 'Bangladeshi taka'],
|
|
10
|
+
['BGN', 'Bulgarian lev'],
|
|
11
|
+
['BRL', 'Brazilian real'],
|
|
12
|
+
['BWP', 'Botswana pula'],
|
|
13
|
+
['CAD', 'Canadian dollar'],
|
|
14
|
+
['CHF', 'Swiss franc'],
|
|
15
|
+
['CLP', 'Chilean peso'],
|
|
16
|
+
['CNY', 'Chinese yuan'],
|
|
17
|
+
['COP', 'Colombian peso'],
|
|
18
|
+
['CRC', 'Costa Rican colón'],
|
|
19
|
+
['CZK', 'Czech koruna'],
|
|
20
|
+
['DKK', 'Danish krone'],
|
|
21
|
+
['EGP', 'Egyptian pound'],
|
|
22
|
+
['FJD', 'Fijian dollar'],
|
|
23
|
+
['GEL', 'Georgian lari'],
|
|
24
|
+
['GHS', 'Ghanaian cedi'],
|
|
25
|
+
['GTQ', 'Guatemalan quetzal'],
|
|
26
|
+
['HKD', 'Hong Kong dollar'],
|
|
27
|
+
['HRK', 'Croatian kuna'],
|
|
28
|
+
['HUF', 'Hungarian forint'],
|
|
29
|
+
['IDR', 'Indonesian rupiah'],
|
|
30
|
+
['ILS', 'Israeli shekel'],
|
|
31
|
+
['JPY', 'Japanese yen'],
|
|
32
|
+
['KES', 'Kenyan shilling'],
|
|
33
|
+
['KRW', 'South Korean won'],
|
|
34
|
+
['LKR', 'Sri Lankan rupee'],
|
|
35
|
+
['MAD', 'Moroccan dirham'],
|
|
36
|
+
['MXN', 'Mexican peso'],
|
|
37
|
+
['MYR', 'Malaysian ringgit'],
|
|
38
|
+
['MZN', 'Mozambican metical'],
|
|
39
|
+
['NAD', 'Namibian dollar'],
|
|
40
|
+
['NGN', 'Nigerian naira'],
|
|
41
|
+
['NOK', 'Norwegian krone'],
|
|
42
|
+
['NPR', 'Nepalese rupee'],
|
|
43
|
+
['NZD', 'New Zealand dollar'],
|
|
44
|
+
['PEN', 'Peruvian nuevo sol'],
|
|
45
|
+
['PHP', 'Philippine peso'],
|
|
46
|
+
['PKR', 'Pakistani rupee'],
|
|
47
|
+
['PLN', 'Polish złoty'],
|
|
48
|
+
['RON', 'Romanian leu'],
|
|
49
|
+
['RUB', 'Russian rouble'],
|
|
50
|
+
['SEK', 'Swedish krona'],
|
|
51
|
+
['SGD', 'Singapore dollar'],
|
|
52
|
+
['THB', 'Thai baht'],
|
|
53
|
+
['TRY', 'Turkish lira'],
|
|
54
|
+
['TZS', 'Tanzanian shilling'],
|
|
55
|
+
['UAH', 'Ukrainian hryvnia'],
|
|
56
|
+
['UGX', 'Ugandan shilling'],
|
|
57
|
+
['UYU', 'Uruguayan peso'],
|
|
58
|
+
['VND', 'Vietnamese dong'],
|
|
59
|
+
['XOF', 'West African CFA franc'],
|
|
60
|
+
['ZAR', 'South African rand'],
|
|
61
|
+
['ZMW', 'Zambian kwacha'],
|
|
62
|
+
];
|
|
63
|
+
var step = {
|
|
64
|
+
key: 'Schemas/OneOf',
|
|
65
|
+
title: 'OneOf Schemas',
|
|
66
|
+
description: 'OneOf Schema using select, radio buttons and tabs.',
|
|
67
|
+
type: 'form',
|
|
68
|
+
analytics: { custom: 'this is the oneOf fixture' },
|
|
69
|
+
actions: [],
|
|
70
|
+
schemas: [
|
|
71
|
+
{
|
|
72
|
+
$id: '#the-schema',
|
|
73
|
+
type: 'object',
|
|
74
|
+
displayOrder: ['account-type-radio', 'colour-select', 'currency', 'bank-details-tabs'],
|
|
75
|
+
required: ['bank-details-tabs'],
|
|
76
|
+
properties: {
|
|
77
|
+
'account-type-radio': {
|
|
78
|
+
title: 'Personal or Business Account? (oneOf schema with two options default to control: "radio")',
|
|
79
|
+
analyticsId: 'account-type-radio',
|
|
80
|
+
oneOf: [
|
|
81
|
+
{
|
|
82
|
+
title: 'Personal',
|
|
83
|
+
analyticsId: 'account-type-radio-personal',
|
|
84
|
+
icon: {
|
|
85
|
+
name: 'person'
|
|
86
|
+
},
|
|
87
|
+
"const": 'PERSONAL'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'Business',
|
|
91
|
+
analyticsId: 'account-type-radio-business',
|
|
92
|
+
icon: {
|
|
93
|
+
name: 'briefcase'
|
|
94
|
+
},
|
|
95
|
+
"const": 'BUSINESS'
|
|
96
|
+
},
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
'colour-select': {
|
|
100
|
+
title: 'What is your favourite colour? (oneOf schema with more than two options default to control: "select")',
|
|
101
|
+
placeholder: 'Please select a colour',
|
|
102
|
+
analyticsId: 'colour-select',
|
|
103
|
+
oneOf: [
|
|
104
|
+
{
|
|
105
|
+
title: 'Blue',
|
|
106
|
+
analyticsId: 'colour-select-blue',
|
|
107
|
+
image: {
|
|
108
|
+
url: 'https://placeholder.pics/svg/64/0099ff/FFFFFF'
|
|
109
|
+
},
|
|
110
|
+
"const": 1
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
title: 'Yellow',
|
|
114
|
+
analyticsId: 'colour-select-yellow',
|
|
115
|
+
image: {
|
|
116
|
+
url: 'https://placeholder.pics/svg/64/ffcc00/FFFFFF'
|
|
117
|
+
},
|
|
118
|
+
"const": 2
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
title: 'Red',
|
|
122
|
+
analyticsId: 'colour-select-red',
|
|
123
|
+
image: {
|
|
124
|
+
url: 'https://placeholder.pics/svg/64/ff6600/FFFFFF'
|
|
125
|
+
},
|
|
126
|
+
"const": 3
|
|
127
|
+
},
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
currency: {
|
|
131
|
+
title: 'Currency (oneof schema of const schemas with default value)',
|
|
132
|
+
type: 'string',
|
|
133
|
+
analyticsId: 'currency',
|
|
134
|
+
oneOf: currencies.map(function (_a) {
|
|
135
|
+
var code = _a[0], name = _a[1];
|
|
136
|
+
return ({
|
|
137
|
+
title: code,
|
|
138
|
+
analyticsId: code,
|
|
139
|
+
icon: { name: "flag-".concat(code.toLowerCase()) },
|
|
140
|
+
description: name,
|
|
141
|
+
"const": code
|
|
142
|
+
});
|
|
143
|
+
}),
|
|
144
|
+
validationMessages: { required: 'Please enter currency.' },
|
|
145
|
+
"default": 'EUR'
|
|
146
|
+
},
|
|
147
|
+
'bank-details-tabs': {
|
|
148
|
+
title: 'Bank Details (oneOf schema of object schemas and control: "tab")',
|
|
149
|
+
control: 'tab',
|
|
150
|
+
analyticsId: 'bank-details-tabs',
|
|
151
|
+
oneOf: [
|
|
152
|
+
{
|
|
153
|
+
type: 'object',
|
|
154
|
+
title: 'UK Sortcode and Account Number',
|
|
155
|
+
analyticsId: 'bank-details-tabs-uk',
|
|
156
|
+
displayOrder: ['account-number', 'sort-code'],
|
|
157
|
+
required: ['account-number', 'sort-code'],
|
|
158
|
+
properties: {
|
|
159
|
+
'account-number': {
|
|
160
|
+
title: 'Account Number',
|
|
161
|
+
type: 'string'
|
|
162
|
+
},
|
|
163
|
+
'sort-code': {
|
|
164
|
+
title: 'Sort Code',
|
|
165
|
+
type: 'string'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'object',
|
|
171
|
+
title: 'IBAN and BIC',
|
|
172
|
+
analyticsId: 'bank-details-tabs-iban',
|
|
173
|
+
displayOrder: ['iban', 'bic'],
|
|
174
|
+
required: ['iban', 'bic'],
|
|
175
|
+
properties: {
|
|
176
|
+
iban: {
|
|
177
|
+
title: 'IBAN',
|
|
178
|
+
type: 'string'
|
|
179
|
+
},
|
|
180
|
+
bic: {
|
|
181
|
+
title: 'BIC',
|
|
182
|
+
type: 'string'
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'object',
|
|
188
|
+
title: 'US Routing Number and Account Number',
|
|
189
|
+
analyticsId: 'bank-details-tabs-us',
|
|
190
|
+
displayOrder: ['account-number', 'routing-number'],
|
|
191
|
+
required: ['account-number', 'routing-number'],
|
|
192
|
+
properties: {
|
|
193
|
+
'account-number': {
|
|
194
|
+
title: 'Account Number',
|
|
195
|
+
type: 'string'
|
|
196
|
+
},
|
|
197
|
+
'routing-number': {
|
|
198
|
+
title: 'Routing Number',
|
|
199
|
+
type: 'string'
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
layout: [
|
|
209
|
+
{
|
|
210
|
+
type: 'form',
|
|
211
|
+
schema: { $ref: '#the-schema' }
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
type: 'button',
|
|
215
|
+
action: {
|
|
216
|
+
url: '/submit',
|
|
217
|
+
title: 'Submit',
|
|
218
|
+
type: 'primary'
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
]
|
|
222
|
+
};
|
|
223
|
+
export default step;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var step = {
|
|
2
|
+
key: 'Schemas/String Formats',
|
|
3
|
+
title: 'String Schema Formats',
|
|
4
|
+
description: 'String schemas with different formats (password, date, telephone).',
|
|
5
|
+
type: 'form',
|
|
6
|
+
actions: [],
|
|
7
|
+
schemas: [
|
|
8
|
+
{
|
|
9
|
+
$id: '#the-schema',
|
|
10
|
+
type: 'object',
|
|
11
|
+
displayOrder: ['name', 'password', 'dob', 'date-lookup', 'telephone'],
|
|
12
|
+
properties: {
|
|
13
|
+
name: {
|
|
14
|
+
title: 'Name (string schema no format)',
|
|
15
|
+
type: 'string'
|
|
16
|
+
},
|
|
17
|
+
password: {
|
|
18
|
+
title: 'Password (string schema with format: "password")',
|
|
19
|
+
type: 'string',
|
|
20
|
+
format: 'password'
|
|
21
|
+
},
|
|
22
|
+
dob: {
|
|
23
|
+
title: 'Date of birth (string schema with format: "date")',
|
|
24
|
+
type: 'string',
|
|
25
|
+
format: 'date'
|
|
26
|
+
},
|
|
27
|
+
'date-lookup': {
|
|
28
|
+
title: 'Date Lookup (string schema with format: "date" and control: "date-lookup")',
|
|
29
|
+
type: 'string',
|
|
30
|
+
format: 'date',
|
|
31
|
+
control: 'date-lookup',
|
|
32
|
+
minimum: '2023-01-01',
|
|
33
|
+
maximum: '2023-12-31'
|
|
34
|
+
},
|
|
35
|
+
telephone: {
|
|
36
|
+
title: 'Phone number (string schema with format: "phone-number")',
|
|
37
|
+
type: 'string',
|
|
38
|
+
format: 'phone-number'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
layout: [
|
|
44
|
+
{
|
|
45
|
+
type: 'form',
|
|
46
|
+
schema: { $ref: '#the-schema' }
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'button',
|
|
50
|
+
action: {
|
|
51
|
+
url: '/submit',
|
|
52
|
+
title: 'Submit',
|
|
53
|
+
type: 'primary'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
};
|
|
58
|
+
export default step;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DynamicFlow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DynamicFlow';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActionResponseBody, ErrorResponseBody, Step } from '../../dynamic-flow-types';
|
|
2
|
+
import { DynamicFlowProps } from '../types';
|
|
3
|
+
type ParsedBody = {
|
|
4
|
+
type: 'exit';
|
|
5
|
+
result: Parameters<DynamicFlowProps['onClose']>[0];
|
|
6
|
+
} | {
|
|
7
|
+
type: 'action';
|
|
8
|
+
action: ActionResponseBody['action'];
|
|
9
|
+
} | {
|
|
10
|
+
type: 'step';
|
|
11
|
+
step: Step;
|
|
12
|
+
etag?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const parseFetchResponse: (response: Response) => Promise<ParsedBody>;
|
|
15
|
+
export declare const parseErrorResponse: (response: Response) => Promise<ErrorResponseBody>;
|
|
16
|
+
export declare const parseExitResponse: (response: Response) => Promise<Parameters<DynamicFlowProps['onClose']>[0]>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { isObject } from '@transferwise/neptune-validation';
|
|
38
|
+
export var parseFetchResponse = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
|
+
var jsonBody, action, etag;
|
|
40
|
+
var _a;
|
|
41
|
+
var _b;
|
|
42
|
+
return __generator(this, function (_c) {
|
|
43
|
+
switch (_c.label) {
|
|
44
|
+
case 0:
|
|
45
|
+
if (!((_b = response.headers) === null || _b === void 0 ? void 0 : _b.has('X-Df-Exit'))) return [3 /*break*/, 2];
|
|
46
|
+
_a = { type: 'exit' };
|
|
47
|
+
return [4 /*yield*/, parseExitResponse(response)];
|
|
48
|
+
case 1: return [2 /*return*/, (_a.result = _c.sent(), _a)];
|
|
49
|
+
case 2: return [4 /*yield*/, parseResponseJson(response.clone())];
|
|
50
|
+
case 3:
|
|
51
|
+
jsonBody = _c.sent();
|
|
52
|
+
if (!isObject(jsonBody)) {
|
|
53
|
+
throw new Error('Incorrect response body in response. Expected an object.');
|
|
54
|
+
}
|
|
55
|
+
if (jsonBody.action) {
|
|
56
|
+
if (!isObject(jsonBody.action)) {
|
|
57
|
+
throw new Error('Incorrect response body in action response. Expected an object satisfying the type { action: Action }.');
|
|
58
|
+
}
|
|
59
|
+
action = jsonBody.action;
|
|
60
|
+
if (action.exit === true && isObject(action.result)) {
|
|
61
|
+
return [2 /*return*/, { type: 'exit', result: action.result }];
|
|
62
|
+
}
|
|
63
|
+
return [2 /*return*/, { type: 'action', action: jsonBody.action }];
|
|
64
|
+
}
|
|
65
|
+
etag = response.headers.get('etag') || undefined;
|
|
66
|
+
return [2 /*return*/, { type: 'step', step: jsonBody, etag: etag }];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
export var parseErrorResponse = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
+
var jsonBody;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0: return [4 /*yield*/, parseResponseJson(response.clone())];
|
|
75
|
+
case 1:
|
|
76
|
+
jsonBody = _a.sent();
|
|
77
|
+
if (!isObject(jsonBody)) {
|
|
78
|
+
throw new Error('Incorrect response body in error response. Expected an object.');
|
|
79
|
+
}
|
|
80
|
+
return [2 /*return*/, jsonBody];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}); };
|
|
84
|
+
export var parseExitResponse = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var result;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, parseResponseJson(response.clone())];
|
|
89
|
+
case 1:
|
|
90
|
+
result = _a.sent();
|
|
91
|
+
if (isObject(result) || result === null) {
|
|
92
|
+
return [2 /*return*/, result];
|
|
93
|
+
}
|
|
94
|
+
return [2 /*return*/, null];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); };
|
|
98
|
+
var parseResponseJson = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
var _a;
|
|
100
|
+
return __generator(this, function (_b) {
|
|
101
|
+
switch (_b.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
_b.trys.push([0, 2, , 3]);
|
|
104
|
+
return [4 /*yield*/, response.json()];
|
|
105
|
+
case 1: return [2 /*return*/, (_b.sent())];
|
|
106
|
+
case 2:
|
|
107
|
+
_a = _b.sent();
|
|
108
|
+
return [2 /*return*/, null];
|
|
109
|
+
case 3: return [2 /*return*/];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|