@wise/dynamic-flow-client 0.3.0-beta-ec09e7.2 → 0.3.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/README.md +3 -3
- package/build/common/constants/SchemaType.d.ts +11 -0
- package/build/common/constants/SchemaType.js +11 -0
- package/build/common/constants/index.d.ts +5 -0
- package/build/common/constants/index.js +5 -0
- package/build/common/contexts/{fetcherContext/fetcherContext.js → fetcherContexts/FetcherContexts.js} +1 -1
- package/build/common/contexts/index.d.ts +4 -0
- package/build/common/contexts/index.js +4 -0
- package/build/common/hooks/index.d.ts +7 -0
- package/build/common/hooks/index.js +7 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +2 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +9 -0
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +12 -0
- package/build/{layout/external → common/hooks/useExternalStepPolling}/useExternalStepPolling.js +4 -3
- package/build/common/hooks/{usePersistAsync.d.ts → usePersistAsync/usePersistAsync.d.ts} +1 -1
- package/build/common/hooks/{usePersistAsync.js → usePersistAsync/usePersistAsync.js} +6 -6
- package/build/common/hooks/usePrevious/usePrevious.d.ts +1 -0
- package/build/common/hooks/{usePrevious.js → usePrevious/usePrevious.js} +1 -2
- package/build/{step/features/polling → common/hooks/useStepPolling}/useStepPolling.d.ts +1 -1
- package/build/{step/features/polling → common/hooks/useStepPolling}/useStepPolling.js +2 -2
- package/build/common/makeFetcher/index.d.ts +1 -0
- package/build/common/makeFetcher/index.js +1 -0
- package/build/common/{contexts/fetcherContext → makeFetcher}/makeFetcher.js +1 -1
- package/build/common/{general/index.js → utils/date-utils.js} +1 -1
- package/build/common/utils/debounce.d.ts +6 -0
- package/build/common/utils/debounce.js +38 -0
- package/build/common/utils/index.d.ts +8 -0
- package/build/common/utils/index.js +8 -0
- package/build/common/utils/is-equal.d.ts +1 -0
- package/build/common/utils/is-equal.js +21 -0
- package/build/common/{schemaTypes/schemaTypes.d.ts → utils/schema-utils.d.ts} +2 -12
- package/build/common/{schemaTypes/schemaTypes.js → utils/schema-utils.js} +16 -21
- package/build/common/{stepTypes/stepTypes.d.ts → utils/step-utils.d.ts} +1 -1
- package/build/common/{stepTypes/stepTypes.js → utils/step-utils.js} +1 -1
- package/build/common/validators/index.d.ts +5 -0
- package/build/common/validators/index.js +5 -0
- package/build/common/{validation/valid-model/index.d.ts → validators/models/model-validators.d.ts} +1 -2
- package/build/common/{validation/valid-model/index.js → validators/models/model-validators.js} +5 -6
- package/build/common/{validation/valid-model/utils.d.ts → validators/models/models.utils.d.ts} +1 -2
- package/build/common/{validation/valid-model/utils.js → validators/models/models.utils.js} +7 -7
- package/build/common/{validation/schema-validators/index.d.ts → validators/schemas/schema-validators.d.ts} +1 -1
- package/build/common/{validation/schema-validators/index.js → validators/schemas/schema-validators.js} +3 -3
- package/build/common/validators/types/type-validators.d.ts +8 -0
- package/build/common/validators/types/type-validators.js +14 -0
- package/build/common/{validation/validation-failures/index.d.ts → validators/validationFailures/validation-failures.d.ts} +1 -1
- package/build/common/{validation/validation-failures/index.js → validators/validationFailures/validation-failures.js} +4 -4
- package/build/common/{validation/rule-validators/index.js → validators/validationFailures/validation-failures.utils.js} +1 -1
- package/build/common/validators/values/value-validators.d.ts +2 -0
- package/build/common/validators/values/value-validators.js +6 -0
- package/build/{flow → dynamicFlow}/DynamicFlow.d.ts +1 -1
- package/build/{flow → dynamicFlow}/DynamicFlow.js +4 -11
- package/build/{flow → dynamicFlow}/DynamicFlowStep.d.ts +1 -1
- package/build/{flow → dynamicFlow}/DynamicFlowStep.js +3 -3
- package/build/{flow/types.d.ts → dynamicFlow/DynamicFlowTypes.d.ts} +2 -3
- package/build/{flow/types.js → dynamicFlow/DynamicFlowTypes.js} +1 -0
- package/build/{flow → dynamicFlow}/stories/DynamicFlow.story.js +1 -1
- package/build/{flow → dynamicFlow}/stories/EditableDynamicFlow.js +1 -1
- package/build/dynamicFlow/stories/fixtureFetcher.d.ts +2 -0
- package/build/{flow → dynamicFlow}/stories/fixtureFetcher.js +2 -2
- package/build/dynamicFlow/utils/index.d.ts +5 -0
- package/build/dynamicFlow/utils/index.js +5 -0
- package/build/{flow/response-parsers/index.d.ts → dynamicFlow/utils/responseParsers/response-parsers.d.ts} +2 -2
- package/build/{flow/response-parsers/index.js → dynamicFlow/utils/responseParsers/response-parsers.js} +1 -1
- package/build/{flow → dynamicFlow/utils}/useDebouncedRefresh/useDebouncedRefresh.d.ts +2 -2
- package/build/{flow → dynamicFlow/utils}/useDebouncedRefresh/useDebouncedRefresh.js +1 -2
- package/build/{flow → dynamicFlow/utils}/useDynamicFlowState.d.ts +1 -1
- package/build/{flow → dynamicFlow/utils}/useDynamicFlowState.js +2 -3
- package/build/{flow → dynamicFlow/utils}/useLoader.d.ts +1 -1
- package/build/fixtures/components/alert.d.ts +3 -0
- package/build/fixtures/components/box.d.ts +3 -0
- package/build/fixtures/components/button.d.ts +3 -0
- package/build/fixtures/components/columns.d.ts +3 -0
- package/build/fixtures/components/copyable.d.ts +3 -0
- package/build/fixtures/components/decision.d.ts +3 -0
- package/build/fixtures/components/heading.d.ts +3 -0
- package/build/fixtures/components/image.d.ts +3 -0
- package/build/{flow/fixtures → fixtures}/components/image.js +0 -18
- package/build/fixtures/components/index.d.ts +13 -0
- package/build/fixtures/components/index.js +13 -0
- package/build/fixtures/components/info.d.ts +3 -0
- package/build/fixtures/components/list.d.ts +3 -0
- package/build/fixtures/components/loading-indicator.d.ts +3 -0
- package/build/fixtures/components/paragraph.d.ts +3 -0
- package/build/fixtures/components/review.d.ts +3 -0
- package/build/fixtures/examples/camera-capture.d.ts +3 -0
- package/build/fixtures/examples/index.d.ts +5 -0
- package/build/fixtures/examples/index.js +5 -0
- package/build/fixtures/examples/recipient-update.d.ts +3 -0
- package/build/fixtures/examples/recipient.d.ts +3 -0
- package/build/fixtures/examples/single-file-upload.d.ts +3 -0
- package/build/fixtures/examples/step-validation-errors.d.ts +3 -0
- package/build/fixtures/features/action-response.d.ts +3 -0
- package/build/fixtures/features/external.d.ts +3 -0
- package/build/fixtures/features/index.d.ts +5 -0
- package/build/fixtures/features/index.js +5 -0
- package/build/fixtures/features/persist-async.d.ts +3 -0
- package/build/fixtures/features/polling.d.ts +3 -0
- package/build/fixtures/features/validation-async.d.ts +3 -0
- package/build/fixtures/index.d.ts +46 -0
- package/build/fixtures/index.js +23 -0
- package/build/{jsonSchemaForm/schemas/allOf.json.d.ts → fixtures/jsonSchemaForm/allOf.d.ts} +1 -1
- package/build/{jsonSchemaForm/schemas/audRecipient.json.d.ts → fixtures/jsonSchemaForm/audRecipient.d.ts} +1 -1
- package/build/{jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.d.ts → fixtures/jsonSchemaForm/currency.d.ts} +1 -1
- package/build/{jsonSchemaForm/schemas/blob_MultipleFileUpload.json.d.ts → fixtures/jsonSchemaForm/multipleFileUploadBase64.d.ts} +1 -1
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/oneOf.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/simple.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.d.ts +3 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.d.ts +3 -0
- package/build/{layout/layouts/all.json.d.ts → fixtures/layouts/all.d.ts} +1 -1
- package/build/{layout/layouts/final-step-layout.json.d.ts → fixtures/layouts/final-step-layout.d.ts} +1 -1
- package/build/fixtures/layouts/index.d.ts +6 -0
- package/build/fixtures/layouts/index.js +6 -0
- package/build/{layout/layouts/review.json.d.ts → fixtures/layouts/list.d.ts} +1 -1
- package/build/fixtures/layouts/pay-in.d.ts +3 -0
- package/build/{layout/layouts/list.json.d.ts → fixtures/layouts/review.d.ts} +1 -1
- package/build/fixtures/layouts/success.d.ts +3 -0
- package/build/fixtures/responses/action-response-final.d.ts +3 -0
- package/build/{flow/fixtures → fixtures}/responses/action.d.ts +1 -1
- package/build/fixtures/responses/index.d.ts +4 -0
- package/build/fixtures/responses/index.js +4 -0
- package/build/fixtures/responses/recipient-update-final.d.ts +3 -0
- package/build/fixtures/schemas/basic-form.d.ts +3 -0
- package/build/fixtures/schemas/index.d.ts +4 -0
- package/build/fixtures/schemas/index.js +4 -0
- package/build/fixtures/schemas/number-and-integer.d.ts +3 -0
- package/build/fixtures/schemas/one-of.d.ts +3 -0
- package/build/fixtures/schemas/string-formats.d.ts +3 -0
- package/build/fixtures/utils/image-util.d.ts +2 -0
- package/build/fixtures/utils/image-util.js +18 -0
- package/build/formControl/FormControl.d.ts +2 -2
- package/build/formControl/FormControl.js +4 -4
- package/build/formControl/utils/index.d.ts +1 -0
- package/build/formControl/utils/index.js +1 -0
- package/build/formControl/{value-utils.js → utils/value-utils.js} +2 -2
- package/build/i18n/pl.json +17 -17
- package/build/index.d.ts +9 -8
- package/build/index.js +7 -7
- package/build/jsonSchemaForm/JsonSchemaForm.d.ts +3 -4
- package/build/jsonSchemaForm/JsonSchemaForm.js +1 -3
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -1
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +1 -1
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -1
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +1 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +1 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +1 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +2 -2
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +9 -10
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.d.ts +2 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/{utils.js → utils/upload-utils.js} +2 -3
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/{useFormattedDefaultErrorMessages.js → utils/useFormattedDefaultErrorMessages.js} +2 -2
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -1
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +3 -5
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +1 -1
- package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +2 -2
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +4 -4
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +1 -1
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +3 -3
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +1 -1
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +6 -9
- package/build/jsonSchemaForm/oneOfSchema/{isConstSchema.d.ts → utils/const-schema-utils.d.ts} +1 -1
- package/build/jsonSchemaForm/oneOfSchema/{isConstSchema.js → utils/const-schema-utils.js} +2 -1
- package/build/jsonSchemaForm/oneOfSchema/utils/index.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +2 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.d.ts +5 -0
- package/build/jsonSchemaForm/oneOfSchema/{getActiveSchemaIndex.js → utils/one-of-utils.js} +30 -6
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +1 -1
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +2 -2
- package/build/jsonSchemaForm/persistAsyncSchema/{basic → persistAsyncBasicSchema}/PersistAsyncBasicSchema.d.ts +1 -1
- package/build/jsonSchemaForm/persistAsyncSchema/{basic → persistAsyncBasicSchema}/PersistAsyncBasicSchema.js +6 -9
- package/build/jsonSchemaForm/persistAsyncSchema/{blob → persistAsyncBlobSchema}/PersistAsyncBlobSchema.d.ts +1 -1
- package/build/jsonSchemaForm/persistAsyncSchema/{blob → persistAsyncBlobSchema}/PersistAsyncBlobSchema.js +5 -6
- package/build/jsonSchemaForm/persistAsyncSchema/{blob → persistAsyncBlobSchema}/UploadInputAdapter.d.ts +2 -2
- package/build/jsonSchemaForm/persistAsyncSchema/{blob → persistAsyncBlobSchema}/UploadInputAdapter.js +2 -2
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +1 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +3 -3
- package/build/jsonSchemaForm/promotedOneOfSchema/{PromotedOneOfSchemaModelMatcher.d.ts → promoted-one-of-utils.d.ts} +1 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/{PromotedOneOfSchemaModelMatcher.js → promoted-one-of-utils.js} +1 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/{control → promotedOneOfControl}/PromotedOneOfControl.d.ts +1 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/{control → promotedOneOfControl}/PromotedOneOfControl.js +1 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/{control → promotedOneOfControl}/PromotedOneOfRadioControl.js +1 -1
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +1 -1
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +3 -3
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +2 -2
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +6 -8
- package/build/jsonSchemaForm/schemaFormControl/utils/index.d.ts +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/{optionMapper.d.ts → utils/mapping-utils.d.ts} +1 -1
- package/build/jsonSchemaForm/schemaFormControl/{optionMapper.js → utils/mapping-utils.js} +3 -3
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +2 -2
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +3 -6
- package/build/layout/DynamicLayout.d.ts +2 -2
- package/build/layout/DynamicLayout.js +2 -16
- package/build/layout/alert/{index.d.ts → DynamicAlert.d.ts} +1 -1
- package/build/layout/box/{index.d.ts → DynamicBox.d.ts} +1 -1
- package/build/layout/box/{index.js → DynamicBox.js} +1 -1
- package/build/layout/button/{index.d.ts → DynamicButton.d.ts} +1 -1
- package/build/layout/button/{index.js → DynamicButton.js} +1 -1
- package/build/layout/columns/{index.d.ts → DynamicColumns.d.ts} +1 -1
- package/build/layout/columns/{index.js → DynamicColumns.js} +1 -1
- package/build/layout/decision/{index.d.ts → DynamicDecision.d.ts} +2 -2
- package/build/layout/decision/{index.js → DynamicDecision.js} +1 -1
- package/build/layout/divider/{index.d.ts → DynamicDivider.d.ts} +1 -1
- package/build/layout/external/DynamicExternal.d.ts +4 -3
- package/build/layout/external/DynamicExternal.js +5 -3
- package/build/layout/form/{index.d.ts → DynamicForm.d.ts} +1 -1
- package/build/layout/heading/{index.d.ts → DynamicHeading.d.ts} +1 -1
- package/build/layout/image/{index.d.ts → DynamicImage.d.ts} +1 -1
- package/build/layout/image/{index.js → DynamicImage.js} +2 -2
- package/build/layout/index.d.ts +17 -1
- package/build/layout/index.js +17 -1
- package/build/layout/info/{index.d.ts → DynamicInfo.d.ts} +1 -1
- package/build/layout/list/DynamicList.d.ts +7 -0
- package/build/layout/list/{index.js → DynamicList.js} +3 -2
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.d.ts +6 -0
- package/build/layout/{loading-indicator/index.js → loadingIndicator/DynamicLoadingIndicator.js} +3 -2
- package/build/layout/paragraph/DynamicParagraph.d.ts +3 -3
- package/build/layout/paragraph/DynamicParagraph.js +2 -1
- package/build/layout/review/{index.d.ts → DynamicReview.d.ts} +2 -2
- package/build/layout/utils.d.ts +1 -1
- package/build/step/cameraStep/CameraStep.d.ts +1 -1
- package/build/step/cameraStep/CameraStep.js +3 -3
- package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +2 -2
- package/build/step/cameraStep/cameraCapture/hooks/index.d.ts +1 -1
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +1 -1
- package/build/step/cameraStep/cameraCapture/tracking/index.d.ts +2 -2
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +1 -1
- package/build/step/layoutStep/LayoutStep.d.ts +2 -2
- package/build/step/layoutStep/LayoutStep.js +5 -6
- package/build/step/layoutStep/utils/index.d.ts +2 -0
- package/build/step/layoutStep/utils/index.js +2 -0
- package/build/step/layoutStep/{layoutService/inlineReferences.d.ts → utils/inline-reference-utils.d.ts} +1 -1
- package/build/step/layoutStep/{layoutService/inlineReferences.js → utils/inline-reference-utils.js} +1 -1
- package/build/step/layoutStep/{layoutService/convertStepToLayout.d.ts → utils/layout-utils.d.ts} +1 -1
- package/build/{formControl/types.d.ts → types/common/FormControl.d.ts} +1 -1
- package/build/types/index.d.ts +15 -0
- package/build/types/index.js +13 -0
- package/build/{dynamic-flow-types → types/specification}/FileUploadSchema.js +1 -0
- package/build/{dynamic-flow-types → types/specification}/LayoutComponent.d.ts +1 -1
- package/build/{dynamic-flow-types → types/specification}/Model.js +2 -1
- package/build/{dynamic-flow-types → types/specification}/Schema.js +1 -0
- package/build/{dynamic-flow-types → types/specification}/Step.d.ts +1 -1
- package/build/{dynamic-flow-types → types/specification}/Step.js +1 -1
- package/package.json +26 -31
- package/build/common/contexts/events/index.d.ts +0 -1
- package/build/common/contexts/events/index.js +0 -1
- package/build/common/contexts/fetcherContext/index.d.ts +0 -2
- package/build/common/contexts/fetcherContext/index.js +0 -2
- package/build/common/hooks/useDebouncedFunction.d.ts +0 -2
- package/build/common/hooks/useDebouncedFunction.js +0 -9
- package/build/common/hooks/usePrevious.d.ts +0 -2
- package/build/common/index.d.ts +0 -4
- package/build/common/index.js +0 -4
- package/build/common/schemaTypes/shouldDebounceSchema.d.ts +0 -2
- package/build/common/schemaTypes/shouldDebounceSchema.js +0 -6
- package/build/dynamic-flow-types/index.d.ts +0 -14
- package/build/dynamic-flow-types/index.js +0 -12
- package/build/flow/errorBoundary/index.d.ts +0 -1
- package/build/flow/errorBoundary/index.js +0 -1
- package/build/flow/fixtures/components/alert.d.ts +0 -3
- package/build/flow/fixtures/components/box.d.ts +0 -3
- package/build/flow/fixtures/components/button.d.ts +0 -3
- package/build/flow/fixtures/components/columns.d.ts +0 -3
- package/build/flow/fixtures/components/copyable.d.ts +0 -3
- package/build/flow/fixtures/components/decision.d.ts +0 -3
- package/build/flow/fixtures/components/heading.d.ts +0 -3
- package/build/flow/fixtures/components/image.d.ts +0 -4
- package/build/flow/fixtures/components/info.d.ts +0 -3
- package/build/flow/fixtures/components/list.d.ts +0 -3
- package/build/flow/fixtures/components/loading-indicator.d.ts +0 -3
- package/build/flow/fixtures/components/paragraph.d.ts +0 -3
- package/build/flow/fixtures/components/review.d.ts +0 -3
- package/build/flow/fixtures/examples/camera-capture.d.ts +0 -3
- package/build/flow/fixtures/examples/recipient-update.d.ts +0 -3
- package/build/flow/fixtures/examples/recipient.d.ts +0 -3
- package/build/flow/fixtures/examples/single-file-upload.d.ts +0 -3
- package/build/flow/fixtures/examples/step-validation-errors.d.ts +0 -3
- package/build/flow/fixtures/features/action-response.d.ts +0 -3
- package/build/flow/fixtures/features/external.d.ts +0 -3
- package/build/flow/fixtures/features/persist-async.d.ts +0 -3
- package/build/flow/fixtures/features/polling.d.ts +0 -3
- package/build/flow/fixtures/features/validation-async.d.ts +0 -3
- package/build/flow/fixtures/index.d.ts +0 -48
- package/build/flow/fixtures/index.js +0 -73
- package/build/flow/fixtures/responses/action-response-final.d.ts +0 -3
- package/build/flow/fixtures/responses/recipient-update-final.d.ts +0 -3
- package/build/flow/fixtures/schemas/basic-form.d.ts +0 -3
- package/build/flow/fixtures/schemas/number-and-integer.d.ts +0 -3
- package/build/flow/fixtures/schemas/one-of.d.ts +0 -3
- package/build/flow/fixtures/schemas/string-formats.d.ts +0 -3
- package/build/flow/stories/fixtureFetcher.d.ts +0 -2
- package/build/flow/useDebouncedRefresh/index.d.ts +0 -1
- package/build/flow/useDebouncedRefresh/index.js +0 -1
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.d.ts +0 -3
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.d.ts +0 -2
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.js +0 -27
- package/build/jsonSchemaForm/schemas/currency.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/oneOf.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/simple.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/validationAsync.json.d.ts +0 -3
- package/build/layout/external/index.d.ts +0 -1
- package/build/layout/external/index.js +0 -1
- package/build/layout/external/useExternalStepPolling.d.ts +0 -11
- package/build/layout/layouts/finalStep.json.d.ts +0 -3
- package/build/layout/layouts/finalStep.json.js +0 -24
- package/build/layout/layouts/pay-in.json.d.ts +0 -3
- package/build/layout/layouts/success.json.d.ts +0 -3
- package/build/layout/list/index.d.ts +0 -7
- package/build/layout/loading-indicator/index.d.ts +0 -6
- package/build/layout/paragraph/index.d.ts +0 -1
- package/build/layout/paragraph/index.js +0 -1
- package/build/schema.d.ts +0 -1
- package/build/schema.js +0 -1
- package/build/step/features/index.d.ts +0 -2
- package/build/step/features/index.js +0 -2
- package/build/step/layoutStep/layoutService/index.d.ts +0 -2
- package/build/step/layoutStep/layoutService/index.js +0 -2
- /package/build/common/{propsValues/dateMode.d.ts → constants/DateMode.d.ts} +0 -0
- /package/build/common/{propsValues/dateMode.js → constants/DateMode.js} +0 -0
- /package/build/common/{propsValues/formControlType.d.ts → constants/FormControlType.d.ts} +0 -0
- /package/build/common/{propsValues/formControlType.js → constants/FormControlType.js} +0 -0
- /package/build/common/{propsValues/monthFormat.d.ts → constants/MonthFormat.d.ts} +0 -0
- /package/build/common/{propsValues/monthFormat.js → constants/MonthFormat.js} +0 -0
- /package/build/common/{propsValues/size.d.ts → constants/Size.d.ts} +0 -0
- /package/build/common/{propsValues/size.js → constants/Size.js} +0 -0
- /package/build/common/contexts/{dynamicFlowContext/dynamicFlowContext.d.ts → dynamicFlowContexts/DynamicFlowContexts.d.ts} +0 -0
- /package/build/common/contexts/{dynamicFlowContext/dynamicFlowContext.js → dynamicFlowContexts/DynamicFlowContexts.js} +0 -0
- /package/build/common/contexts/{dynamicFlowContext → dynamicFlowContexts}/usePendingPromiseCounter.d.ts +0 -0
- /package/build/common/contexts/{dynamicFlowContext → dynamicFlowContexts}/usePendingPromiseCounter.js +0 -0
- /package/build/common/contexts/{events → eventsContext}/EventsContext.d.ts +0 -0
- /package/build/common/contexts/{events → eventsContext}/EventsContext.js +0 -0
- /package/build/common/contexts/{fetcherContext/fetcherContext.d.ts → fetcherContexts/FetcherContexts.d.ts} +0 -0
- /package/build/common/{logging/index.d.ts → contexts/logContext/LogContext.d.ts} +0 -0
- /package/build/common/{logging/index.js → contexts/logContext/LogContext.js} +0 -0
- /package/build/{step/features/external → common/hooks/useExternal}/useExternal.d.ts +0 -0
- /package/build/{step/features/external → common/hooks/useExternal}/useExternal.js +0 -0
- /package/build/common/hooks/{usePolling.d.ts → usePolling/usePolling.d.ts} +0 -0
- /package/build/common/hooks/{usePolling.js → usePolling/usePolling.js} +0 -0
- /package/build/common/{contexts/fetcherContext → makeFetcher}/makeFetcher.d.ts +0 -0
- /package/build/common/{api/utils.d.ts → utils/api-utils.d.ts} +0 -0
- /package/build/common/{api/utils.js → utils/api-utils.js} +0 -0
- /package/build/common/{general/index.d.ts → utils/date-utils.d.ts} +0 -0
- /package/build/common/utils/{generate-random-id.d.ts → id-utils.d.ts} +0 -0
- /package/build/common/utils/{generate-random-id.js → id-utils.js} +0 -0
- /package/build/common/{validation/rule-validators/index.d.ts → validators/validationFailures/validation-failures.utils.d.ts} +0 -0
- /package/build/{flow → dynamicFlow}/index.d.ts +0 -0
- /package/build/{flow → dynamicFlow}/index.js +0 -0
- /package/build/{flow → dynamicFlow}/stories/DynamicFlow.story.d.ts +0 -0
- /package/build/{flow → dynamicFlow}/stories/EditableDynamicFlow.d.ts +0 -0
- /package/build/{flow → dynamicFlow/utils}/errorBoundary/ErrorBoundary.d.ts +0 -0
- /package/build/{flow → dynamicFlow/utils}/errorBoundary/ErrorBoundary.js +0 -0
- /package/build/{flow → dynamicFlow/utils}/errorBoundary/ErrorBoundary.messages.d.ts +0 -0
- /package/build/{flow → dynamicFlow/utils}/errorBoundary/ErrorBoundary.messages.js +0 -0
- /package/build/{flow → dynamicFlow/utils}/errorBoundary/ErrorBoundaryAlert.d.ts +0 -0
- /package/build/{flow → dynamicFlow/utils}/errorBoundary/ErrorBoundaryAlert.js +0 -0
- /package/build/{flow → dynamicFlow/utils}/useLoader.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/alert.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/box.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/button.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/columns.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/copyable.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/decision.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/heading.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/info.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/list.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/loading-indicator.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/paragraph.js +0 -0
- /package/build/{flow/fixtures → fixtures}/components/review.js +0 -0
- /package/build/{flow/fixtures → fixtures}/examples/camera-capture.js +0 -0
- /package/build/{flow/fixtures → fixtures}/examples/recipient-update.js +0 -0
- /package/build/{flow/fixtures → fixtures}/examples/recipient.js +0 -0
- /package/build/{flow/fixtures → fixtures}/examples/single-file-upload.js +0 -0
- /package/build/{flow/fixtures → fixtures}/examples/step-validation-errors.js +0 -0
- /package/build/{flow/fixtures → fixtures}/features/action-response.js +0 -0
- /package/build/{flow/fixtures → fixtures}/features/external.js +0 -0
- /package/build/{flow/fixtures → fixtures}/features/persist-async.js +0 -0
- /package/build/{flow/fixtures → fixtures}/features/polling.js +0 -0
- /package/build/{flow/fixtures → fixtures}/features/validation-async.js +0 -0
- /package/build/{jsonSchemaForm/schemas/allOf.json.js → fixtures/jsonSchemaForm/allOf.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/audRecipient.json.js → fixtures/jsonSchemaForm/audRecipient.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/currency.json.js → fixtures/jsonSchemaForm/currency.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.js → fixtures/jsonSchemaForm/multipleFileUploadBase64.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/blob_MultipleFileUpload.json.js → fixtures/jsonSchemaForm/multipleFileUploadBlob.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/oneOf.json.js → fixtures/jsonSchemaForm/oneOf.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/oneOfTabs.json.js → fixtures/jsonSchemaForm/oneOfTabs.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/promotedOneOf.json.js → fixtures/jsonSchemaForm/promotedOneOf.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/promotedOneOfCheckbox.json.js → fixtures/jsonSchemaForm/promotedOneOfCheckbox.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/simple.json.js → fixtures/jsonSchemaForm/simple.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/uploadPersistAsync.json.js → fixtures/jsonSchemaForm/uploadPersistAsync.js} +0 -0
- /package/build/{jsonSchemaForm/schemas/validationAsync.json.js → fixtures/jsonSchemaForm/validationAsync.js} +0 -0
- /package/build/{layout/layouts/all.json.js → fixtures/layouts/all.js} +0 -0
- /package/build/{layout/layouts/final-step-layout.json.js → fixtures/layouts/final-step-layout.js} +0 -0
- /package/build/{layout/layouts/list.json.js → fixtures/layouts/list.js} +0 -0
- /package/build/{layout/layouts/pay-in.json.js → fixtures/layouts/pay-in.js} +0 -0
- /package/build/{layout/layouts/review.json.js → fixtures/layouts/review.js} +0 -0
- /package/build/{layout/layouts/success.json.js → fixtures/layouts/success.js} +0 -0
- /package/build/{flow/fixtures → fixtures}/responses/action-response-final.js +0 -0
- /package/build/{flow/fixtures → fixtures}/responses/action.js +0 -0
- /package/build/{flow/fixtures → fixtures}/responses/exit.d.ts +0 -0
- /package/build/{flow/fixtures → fixtures}/responses/exit.js +0 -0
- /package/build/{flow/fixtures → fixtures}/responses/recipient-update-final.js +0 -0
- /package/build/{flow/fixtures → fixtures}/schemas/basic-form.js +0 -0
- /package/build/{flow/fixtures → fixtures}/schemas/number-and-integer.js +0 -0
- /package/build/{flow/fixtures → fixtures}/schemas/one-of.js +0 -0
- /package/build/{flow/fixtures → fixtures}/schemas/string-formats.js +0 -0
- /package/build/formControl/{value-utils.d.ts → utils/value-utils.d.ts} +0 -0
- /package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/{utils.d.ts → utils/upload-utils.d.ts} +0 -0
- /package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/{useFormattedDefaultErrorMessages.d.ts → utils/useFormattedDefaultErrorMessages.d.ts} +0 -0
- /package/build/jsonSchemaForm/persistAsyncSchema/{basic → persistAsyncBasicSchema}/index.d.ts +0 -0
- /package/build/jsonSchemaForm/persistAsyncSchema/{basic → persistAsyncBasicSchema}/index.js +0 -0
- /package/build/jsonSchemaForm/persistAsyncSchema/{blob → persistAsyncBlobSchema}/index.d.ts +0 -0
- /package/build/jsonSchemaForm/persistAsyncSchema/{blob → persistAsyncBlobSchema}/index.js +0 -0
- /package/build/jsonSchemaForm/promotedOneOfSchema/{control → promotedOneOfControl}/PromotedOneOfCheckboxControl.d.ts +0 -0
- /package/build/jsonSchemaForm/promotedOneOfSchema/{control → promotedOneOfControl}/PromotedOneOfCheckboxControl.js +0 -0
- /package/build/jsonSchemaForm/promotedOneOfSchema/{control → promotedOneOfControl}/PromotedOneOfRadioControl.d.ts +0 -0
- /package/build/jsonSchemaForm/schemaFormControl/{availableCurrencyFlags.d.ts → utils/currency-utils.d.ts} +0 -0
- /package/build/jsonSchemaForm/schemaFormControl/{availableCurrencyFlags.js → utils/currency-utils.js} +0 -0
- /package/build/layout/alert/{index.js → DynamicAlert.js} +0 -0
- /package/build/layout/divider/{index.js → DynamicDivider.js} +0 -0
- /package/build/layout/form/{index.js → DynamicForm.js} +0 -0
- /package/build/layout/heading/{index.js → DynamicHeading.js} +0 -0
- /package/build/layout/icon/{index.d.ts → DynamicIcon.d.ts} +0 -0
- /package/build/layout/icon/{index.js → DynamicIcon.js} +0 -0
- /package/build/layout/info/{index.js → DynamicInfo.js} +0 -0
- /package/build/layout/review/{index.js → DynamicReview.js} +0 -0
- /package/build/step/layoutStep/{layoutService/convertStepToLayout.js → utils/layout-utils.js} +0 -0
- /package/build/{dynamic-flow-types/Action.js → types/common/FormControl.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/Action.d.ts +0 -0
- /package/build/{dynamic-flow-types/LayoutComponent.js → types/specification/Action.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/FileUploadSchema.d.ts +0 -0
- /package/build/{dynamic-flow-types/PersistAsync.js → types/specification/LayoutComponent.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/Model.d.ts +0 -0
- /package/build/{dynamic-flow-types → types/specification}/PersistAsync.d.ts +0 -0
- /package/build/{dynamic-flow-types/Polling.js → types/specification/PersistAsync.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/Polling.d.ts +0 -0
- /package/build/{dynamic-flow-types/Promotion.js → types/specification/Polling.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/Promotion.d.ts +0 -0
- /package/build/{dynamic-flow-types/ValidationAsync.js → types/specification/Promotion.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/Schema.d.ts +0 -0
- /package/build/{dynamic-flow-types → types/specification}/ValidationAsync.d.ts +0 -0
- /package/build/{dynamic-flow-types/core.js → types/specification/ValidationAsync.js} +0 -0
- /package/build/{dynamic-flow-types → types/specification}/core.d.ts +0 -0
- /package/build/{formControl/types.js → types/specification/core.js} +0 -0
package/README.md
CHANGED
|
@@ -24,15 +24,15 @@ pnpm install @wise/dynamic-flow-client
|
|
|
24
24
|
```
|
|
25
25
|
# yarn
|
|
26
26
|
yarn add react react-dom react-intl
|
|
27
|
-
yarn add @transferwise/components @transferwise/formatting @transferwise/icons @transferwise/neptune-css
|
|
27
|
+
yarn add @transferwise/components @transferwise/formatting @transferwise/icons @transferwise/neptune-css
|
|
28
28
|
|
|
29
29
|
# npm
|
|
30
30
|
npm install react react-dom react-intl
|
|
31
|
-
npm install @transferwise/components @transferwise/formatting @transferwise/icons @transferwise/neptune-css
|
|
31
|
+
npm install @transferwise/components @transferwise/formatting @transferwise/icons @transferwise/neptune-css
|
|
32
32
|
|
|
33
33
|
# pnpm
|
|
34
34
|
pnpm install react react-dom react-intl
|
|
35
|
-
pnpm install @transferwise/components @transferwise/formatting @transferwise/icons @transferwise/neptune-css
|
|
35
|
+
pnpm install @transferwise/components @transferwise/formatting @transferwise/icons @transferwise/neptune-css
|
|
36
36
|
```
|
|
37
37
|
**Note:** Keep in mind that some of these dependencies have their own peer dependencies. Don't forget to install those, for instance: `@transferwise/components` needs `@wise/art` and `@wise/components-theming`.
|
|
38
38
|
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { createContext, useContext, useMemo } from 'react';
|
|
14
|
-
import { makeFetcher } from '
|
|
14
|
+
import { makeFetcher } from '../../makeFetcher';
|
|
15
15
|
var FetcherContext = createContext(undefined);
|
|
16
16
|
export var FetcherProvider = function (_a) {
|
|
17
17
|
var fetcher = _a.fetcher, children = _a.children;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './useDebouncedFunction/useDebouncedFunction';
|
|
2
|
+
export * from './useExternal/useExternal';
|
|
3
|
+
export * from './useExternalStepPolling/useExternalStepPolling';
|
|
4
|
+
export * from './usePersistAsync/usePersistAsync';
|
|
5
|
+
export * from './usePolling/usePolling';
|
|
6
|
+
export * from './usePrevious/usePrevious';
|
|
7
|
+
export * from './useStepPolling/useStepPolling';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './useDebouncedFunction/useDebouncedFunction';
|
|
2
|
+
export * from './useExternal/useExternal';
|
|
3
|
+
export * from './useExternalStepPolling/useExternalStepPolling';
|
|
4
|
+
export * from './usePersistAsync/usePersistAsync';
|
|
5
|
+
export * from './usePolling/usePolling';
|
|
6
|
+
export * from './usePrevious/usePrevious';
|
|
7
|
+
export * from './useStepPolling/useStepPolling';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* References:
|
|
2
|
+
- https://github.com/gnbaron/use-lodash-debounce
|
|
3
|
+
- https://dmitripavlutin.com/react-throttle-debounce/
|
|
4
|
+
*/
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { debounce } from '../../utils';
|
|
7
|
+
export function useDebouncedFunction(callback, waitMs) {
|
|
8
|
+
return useCallback(debounce(callback, waitMs), [callback, waitMs]);
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action, PollingConfiguration } from '../../../types';
|
|
2
|
+
export type ExternalStepPollingConfiguration = PollingConfiguration & {
|
|
3
|
+
maxConsecutiveFails: number;
|
|
4
|
+
responseHandlers: ResponseHandler[];
|
|
5
|
+
};
|
|
6
|
+
type ResponseHandler = {
|
|
7
|
+
result: string;
|
|
8
|
+
action: Action;
|
|
9
|
+
};
|
|
10
|
+
/** @deprecated External step is no longer supported */
|
|
11
|
+
export declare function useExternalStepPolling(polling: ExternalStepPollingConfiguration | undefined, onAction: (action: Action) => void): void;
|
|
12
|
+
export {};
|
package/build/{layout/external → common/hooks/useExternalStepPolling}/useExternalStepPolling.js
RENAMED
|
@@ -10,9 +10,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { useCallback, useMemo } from 'react';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
13
|
+
import { usePolling } from '..';
|
|
14
|
+
import { useFetcher } from '../../contexts';
|
|
15
|
+
/** @deprecated External step is no longer supported */
|
|
16
|
+
export function useExternalStepPolling(polling, onAction) {
|
|
16
17
|
var fetcher = useFetcher();
|
|
17
18
|
var asyncFn = useMemo(function () {
|
|
18
19
|
if (polling) {
|
|
@@ -45,14 +45,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
import { isNull, isObject, isNumber, isString } from '@transferwise/neptune-validation';
|
|
49
48
|
import { useState } from 'react';
|
|
50
49
|
import { useIntl } from 'react-intl';
|
|
51
|
-
import {
|
|
52
|
-
import messages from '
|
|
53
|
-
import { getErrorFromResponse } from '
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
50
|
+
import { isNull, isObject, isNumber, isString } from '../../../common/validators';
|
|
51
|
+
import messages from '../../../jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages';
|
|
52
|
+
import { getErrorFromResponse } from '../../../jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema'; // FIXME: extract these functions form that schema component to either here or their own module
|
|
53
|
+
import { isBlobSchema } from '../../../types';
|
|
54
|
+
import { useFetcher } from '../../contexts';
|
|
55
|
+
import { isValidSchema } from '../../validators';
|
|
56
56
|
export var usePersistAsync = function (persistAsync) {
|
|
57
57
|
var _a = useState(null), abortController = _a[0], setAbortController = _a[1];
|
|
58
58
|
var fetcher = useFetcher();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function usePrevious(value: any): undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
-
var usePrevious = function (value) {
|
|
2
|
+
export var usePrevious = function (value) {
|
|
3
3
|
var reference = useRef();
|
|
4
4
|
useEffect(function () {
|
|
5
5
|
reference.current = value;
|
|
6
6
|
}, [value]);
|
|
7
7
|
return reference.current;
|
|
8
8
|
};
|
|
9
|
-
export default usePrevious;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Action, PollingConfiguration } from '../../../
|
|
1
|
+
import { Action, PollingConfiguration } from '../../../types';
|
|
2
2
|
export declare function useStepPolling(polling: PollingConfiguration | undefined, onAction: (action: Action) => void): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { usePolling } from '..';
|
|
3
|
+
import { useFetcher } from '../../contexts';
|
|
4
4
|
export function useStepPolling(polling, onAction) {
|
|
5
5
|
var fetcher = useFetcher();
|
|
6
6
|
var asyncFn = useMemo(function () {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './makeFetcher';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './makeFetcher';
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { isRelativePath } from '
|
|
12
|
+
import { isRelativePath } from '../utils/api-utils';
|
|
13
13
|
export var makeFetcher = function (baseUrl, additionalHeaders) {
|
|
14
14
|
return function (input, init) {
|
|
15
15
|
var resource = applyBaseUrl(input, baseUrl || '');
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export var debounce = function (callback, waitMs) {
|
|
2
|
+
var timeoutId;
|
|
3
|
+
var lastArgs;
|
|
4
|
+
var clearTimer = function () {
|
|
5
|
+
if (timeoutId) {
|
|
6
|
+
clearTimeout(timeoutId);
|
|
7
|
+
timeoutId = null;
|
|
8
|
+
}
|
|
9
|
+
lastArgs = null;
|
|
10
|
+
};
|
|
11
|
+
var debouncedFn = function () {
|
|
12
|
+
var args = [];
|
|
13
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14
|
+
args[_i] = arguments[_i];
|
|
15
|
+
}
|
|
16
|
+
lastArgs = args;
|
|
17
|
+
if (timeoutId !== null) {
|
|
18
|
+
clearTimeout(timeoutId);
|
|
19
|
+
}
|
|
20
|
+
timeoutId = setTimeout(function () {
|
|
21
|
+
callback.apply(void 0, lastArgs);
|
|
22
|
+
timeoutId = null;
|
|
23
|
+
lastArgs = null;
|
|
24
|
+
}, waitMs);
|
|
25
|
+
};
|
|
26
|
+
debouncedFn.cancel = function () {
|
|
27
|
+
if (timeoutId !== null) {
|
|
28
|
+
clearTimer();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
debouncedFn.flush = function () {
|
|
32
|
+
if (timeoutId !== null) {
|
|
33
|
+
callback.apply(void 0, lastArgs);
|
|
34
|
+
clearTimer();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return debouncedFn;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEqual: (a: unknown, b: unknown) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var isEqual = function (a, b) {
|
|
2
|
+
if (a === b) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
6
|
+
return a.length === b.length && a.every(function (item, index) { return isEqual(item, b[index]); });
|
|
7
|
+
}
|
|
8
|
+
if (isNonNullObject(a) && isNonNullObject(b) && isObjectEquals(a, b)) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
};
|
|
13
|
+
var isObjectEquals = function (a, b) {
|
|
14
|
+
var keysA = Object.keys(a);
|
|
15
|
+
var keysB = Object.keys(b);
|
|
16
|
+
return (keysA.length === keysB.length &&
|
|
17
|
+
keysA.every(function (key) { return Object.prototype.hasOwnProperty.call(b, key) && isEqual(a[key], b[key]); }));
|
|
18
|
+
};
|
|
19
|
+
var isNonNullObject = function (a) {
|
|
20
|
+
return typeof a === 'object' && a !== null;
|
|
21
|
+
};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { Schema, isAllOfSchema as isAllOfSchemaDF, isOneOfSchema as isOneOfSchemaDF } from '../../
|
|
2
|
-
export declare const schemaType: {
|
|
3
|
-
READ_ONLY: string;
|
|
4
|
-
PERSIST_ASYNC: string;
|
|
5
|
-
VALIDATION_ASYNC: string;
|
|
6
|
-
OBJECT: string;
|
|
7
|
-
PROMOTED_ONE_OF: string;
|
|
8
|
-
ONE_OF: string;
|
|
9
|
-
ALL_OF: string;
|
|
10
|
-
BASIC: string;
|
|
11
|
-
ARRAY: string;
|
|
12
|
-
};
|
|
1
|
+
import { Schema, isAllOfSchema as isAllOfSchemaDF, isOneOfSchema as isOneOfSchemaDF } from '../../types';
|
|
13
2
|
export declare const isReadOnlySchema: (schema: Schema) => boolean;
|
|
14
3
|
export declare const isPromotedOneOfSchema: (schema: Schema) => boolean;
|
|
15
4
|
/**
|
|
@@ -21,3 +10,4 @@ export declare const isOneOfSchema: typeof isOneOfSchemaDF;
|
|
|
21
10
|
*/
|
|
22
11
|
export declare const isAllOfSchema: typeof isAllOfSchemaDF;
|
|
23
12
|
export declare const getSchemaType: (schema: Schema) => string | null;
|
|
13
|
+
export declare function shouldDebounceSchema(schema: Schema): boolean;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import { isAllOfSchema as isAllOfSchemaDF, isOneOfSchema as isOneOfSchemaDF, isObjectSchema, isArraySchema, isPersistAsyncSchema, isValidationAsyncSchema, isBasicSchema, } from '../../
|
|
2
|
-
|
|
3
|
-
READ_ONLY: 'readOnly',
|
|
4
|
-
PERSIST_ASYNC: 'persistAsync',
|
|
5
|
-
VALIDATION_ASYNC: 'validationAsync',
|
|
6
|
-
OBJECT: 'object',
|
|
7
|
-
PROMOTED_ONE_OF: 'promotedOneOf',
|
|
8
|
-
ONE_OF: 'oneOf',
|
|
9
|
-
ALL_OF: 'allOf',
|
|
10
|
-
BASIC: 'basic',
|
|
11
|
-
ARRAY: 'array'
|
|
12
|
-
};
|
|
1
|
+
import { isAllOfSchema as isAllOfSchemaDF, isOneOfSchema as isOneOfSchemaDF, isObjectSchema, isArraySchema, isPersistAsyncSchema, isValidationAsyncSchema, isBasicSchema, } from '../../types';
|
|
2
|
+
import { SchemaType } from '../constants';
|
|
13
3
|
export var isReadOnlySchema = function (schema) { return !!schema.readOnly && isBasicSchema(schema); };
|
|
14
4
|
export var isPromotedOneOfSchema = function (schema) { return !!schema.oneOf && !!schema.promotion; };
|
|
15
5
|
/**
|
|
@@ -23,31 +13,36 @@ export var isAllOfSchema = isAllOfSchemaDF;
|
|
|
23
13
|
export var getSchemaType = function (schema) {
|
|
24
14
|
// Order of application is important here
|
|
25
15
|
if (isReadOnlySchema(schema)) {
|
|
26
|
-
return
|
|
16
|
+
return SchemaType.READ_ONLY;
|
|
27
17
|
}
|
|
28
18
|
if (isPersistAsyncSchema(schema)) {
|
|
29
|
-
return
|
|
19
|
+
return SchemaType.PERSIST_ASYNC;
|
|
30
20
|
}
|
|
31
21
|
if (isValidationAsyncSchema(schema)) {
|
|
32
|
-
return
|
|
22
|
+
return SchemaType.VALIDATION_ASYNC;
|
|
33
23
|
}
|
|
34
24
|
if (isObjectSchema(schema)) {
|
|
35
|
-
return
|
|
25
|
+
return SchemaType.OBJECT;
|
|
36
26
|
}
|
|
37
27
|
if (isArraySchema(schema)) {
|
|
38
|
-
return
|
|
28
|
+
return SchemaType.ARRAY;
|
|
39
29
|
}
|
|
40
30
|
if (isPromotedOneOfSchema(schema)) {
|
|
41
|
-
return
|
|
31
|
+
return SchemaType.PROMOTED_ONE_OF;
|
|
42
32
|
}
|
|
43
33
|
if (isOneOfSchema(schema)) {
|
|
44
|
-
return
|
|
34
|
+
return SchemaType.ONE_OF;
|
|
45
35
|
}
|
|
46
36
|
if (isAllOfSchema(schema)) {
|
|
47
|
-
return
|
|
37
|
+
return SchemaType.ALL_OF;
|
|
48
38
|
}
|
|
49
39
|
if (isBasicSchema(schema)) {
|
|
50
|
-
return
|
|
40
|
+
return SchemaType.BASIC;
|
|
51
41
|
}
|
|
52
42
|
return null;
|
|
53
43
|
};
|
|
44
|
+
export function shouldDebounceSchema(schema) {
|
|
45
|
+
return (getSchemaType(schema) === SchemaType.BASIC &&
|
|
46
|
+
schema.type !== 'boolean' &&
|
|
47
|
+
schema.format !== 'base64url');
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getValidModelParts, getValidObjectModelParts, getValidBasicModelOrNull, } from './models/model-validators';
|
|
2
|
+
export { isValidSchema } from './schemas/schema-validators';
|
|
3
|
+
export { getValidationFailures, getArrayValidationFailures, } from './validationFailures/validation-failures';
|
|
4
|
+
export * from './types/type-validators';
|
|
5
|
+
export * from './values/value-validators';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getValidModelParts, getValidObjectModelParts, getValidBasicModelOrNull, } from './models/model-validators';
|
|
2
|
+
export { isValidSchema } from './schemas/schema-validators';
|
|
3
|
+
export { getValidationFailures, getArrayValidationFailures, } from './validationFailures/validation-failures';
|
|
4
|
+
export * from './types/type-validators';
|
|
5
|
+
export * from './values/value-validators';
|
package/build/common/{validation/valid-model/index.d.ts → validators/models/model-validators.d.ts}
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BasicModel, Model, ObjectModel, Schema } from '../../../types';
|
|
2
2
|
export declare const getValidModelParts: (model: Model, schema: Schema) => Model;
|
|
3
3
|
export declare function getValidBasicModelOrNull(model: BasicModel | null, schema: Schema): BasicModel | null;
|
|
4
4
|
export declare function getValidObjectModelParts(model: ObjectModel | null, schema: Schema): ObjectModel | null;
|
|
5
|
-
export declare function getValidArrayModelParts(model: ArrayModel, schema: Schema): ArrayModel | null;
|
package/build/common/{validation/valid-model/index.js → validators/models/model-validators.js}
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { cleanArrayModelWithOneOfSchema, cleanBasicModelWithOneOfSchema, cleanModelWithArraySchema, cleanModelWithBooleanSchema, cleanModelWithNumberSchema, cleanModelWithStringSchema, cleanObjectModelWithAllOfSchema, cleanObjectModelWithObjectSchema, cleanObjectModelWithOneOfSchema, } from './utils';
|
|
1
|
+
import { isArrayModel, isArraySchema, isBasicSchema, isObjectModel, isObjectSchema, } from '../../../types';
|
|
2
|
+
import { isOneOfSchema } from '../../../types';
|
|
3
|
+
import { isNull, isUndefined } from '../../validators';
|
|
4
|
+
import { cleanArrayModelWithOneOfSchema, cleanBasicModelWithOneOfSchema, cleanModelWithArraySchema, cleanModelWithBooleanSchema, cleanModelWithNumberSchema, cleanModelWithStringSchema, cleanObjectModelWithAllOfSchema, cleanObjectModelWithObjectSchema, cleanObjectModelWithOneOfSchema, } from './models.utils';
|
|
6
5
|
export var getValidModelParts = function (model, schema) {
|
|
7
6
|
if (isObjectModel(model)) {
|
|
8
7
|
return getValidObjectModelParts(model, schema);
|
|
@@ -53,7 +52,7 @@ export function getValidObjectModelParts(model, schema) {
|
|
|
53
52
|
}
|
|
54
53
|
return isObjectSchema(schema) ? cleanObjectModelWithObjectSchema(model, schema) : null;
|
|
55
54
|
}
|
|
56
|
-
|
|
55
|
+
function getValidArrayModelParts(model, schema) {
|
|
57
56
|
if (isOneOfSchema(schema)) {
|
|
58
57
|
return cleanArrayModelWithOneOfSchema(model, schema);
|
|
59
58
|
}
|
package/build/common/{validation/valid-model/utils.d.ts → validators/models/models.utils.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllOfSchema, ArrayModel, ArraySchema, BasicModel, Model, ObjectModel, ObjectSchema, OneOfSchema } from '../../../
|
|
1
|
+
import { AllOfSchema, ArrayModel, ArraySchema, BasicModel, Model, ObjectModel, ObjectSchema, OneOfSchema } from '../../../types';
|
|
2
2
|
export declare function cleanBasicModelWithOneOfSchema(model: BasicModel, schema: OneOfSchema): BasicModel | null;
|
|
3
3
|
export declare function cleanArrayModelWithOneOfSchema(model: ArrayModel, schema: OneOfSchema): ArrayModel | null;
|
|
4
4
|
export declare function cleanModelWithStringSchema(model: Model): string | null;
|
|
@@ -8,4 +8,3 @@ export declare function cleanModelWithArraySchema(model: Model, schema: ArraySch
|
|
|
8
8
|
export declare function cleanObjectModelWithObjectSchema(model: ObjectModel, schema: ObjectSchema): ObjectModel;
|
|
9
9
|
export declare function cleanObjectModelWithAllOfSchema(model: ObjectModel, schema: AllOfSchema): ObjectModel;
|
|
10
10
|
export declare function cleanObjectModelWithOneOfSchema(model: ObjectModel, schema: OneOfSchema): ObjectModel | null;
|
|
11
|
-
export declare function filterOutNull<T>(array: (T | null)[]): T[];
|
|
@@ -9,9 +9,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { isListArraySchema, isObjectModel, isArraySchema, } from '../../../types';
|
|
13
|
+
import { isArray, isBoolean, isNull, isNumber, isString, isUndefined, } from '../types/type-validators';
|
|
14
|
+
import { isEmpty } from '../values/value-validators';
|
|
15
|
+
import { getValidBasicModelOrNull, getValidModelParts, getValidObjectModelParts, } from './model-validators';
|
|
15
16
|
export function cleanBasicModelWithOneOfSchema(model, schema) {
|
|
16
17
|
return schema.oneOf.some(function (nestedSchema) { return getValidBasicModelOrNull(model, nestedSchema) === model; })
|
|
17
18
|
? model
|
|
@@ -19,7 +20,9 @@ export function cleanBasicModelWithOneOfSchema(model, schema) {
|
|
|
19
20
|
}
|
|
20
21
|
export function cleanArrayModelWithOneOfSchema(model, schema) {
|
|
21
22
|
var _a;
|
|
22
|
-
var validModels =
|
|
23
|
+
var validModels = schema.oneOf
|
|
24
|
+
.map(function (nestedSchema) { return getValidArrayModelOrNull(model, nestedSchema); })
|
|
25
|
+
.filter(function (item) { return item !== null; });
|
|
23
26
|
if (validModels.length === 0) {
|
|
24
27
|
return null;
|
|
25
28
|
}
|
|
@@ -113,6 +116,3 @@ function deepMergeObject(object1, object2) {
|
|
|
113
116
|
return __assign(__assign({}, acc), (_b = {}, _b[property] = object2[property], _b));
|
|
114
117
|
}, __assign({}, object1));
|
|
115
118
|
}
|
|
116
|
-
export function filterOutNull(array) {
|
|
117
|
-
return array.filter(function (item) { return item !== null; });
|
|
118
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getStringValidationFailures, getNumberValidationFailures, getIntegerValidationFailures, getBooleanValidationFailures, getConstValidationFailures, getArrayValidationFailures, getBlobValidationFailures, } from '../validation-failures';
|
|
1
|
+
import { isListArraySchema, } from '../../../types';
|
|
2
|
+
import { isObject, isArray } from '../types/type-validators';
|
|
3
|
+
import { getStringValidationFailures, getNumberValidationFailures, getIntegerValidationFailures, getBooleanValidationFailures, getConstValidationFailures, getArrayValidationFailures, getBlobValidationFailures, } from '../validationFailures/validation-failures';
|
|
4
4
|
function isValidStringSchema(value, schema) {
|
|
5
5
|
return !getStringValidationFailures(value, schema).length;
|
|
6
6
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const isString: (value: unknown) => value is string;
|
|
2
|
+
export declare const isNumber: (value: unknown) => value is number;
|
|
3
|
+
export declare const isInteger: (value: unknown) => value is number;
|
|
4
|
+
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
5
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
6
|
+
export declare const isArray: (value: unknown) => value is unknown[];
|
|
7
|
+
export declare const isNull: (value: unknown) => value is null;
|
|
8
|
+
export declare const isUndefined: (value: unknown) => value is undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var isString = function (value) { return typeof value === 'string'; };
|
|
2
|
+
export var isNumber = function (value) {
|
|
3
|
+
return typeof value === 'number' && !Number.isNaN(value);
|
|
4
|
+
};
|
|
5
|
+
export var isInteger = function (value) {
|
|
6
|
+
return isNumber(value) && Math.floor(value) === value;
|
|
7
|
+
};
|
|
8
|
+
export var isBoolean = function (value) { return typeof value === 'boolean'; };
|
|
9
|
+
export var isObject = function (value) {
|
|
10
|
+
return !isNull(value) && !isUndefined(value) && (value === null || value === void 0 ? void 0 : value.constructor) === Object;
|
|
11
|
+
};
|
|
12
|
+
export var isArray = function (value) { return Array.isArray(value); };
|
|
13
|
+
export var isNull = function (value) { return value === null; };
|
|
14
|
+
export var isUndefined = function (value) { return typeof value === 'undefined'; };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlobSchema, NumberSchema, IntegerSchema, Model, Schema, AllOfSchema, OneOfSchema, StringSchema } from '../../../
|
|
1
|
+
import { BlobSchema, NumberSchema, IntegerSchema, Model, Schema, AllOfSchema, OneOfSchema, StringSchema } from '../../../types';
|
|
2
2
|
declare function getValidationFailures(value: Model, schema: Schema, isRequired: boolean): string[];
|
|
3
3
|
declare function getStringValidationFailures(value: Model, schema: StringSchema, isRequired?: boolean): string[];
|
|
4
4
|
declare function getNumberValidationFailures(value: Model, schema: AllOfSchema | OneOfSchema | NumberSchema | IntegerSchema, isRequired?: boolean): string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { isValidRequired, isValidMinLength, isValidMaxLength, isValidPattern, isValidMaximum, isValidMinimum, isValidMinItems, isValidMaxItems, isValidRequiredArray, } from '
|
|
1
|
+
import { isObjectModel, } from '../../../types';
|
|
2
|
+
import { isStringSchema } from '../../../types/specification/Schema';
|
|
3
|
+
import { isArray, isString, isNumber, isInteger, isBoolean, isNull, } from '../types/type-validators';
|
|
4
|
+
import { isValidRequired, isValidMinLength, isValidMaxLength, isValidPattern, isValidMaximum, isValidMinimum, isValidMinItems, isValidMaxItems, isValidRequiredArray, } from './validation-failures.utils';
|
|
5
5
|
function getValidationFailures(value, schema, isRequired) {
|
|
6
6
|
if (schema["const"]) {
|
|
7
7
|
return getConstValidationFailures(value, schema, isRequired);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArray, isNumber, isString, isUndefined } from '
|
|
1
|
+
import { isArray, isNumber, isString, isUndefined } from '../../validators';
|
|
2
2
|
function isValidRequired(value, isRequired) {
|
|
3
3
|
if (isRequired === void 0) { isRequired = false; }
|
|
4
4
|
return !isRequired || !isUndefined(value);
|