@blueprint-ts/core 4.1.0-beta.2 → 4.1.0-beta.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/dist/bulkRequests/BulkRequestEvent.enum.d.ts +4 -0
- package/dist/bulkRequests/BulkRequestEvent.enum.js +5 -0
- package/dist/bulkRequests/BulkRequestSender.d.ts +31 -0
- package/dist/bulkRequests/BulkRequestSender.js +161 -0
- package/dist/bulkRequests/BulkRequestWrapper.d.ts +15 -0
- package/dist/bulkRequests/BulkRequestWrapper.js +50 -0
- package/dist/bulkRequests/index.d.ts +5 -0
- package/dist/bulkRequests/index.js +5 -0
- package/{src/laravel/pagination/contracts/PaginationResponseBodyContract.ts → dist/laravel/pagination/contracts/PaginationResponseBodyContract.d.ts} +4 -4
- package/dist/laravel/pagination/contracts/PaginationResponseBodyContract.js +1 -0
- package/dist/laravel/pagination/dataDrivers/RequestDriver.d.ts +10 -0
- package/dist/laravel/pagination/dataDrivers/RequestDriver.js +18 -0
- package/dist/laravel/pagination/index.d.ts +4 -0
- package/dist/laravel/pagination/index.js +2 -0
- package/dist/laravel/requests/JsonBaseRequest.d.ts +14 -0
- package/dist/laravel/requests/JsonBaseRequest.js +15 -0
- package/dist/laravel/requests/PaginationJsonBaseRequest.d.ts +8 -0
- package/dist/laravel/requests/PaginationJsonBaseRequest.js +13 -0
- package/dist/laravel/requests/index.d.ts +7 -0
- package/dist/laravel/requests/index.js +5 -0
- package/dist/laravel/requests/responses/JsonResponse.d.ts +5 -0
- package/dist/laravel/requests/responses/JsonResponse.js +6 -0
- package/dist/laravel/requests/responses/PaginationResponse.d.ts +7 -0
- package/dist/laravel/requests/responses/PaginationResponse.js +9 -0
- package/dist/pagination/BasePaginator.d.ts +19 -0
- package/dist/pagination/BasePaginator.js +65 -0
- package/dist/pagination/InfiniteScroller.d.ts +6 -0
- package/dist/pagination/InfiniteScroller.js +17 -0
- package/dist/pagination/PageAwarePaginator.d.ts +32 -0
- package/dist/pagination/PageAwarePaginator.js +86 -0
- package/dist/pagination/StatePaginator.d.ts +25 -0
- package/dist/pagination/StatePaginator.js +55 -0
- package/dist/pagination/contracts/BaseViewDriverContract.d.ts +6 -0
- package/dist/pagination/contracts/BaseViewDriverContract.js +1 -0
- package/{src/pagination/contracts/BaseViewDriverFactoryContract.ts → dist/pagination/contracts/BaseViewDriverFactoryContract.d.ts} +2 -3
- package/dist/pagination/contracts/BaseViewDriverFactoryContract.js +1 -0
- package/dist/pagination/contracts/PaginateableRequestContract.d.ts +4 -0
- package/dist/pagination/contracts/PaginateableRequestContract.js +1 -0
- package/dist/pagination/contracts/PaginationDataDriverContract.d.ts +4 -0
- package/dist/pagination/contracts/PaginationDataDriverContract.js +1 -0
- package/{src/pagination/contracts/PaginationResponseContract.ts → dist/pagination/contracts/PaginationResponseContract.d.ts} +3 -5
- package/dist/pagination/contracts/PaginationResponseContract.js +1 -0
- package/{src/pagination/contracts/PaginatorLoadDataOptions.ts → dist/pagination/contracts/PaginatorLoadDataOptions.d.ts} +2 -2
- package/dist/pagination/contracts/PaginatorLoadDataOptions.js +1 -0
- package/{src/pagination/contracts/StatePaginationDataDriverContract.ts → dist/pagination/contracts/StatePaginationDataDriverContract.d.ts} +2 -3
- package/dist/pagination/contracts/StatePaginationDataDriverContract.js +1 -0
- package/dist/pagination/contracts/ViewDriverContract.d.ts +9 -0
- package/dist/pagination/contracts/ViewDriverContract.js +1 -0
- package/dist/pagination/contracts/ViewDriverFactoryContract.d.ts +4 -0
- package/dist/pagination/contracts/ViewDriverFactoryContract.js +1 -0
- package/dist/pagination/dataDrivers/ArrayDriver.d.ts +9 -0
- package/dist/pagination/dataDrivers/ArrayDriver.js +20 -0
- package/dist/pagination/dtos/PaginationDataDto.d.ts +7 -0
- package/dist/pagination/dtos/PaginationDataDto.js +12 -0
- package/dist/pagination/dtos/StatePaginationDataDto.d.ts +7 -0
- package/dist/pagination/dtos/StatePaginationDataDto.js +13 -0
- package/dist/pagination/factories/VueBaseViewDriverFactory.d.ts +5 -0
- package/dist/pagination/factories/VueBaseViewDriverFactory.js +6 -0
- package/dist/pagination/factories/VuePaginationDriverFactory.d.ts +5 -0
- package/dist/pagination/factories/VuePaginationDriverFactory.js +6 -0
- package/dist/pagination/frontendDrivers/VueBaseViewDriver.d.ts +11 -0
- package/dist/pagination/frontendDrivers/VueBaseViewDriver.js +19 -0
- package/dist/pagination/frontendDrivers/VuePaginationDriver.d.ts +21 -0
- package/dist/pagination/frontendDrivers/VuePaginationDriver.js +41 -0
- package/dist/pagination/index.d.ts +22 -0
- package/dist/pagination/index.js +13 -0
- package/dist/persistenceDrivers/LocalStorageDriver.d.ts +9 -0
- package/dist/persistenceDrivers/LocalStorageDriver.js +18 -0
- package/dist/persistenceDrivers/NonPersistentDriver.d.ts +7 -0
- package/dist/persistenceDrivers/NonPersistentDriver.js +8 -0
- package/dist/persistenceDrivers/SessionStorageDriver.d.ts +9 -0
- package/dist/persistenceDrivers/SessionStorageDriver.js +18 -0
- package/dist/persistenceDrivers/index.d.ts +6 -0
- package/dist/persistenceDrivers/index.js +4 -0
- package/dist/persistenceDrivers/types/PersistenceDriver.d.ts +5 -0
- package/dist/persistenceDrivers/types/PersistenceDriver.js +1 -0
- package/dist/requests/BaseRequest.d.ts +62 -0
- package/dist/requests/BaseRequest.js +224 -0
- package/dist/requests/ErrorHandler.d.ts +11 -0
- package/dist/requests/ErrorHandler.js +127 -0
- package/dist/requests/RequestConcurrencyMode.enum.d.ts +6 -0
- package/dist/requests/RequestConcurrencyMode.enum.js +7 -0
- package/dist/requests/RequestErrorRouter.d.ts +38 -0
- package/dist/requests/RequestErrorRouter.js +38 -0
- package/dist/requests/RequestEvents.enum.d.ts +4 -0
- package/dist/requests/RequestEvents.enum.js +5 -0
- package/dist/requests/RequestMethod.enum.d.ts +8 -0
- package/dist/requests/RequestMethod.enum.js +9 -0
- package/dist/requests/bodies/BinaryBody.d.ts +10 -0
- package/dist/requests/bodies/BinaryBody.js +22 -0
- package/dist/requests/bodies/FormDataBody.d.ts +14 -0
- package/dist/requests/bodies/FormDataBody.js +60 -0
- package/dist/requests/bodies/JsonBody.d.ts +8 -0
- package/dist/requests/bodies/JsonBody.js +13 -0
- package/{src/requests/contracts/AbortableRequestContract.ts → dist/requests/contracts/AbortableRequestContract.d.ts} +1 -1
- package/dist/requests/contracts/AbortableRequestContract.js +1 -0
- package/dist/requests/contracts/BaseRequestContract.d.ts +23 -0
- package/dist/requests/contracts/BaseRequestContract.js +1 -0
- package/dist/requests/contracts/BodyContract.d.ts +6 -0
- package/dist/requests/contracts/BodyContract.js +1 -0
- package/dist/requests/contracts/BodyFactoryContract.d.ts +4 -0
- package/dist/requests/contracts/BodyFactoryContract.js +1 -0
- package/dist/requests/contracts/DriverConfigContract.d.ts +8 -0
- package/dist/requests/contracts/DriverConfigContract.js +1 -0
- package/dist/requests/contracts/HeadersContract.d.ts +7 -0
- package/dist/requests/contracts/HeadersContract.js +1 -0
- package/dist/requests/contracts/RequestDriverContract.d.ts +8 -0
- package/dist/requests/contracts/RequestDriverContract.js +1 -0
- package/dist/requests/contracts/RequestLoaderContract.d.ts +4 -0
- package/dist/requests/contracts/RequestLoaderContract.js +1 -0
- package/{src/requests/contracts/RequestLoaderFactoryContract.ts → dist/requests/contracts/RequestLoaderFactoryContract.d.ts} +2 -3
- package/dist/requests/contracts/RequestLoaderFactoryContract.js +1 -0
- package/dist/requests/contracts/ResponseContract.d.ts +5 -0
- package/dist/requests/contracts/ResponseContract.js +1 -0
- package/dist/requests/drivers/contracts/ResponseHandlerContract.d.ts +9 -0
- package/dist/requests/drivers/contracts/ResponseHandlerContract.js +1 -0
- package/dist/requests/drivers/fetch/FetchDriver.d.ts +26 -0
- package/dist/requests/drivers/fetch/FetchDriver.js +73 -0
- package/dist/requests/drivers/fetch/FetchResponse.d.ts +12 -0
- package/dist/requests/drivers/fetch/FetchResponse.js +38 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestDriver.d.ts +13 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestDriver.js +107 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestResponse.d.ts +17 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestResponse.js +84 -0
- package/dist/requests/exceptions/BadGatewayException.d.ts +3 -0
- package/dist/requests/exceptions/BadGatewayException.js +3 -0
- package/dist/requests/exceptions/BadRequestException.d.ts +3 -0
- package/dist/requests/exceptions/BadRequestException.js +3 -0
- package/dist/requests/exceptions/ConflictException.d.ts +3 -0
- package/dist/requests/exceptions/ConflictException.js +3 -0
- package/dist/requests/exceptions/ForbiddenException.d.ts +3 -0
- package/dist/requests/exceptions/ForbiddenException.js +3 -0
- package/dist/requests/exceptions/GatewayTimeoutException.d.ts +3 -0
- package/dist/requests/exceptions/GatewayTimeoutException.js +3 -0
- package/dist/requests/exceptions/GoneException.d.ts +3 -0
- package/dist/requests/exceptions/GoneException.js +3 -0
- package/dist/requests/exceptions/InvalidJsonException.d.ts +7 -0
- package/dist/requests/exceptions/InvalidJsonException.js +10 -0
- package/dist/requests/exceptions/LockedException.d.ts +3 -0
- package/dist/requests/exceptions/LockedException.js +3 -0
- package/dist/requests/exceptions/MethodNotAllowedException.d.ts +3 -0
- package/dist/requests/exceptions/MethodNotAllowedException.js +3 -0
- package/dist/requests/exceptions/NoResponseReceivedException.d.ts +3 -0
- package/{src/requests/exceptions/NoResponseReceivedException.ts → dist/requests/exceptions/NoResponseReceivedException.js} +3 -3
- package/dist/requests/exceptions/NotFoundException.d.ts +3 -0
- package/dist/requests/exceptions/NotFoundException.js +3 -0
- package/dist/requests/exceptions/NotImplementedException.d.ts +3 -0
- package/dist/requests/exceptions/NotImplementedException.js +3 -0
- package/dist/requests/exceptions/PageExpiredException.d.ts +3 -0
- package/dist/requests/exceptions/PageExpiredException.js +3 -0
- package/dist/requests/exceptions/PayloadTooLargeException.d.ts +3 -0
- package/dist/requests/exceptions/PayloadTooLargeException.js +3 -0
- package/dist/requests/exceptions/PreconditionFailedException.d.ts +3 -0
- package/dist/requests/exceptions/PreconditionFailedException.js +3 -0
- package/dist/requests/exceptions/RequestTimeoutException.d.ts +3 -0
- package/dist/requests/exceptions/RequestTimeoutException.js +3 -0
- package/dist/requests/exceptions/ResponseBodyException.d.ts +7 -0
- package/dist/requests/exceptions/ResponseBodyException.js +10 -0
- package/dist/requests/exceptions/ResponseException.d.ts +6 -0
- package/dist/requests/exceptions/ResponseException.js +9 -0
- package/dist/requests/exceptions/ServerErrorException.d.ts +3 -0
- package/dist/requests/exceptions/ServerErrorException.js +3 -0
- package/dist/requests/exceptions/ServiceUnavailableException.d.ts +3 -0
- package/dist/requests/exceptions/ServiceUnavailableException.js +3 -0
- package/dist/requests/exceptions/StaleResponseException.d.ts +5 -0
- package/dist/requests/exceptions/StaleResponseException.js +10 -0
- package/dist/requests/exceptions/TooManyRequestsException.d.ts +3 -0
- package/dist/requests/exceptions/TooManyRequestsException.js +3 -0
- package/dist/requests/exceptions/UnauthorizedException.d.ts +3 -0
- package/dist/requests/exceptions/UnauthorizedException.js +3 -0
- package/dist/requests/exceptions/UnsupportedMediaTypeException.d.ts +3 -0
- package/dist/requests/exceptions/UnsupportedMediaTypeException.js +3 -0
- package/dist/requests/exceptions/ValidationException.d.ts +3 -0
- package/dist/requests/exceptions/ValidationException.js +3 -0
- package/dist/requests/exceptions/index.d.ts +25 -0
- package/dist/requests/exceptions/index.js +25 -0
- package/dist/requests/factories/BinaryBodyFactory.d.ts +8 -0
- package/dist/requests/factories/BinaryBodyFactory.js +9 -0
- package/dist/requests/factories/FormDataFactory.d.ts +12 -0
- package/dist/requests/factories/FormDataFactory.js +6 -0
- package/dist/requests/factories/JsonBodyFactory.d.ts +5 -0
- package/dist/requests/factories/JsonBodyFactory.js +6 -0
- package/dist/requests/index.d.ts +31 -0
- package/dist/requests/index.js +19 -0
- package/dist/requests/responses/BaseResponse.d.ts +14 -0
- package/dist/requests/responses/BaseResponse.js +36 -0
- package/dist/requests/responses/BlobResponse.d.ts +7 -0
- package/dist/requests/responses/BlobResponse.js +16 -0
- package/dist/requests/responses/JsonResponse.d.ts +5 -0
- package/dist/requests/responses/JsonResponse.js +12 -0
- package/dist/requests/responses/PlainTextResponse.d.ts +5 -0
- package/dist/requests/responses/PlainTextResponse.js +12 -0
- package/{src/requests/types/RequestConcurrencyOptions.ts → dist/requests/types/RequestConcurrencyOptions.d.ts} +4 -5
- package/dist/requests/types/RequestConcurrencyOptions.js +1 -0
- package/dist/requests/types/RequestUploadProgress.d.ts +6 -0
- package/dist/requests/types/RequestUploadProgress.js +1 -0
- package/dist/support/DeferredPromise.d.ts +37 -0
- package/dist/support/DeferredPromise.js +55 -0
- package/dist/support/helpers.d.ts +5 -0
- package/dist/support/helpers.js +69 -0
- package/{src/support/index.ts → dist/support/index.d.ts} +3 -4
- package/dist/support/index.js +3 -0
- package/dist/vue/composables/useConfirmDialog.d.ts +20 -0
- package/dist/vue/composables/useConfirmDialog.js +52 -0
- package/dist/vue/composables/useGlobalCheckbox.d.ts +13 -0
- package/dist/vue/composables/useGlobalCheckbox.js +123 -0
- package/dist/vue/composables/useIsEmpty.d.ts +4 -0
- package/dist/vue/composables/useIsEmpty.js +27 -0
- package/dist/vue/composables/useIsOpen.d.ts +5 -0
- package/dist/vue/composables/useIsOpen.js +25 -0
- package/dist/vue/composables/useIsOpenFromVar.d.ts +6 -0
- package/dist/vue/composables/useIsOpenFromVar.js +45 -0
- package/dist/vue/composables/useModelWrapper.d.ts +9 -0
- package/dist/vue/composables/useModelWrapper.js +18 -0
- package/dist/vue/composables/useOnOpen.d.ts +7 -0
- package/dist/vue/composables/useOnOpen.js +25 -0
- package/{src/vue/contracts/ModelValueOptions.ts → dist/vue/contracts/ModelValueOptions.d.ts} +1 -1
- package/dist/vue/contracts/ModelValueOptions.js +1 -0
- package/dist/vue/contracts/ModelValueProps.d.ts +3 -0
- package/dist/vue/contracts/ModelValueProps.js +1 -0
- package/dist/vue/forms/BaseForm.d.ts +162 -0
- package/dist/vue/forms/BaseForm.js +997 -0
- package/dist/vue/forms/PropertyAwareArray.d.ts +53 -0
- package/dist/vue/forms/PropertyAwareArray.js +54 -0
- package/{src/vue/forms/index.ts → dist/vue/forms/index.d.ts} +9 -11
- package/dist/vue/forms/index.js +6 -0
- package/dist/vue/forms/types/PersistedForm.d.ts +6 -0
- package/dist/vue/forms/types/PersistedForm.js +1 -0
- package/dist/vue/forms/validation/ValidationMode.enum.d.ts +11 -0
- package/dist/vue/forms/validation/ValidationMode.enum.js +14 -0
- package/dist/vue/forms/validation/index.d.ts +12 -0
- package/dist/vue/forms/validation/index.js +9 -0
- package/dist/vue/forms/validation/rules/BaseRule.d.ts +5 -0
- package/dist/vue/forms/validation/rules/BaseRule.js +5 -0
- package/dist/vue/forms/validation/rules/ConfirmedRule.d.ts +10 -0
- package/dist/vue/forms/validation/rules/ConfirmedRule.js +26 -0
- package/dist/vue/forms/validation/rules/EmailRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/EmailRule.js +19 -0
- package/dist/vue/forms/validation/rules/JsonRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/JsonRule.js +25 -0
- package/dist/vue/forms/validation/rules/MinRule.d.ts +26 -0
- package/dist/vue/forms/validation/rules/MinRule.js +52 -0
- package/dist/vue/forms/validation/rules/RequiredRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/RequiredRule.js +16 -0
- package/dist/vue/forms/validation/rules/UrlRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/UrlRule.js +22 -0
- package/{src/vue/forms/validation/types/BidirectionalRule.ts → dist/vue/forms/validation/types/BidirectionalRule.d.ts} +4 -4
- package/dist/vue/forms/validation/types/BidirectionalRule.js +1 -0
- package/dist/vue/forms/validation/types/ValidationRules.d.ts +11 -0
- package/dist/vue/forms/validation/types/ValidationRules.js +1 -0
- package/dist/vue/index.d.ts +11 -0
- package/dist/vue/index.js +10 -0
- package/dist/vue/requests/factories/VueRequestLoaderFactory.d.ts +6 -0
- package/dist/vue/requests/factories/VueRequestLoaderFactory.js +6 -0
- package/{src/vue/requests/index.ts → dist/vue/requests/index.d.ts} +4 -5
- package/dist/vue/requests/index.js +4 -0
- package/dist/vue/requests/loaders/VueRequestBatchLoader.d.ts +12 -0
- package/dist/vue/requests/loaders/VueRequestBatchLoader.js +29 -0
- package/dist/vue/requests/loaders/VueRequestLoader.d.ts +8 -0
- package/dist/vue/requests/loaders/VueRequestLoader.js +12 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceBoundView.d.ts +57 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceBoundView.js +135 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceRequestResolver.d.ts +6 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceRequestResolver.js +20 -0
- package/dist/vue/router/routeResourceBinding/defineRoute.d.ts +23 -0
- package/dist/vue/router/routeResourceBinding/defineRoute.js +42 -0
- package/dist/vue/router/routeResourceBinding/index.d.ts +8 -0
- package/dist/vue/router/routeResourceBinding/index.js +6 -0
- package/dist/vue/router/routeResourceBinding/installRouteInjection.d.ts +14 -0
- package/dist/vue/router/routeResourceBinding/installRouteInjection.js +133 -0
- package/dist/vue/router/routeResourceBinding/types.d.ts +55 -0
- package/dist/vue/router/routeResourceBinding/types.js +1 -0
- package/dist/vue/router/routeResourceBinding/useRouteResource.d.ts +8 -0
- package/dist/vue/router/routeResourceBinding/useRouteResource.js +29 -0
- package/dist/vue/state/State.d.ts +75 -0
- package/dist/vue/state/State.js +267 -0
- package/dist/vue/state/index.d.ts +2 -0
- package/dist/vue/state/index.js +2 -0
- package/package.json +81 -23
- package/.editorconfig +0 -508
- package/.eslintrc.cjs +0 -15
- package/.prettierrc.json +0 -8
- package/CHANGELOG.md +0 -226
- package/docker-compose.yaml +0 -8
- package/docs/.vitepress/config.ts +0 -124
- package/docs/index.md +0 -13
- package/docs/laravel/pagination.md +0 -67
- package/docs/laravel/requests.md +0 -62
- package/docs/services/pagination/index.md +0 -46
- package/docs/services/pagination/infinite-scroller.md +0 -20
- package/docs/services/pagination/page-aware.md +0 -51
- package/docs/services/pagination/state-pagination.md +0 -77
- package/docs/services/pagination/updating-rows.md +0 -52
- package/docs/services/persistence/index.md +0 -46
- package/docs/services/requests/abort-requests.md +0 -29
- package/docs/services/requests/bulk-requests.md +0 -70
- package/docs/services/requests/concurrency.md +0 -58
- package/docs/services/requests/drivers.md +0 -115
- package/docs/services/requests/error-handling.md +0 -153
- package/docs/services/requests/events.md +0 -53
- package/docs/services/requests/file-uploads.md +0 -168
- package/docs/services/requests/getting-started.md +0 -201
- package/docs/services/requests/headers.md +0 -40
- package/docs/services/requests/loading.md +0 -63
- package/docs/services/requests/request-bodies.md +0 -89
- package/docs/services/requests/responses.md +0 -34
- package/docs/services/support/deferred-promise.md +0 -63
- package/docs/services/support/helpers.md +0 -77
- package/docs/services/support/index.md +0 -6
- package/docs/upgrading/v1-to-v2.md +0 -64
- package/docs/upgrading/v2-to-v3.md +0 -52
- package/docs/upgrading/v3-to-v4.md +0 -214
- package/docs/upgrading.md +0 -0
- package/docs/vue/composables/use-confirm-dialog.md +0 -96
- package/docs/vue/composables/use-global-checkbox.md +0 -73
- package/docs/vue/composables/use-is-empty.md +0 -26
- package/docs/vue/composables/use-is-open-from-var.md +0 -32
- package/docs/vue/composables/use-is-open.md +0 -28
- package/docs/vue/composables/use-model-wrapper.md +0 -29
- package/docs/vue/composables/use-on-open.md +0 -26
- package/docs/vue/forms/arrays.md +0 -102
- package/docs/vue/forms/errors.md +0 -52
- package/docs/vue/forms/index.md +0 -99
- package/docs/vue/forms/payloads.md +0 -99
- package/docs/vue/forms/persistence.md +0 -19
- package/docs/vue/forms/state-and-properties.md +0 -26
- package/docs/vue/forms/utilities.md +0 -27
- package/docs/vue/forms/validation.md +0 -189
- package/docs/vue/requests/loading.md +0 -51
- package/docs/vue/router/route-resource-binding.md +0 -240
- package/docs/vue/state.md +0 -309
- package/env.d.ts +0 -1
- package/eslint.config.js +0 -15
- package/release-tool.json +0 -26
- package/src/bulkRequests/BulkRequestEvent.enum.ts +0 -4
- package/src/bulkRequests/BulkRequestSender.ts +0 -196
- package/src/bulkRequests/BulkRequestWrapper.ts +0 -49
- package/src/bulkRequests/index.ts +0 -6
- package/src/laravel/pagination/dataDrivers/RequestDriver.ts +0 -30
- package/src/laravel/pagination/index.ts +0 -6
- package/src/laravel/requests/JsonBaseRequest.ts +0 -35
- package/src/laravel/requests/PaginationJsonBaseRequest.ts +0 -29
- package/src/laravel/requests/index.ts +0 -9
- package/src/laravel/requests/responses/JsonResponse.ts +0 -8
- package/src/laravel/requests/responses/PaginationResponse.ts +0 -16
- package/src/pagination/BasePaginator.ts +0 -94
- package/src/pagination/InfiniteScroller.ts +0 -22
- package/src/pagination/PageAwarePaginator.ts +0 -132
- package/src/pagination/StatePaginator.ts +0 -86
- package/src/pagination/contracts/BaseViewDriverContract.ts +0 -6
- package/src/pagination/contracts/PaginateableRequestContract.ts +0 -13
- package/src/pagination/contracts/PaginationDataDriverContract.ts +0 -5
- package/src/pagination/contracts/ViewDriverContract.ts +0 -10
- package/src/pagination/contracts/ViewDriverFactoryContract.ts +0 -5
- package/src/pagination/dataDrivers/ArrayDriver.ts +0 -28
- package/src/pagination/dtos/PaginationDataDto.ts +0 -14
- package/src/pagination/dtos/StatePaginationDataDto.ts +0 -19
- package/src/pagination/factories/VueBaseViewDriverFactory.ts +0 -9
- package/src/pagination/factories/VuePaginationDriverFactory.ts +0 -9
- package/src/pagination/frontendDrivers/VueBaseViewDriver.ts +0 -28
- package/src/pagination/frontendDrivers/VuePaginationDriver.ts +0 -61
- package/src/pagination/index.ts +0 -46
- package/src/persistenceDrivers/LocalStorageDriver.ts +0 -22
- package/src/persistenceDrivers/NonPersistentDriver.ts +0 -12
- package/src/persistenceDrivers/SessionStorageDriver.ts +0 -22
- package/src/persistenceDrivers/index.ts +0 -8
- package/src/persistenceDrivers/types/PersistenceDriver.ts +0 -5
- package/src/requests/BaseRequest.ts +0 -321
- package/src/requests/ErrorHandler.ts +0 -144
- package/src/requests/RequestConcurrencyMode.enum.ts +0 -6
- package/src/requests/RequestErrorRouter.ts +0 -89
- package/src/requests/RequestEvents.enum.ts +0 -4
- package/src/requests/RequestMethod.enum.ts +0 -8
- package/src/requests/bodies/BinaryBody.ts +0 -31
- package/src/requests/bodies/FormDataBody.ts +0 -81
- package/src/requests/bodies/JsonBody.ts +0 -16
- package/src/requests/contracts/BaseRequestContract.ts +0 -39
- package/src/requests/contracts/BodyContract.ts +0 -9
- package/src/requests/contracts/BodyFactoryContract.ts +0 -5
- package/src/requests/contracts/DriverConfigContract.ts +0 -9
- package/src/requests/contracts/HeadersContract.ts +0 -9
- package/src/requests/contracts/RequestDriverContract.ts +0 -15
- package/src/requests/contracts/RequestLoaderContract.ts +0 -5
- package/src/requests/contracts/ResponseContract.ts +0 -7
- package/src/requests/drivers/contracts/ResponseHandlerContract.ts +0 -10
- package/src/requests/drivers/fetch/FetchDriver.ts +0 -115
- package/src/requests/drivers/fetch/FetchResponse.ts +0 -30
- package/src/requests/drivers/xhr/XMLHttpRequestDriver.ts +0 -138
- package/src/requests/drivers/xhr/XMLHttpRequestResponse.ts +0 -95
- package/src/requests/exceptions/BadGatewayException.ts +0 -3
- package/src/requests/exceptions/BadRequestException.ts +0 -3
- package/src/requests/exceptions/ConflictException.ts +0 -3
- package/src/requests/exceptions/ForbiddenException.ts +0 -3
- package/src/requests/exceptions/GatewayTimeoutException.ts +0 -3
- package/src/requests/exceptions/GoneException.ts +0 -3
- package/src/requests/exceptions/InvalidJsonException.ts +0 -15
- package/src/requests/exceptions/LockedException.ts +0 -3
- package/src/requests/exceptions/MethodNotAllowedException.ts +0 -3
- package/src/requests/exceptions/NotFoundException.ts +0 -3
- package/src/requests/exceptions/NotImplementedException.ts +0 -3
- package/src/requests/exceptions/PageExpiredException.ts +0 -3
- package/src/requests/exceptions/PayloadTooLargeException.ts +0 -3
- package/src/requests/exceptions/PreconditionFailedException.ts +0 -3
- package/src/requests/exceptions/RequestTimeoutException.ts +0 -3
- package/src/requests/exceptions/ResponseBodyException.ts +0 -15
- package/src/requests/exceptions/ResponseException.ts +0 -11
- package/src/requests/exceptions/ServerErrorException.ts +0 -3
- package/src/requests/exceptions/ServiceUnavailableException.ts +0 -3
- package/src/requests/exceptions/StaleResponseException.ts +0 -13
- package/src/requests/exceptions/TooManyRequestsException.ts +0 -3
- package/src/requests/exceptions/UnauthorizedException.ts +0 -3
- package/src/requests/exceptions/UnsupportedMediaTypeException.ts +0 -3
- package/src/requests/exceptions/ValidationException.ts +0 -3
- package/src/requests/exceptions/index.ts +0 -51
- package/src/requests/factories/BinaryBodyFactory.ts +0 -13
- package/src/requests/factories/FormDataFactory.ts +0 -17
- package/src/requests/factories/JsonBodyFactory.ts +0 -9
- package/src/requests/index.ts +0 -68
- package/src/requests/responses/BaseResponse.ts +0 -41
- package/src/requests/responses/BlobResponse.ts +0 -19
- package/src/requests/responses/JsonResponse.ts +0 -15
- package/src/requests/responses/PlainTextResponse.ts +0 -15
- package/src/requests/types/RequestUploadProgress.ts +0 -6
- package/src/support/DeferredPromise.ts +0 -67
- package/src/support/helpers.ts +0 -78
- package/src/vue/composables/useConfirmDialog.ts +0 -63
- package/src/vue/composables/useGlobalCheckbox.ts +0 -145
- package/src/vue/composables/useIsEmpty.ts +0 -34
- package/src/vue/composables/useIsOpen.ts +0 -37
- package/src/vue/composables/useIsOpenFromVar.ts +0 -61
- package/src/vue/composables/useModelWrapper.ts +0 -27
- package/src/vue/composables/useOnOpen.ts +0 -34
- package/src/vue/contracts/ModelValueProps.ts +0 -3
- package/src/vue/forms/BaseForm.ts +0 -1192
- package/src/vue/forms/PropertyAwareArray.ts +0 -81
- package/src/vue/forms/types/PersistedForm.ts +0 -6
- package/src/vue/forms/validation/ValidationMode.enum.ts +0 -14
- package/src/vue/forms/validation/index.ts +0 -15
- package/src/vue/forms/validation/rules/BaseRule.ts +0 -7
- package/src/vue/forms/validation/rules/ConfirmedRule.ts +0 -39
- package/src/vue/forms/validation/rules/EmailRule.ts +0 -23
- package/src/vue/forms/validation/rules/JsonRule.ts +0 -28
- package/src/vue/forms/validation/rules/MinRule.ts +0 -61
- package/src/vue/forms/validation/rules/RequiredRule.ts +0 -19
- package/src/vue/forms/validation/rules/UrlRule.ts +0 -24
- package/src/vue/forms/validation/types/ValidationRules.ts +0 -15
- package/src/vue/index.ts +0 -14
- package/src/vue/requests/factories/VueRequestLoaderFactory.ts +0 -10
- package/src/vue/requests/loaders/VueRequestBatchLoader.ts +0 -35
- package/src/vue/requests/loaders/VueRequestLoader.ts +0 -18
- package/src/vue/router/routeResourceBinding/RouteResourceBoundView.ts +0 -145
- package/src/vue/router/routeResourceBinding/RouteResourceRequestResolver.ts +0 -11
- package/src/vue/router/routeResourceBinding/defineRoute.ts +0 -59
- package/src/vue/router/routeResourceBinding/index.ts +0 -11
- package/src/vue/router/routeResourceBinding/installRouteInjection.ts +0 -164
- package/src/vue/router/routeResourceBinding/types.ts +0 -53
- package/src/vue/router/routeResourceBinding/useRouteResource.ts +0 -24
- package/src/vue/state/State.ts +0 -380
- package/src/vue/state/index.ts +0 -3
- package/tests/service/bulkRequests/BulkRequestSender.test.ts +0 -76
- package/tests/service/bulkRequests/BulkRequestWrapper.test.ts +0 -51
- package/tests/service/helpers/mergeDeep.test.ts +0 -53
- package/tests/service/laravel/pagination/dataDrivers/RequestDriver.test.ts +0 -84
- package/tests/service/laravel/requests/JsonBaseRequest.test.ts +0 -43
- package/tests/service/laravel/requests/PaginationJsonBaseRequest.test.ts +0 -58
- package/tests/service/laravel/requests/responses/JsonResponse.test.ts +0 -59
- package/tests/service/laravel/requests/responses/PaginationResponse.test.ts +0 -127
- package/tests/service/pagination/BasePaginator.test.ts +0 -100
- package/tests/service/pagination/InfiniteScroller.test.ts +0 -101
- package/tests/service/pagination/PageAwarePaginator.test.ts +0 -133
- package/tests/service/pagination/StatePaginator.test.ts +0 -76
- package/tests/service/pagination/VueViewDrivers.test.ts +0 -46
- package/tests/service/pagination/dtos/PaginationDataDto.test.ts +0 -35
- package/tests/service/pagination/dtos/StatePaginationDataDto.test.ts +0 -14
- package/tests/service/pagination/factories/VuePaginationDriverFactory.test.ts +0 -32
- package/tests/service/pagination/frontendDrivers/VuePaginationDriver.test.ts +0 -66
- package/tests/service/persistenceDrivers/PersistenceDrivers.test.ts +0 -56
- package/tests/service/requests/BaseRequest.test.ts +0 -250
- package/tests/service/requests/BodiesAndFactories.test.ts +0 -52
- package/tests/service/requests/Enums.test.ts +0 -20
- package/tests/service/requests/ErrorHandler.test.ts +0 -188
- package/tests/service/requests/FormDataBody.test.ts +0 -63
- package/tests/service/requests/RequestErrorRouter.test.ts +0 -44
- package/tests/service/requests/Responses.test.ts +0 -83
- package/tests/service/requests/exceptions/Exceptions.test.ts +0 -43
- package/tests/service/requests/fetch/FetchDriver.test.ts +0 -94
- package/tests/service/requests/fetch/FetchResponse.test.ts +0 -21
- package/tests/service/requests/xhr/XMLHttpRequestDriver.test.ts +0 -197
- package/tests/service/support/DeferredPromise.test.ts +0 -40
- package/tests/service/support/helpers.test.ts +0 -37
- package/tests/vue/composables/useConfirmDialog.test.ts +0 -77
- package/tests/vue/composables/useGlobalCheckbox.test.ts +0 -126
- package/tests/vue/composables/useIsEmpty.test.ts +0 -18
- package/tests/vue/composables/useIsOpen.test.ts +0 -25
- package/tests/vue/composables/useIsOpenFromVar.test.ts +0 -22
- package/tests/vue/composables/useModelWrapper.test.ts +0 -30
- package/tests/vue/composables/useOnOpen.test.ts +0 -26
- package/tests/vue/forms/BaseForm.behavior.test.ts +0 -98
- package/tests/vue/forms/BaseForm.transformers.test.ts +0 -109
- package/tests/vue/forms/PropertyAwareArray.test.ts +0 -30
- package/tests/vue/forms/validation/ValidationRules.test.ts +0 -79
- package/tests/vue/requests/VueRequestLoaders.test.ts +0 -48
- package/tests/vue/router/routeResourceBinding/RouteResourceBoundView.test.ts +0 -344
- package/tests/vue/router/routeResourceBinding/RouteResourceUtils.test.ts +0 -70
- package/tests/vue/router/routeResourceBinding/installRouteInjection.test.ts +0 -450
- package/tests/vue/state/State.test.ts +0 -151
- package/tsconfig.json +0 -114
- package/vite.config.ts +0 -34
- package/vitest.config.ts +0 -23
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import qs from 'qs'
|
|
2
|
-
import { ErrorHandler } from './ErrorHandler'
|
|
3
|
-
import { RequestEvents } from './RequestEvents.enum'
|
|
4
|
-
import { RequestMethodEnum } from './RequestMethod.enum'
|
|
5
|
-
import { BaseResponse } from './responses/BaseResponse'
|
|
6
|
-
import { ResponseException } from './exceptions/ResponseException'
|
|
7
|
-
import { StaleResponseException } from './exceptions/StaleResponseException'
|
|
8
|
-
import { type DriverConfigContract } from './contracts/DriverConfigContract'
|
|
9
|
-
import { type BodyFactoryContract } from './contracts/BodyFactoryContract'
|
|
10
|
-
import { type BodyContract } from './contracts/BodyContract'
|
|
11
|
-
import { type RequestLoaderContract } from './contracts/RequestLoaderContract'
|
|
12
|
-
import { type RequestDriverContract } from './contracts/RequestDriverContract'
|
|
13
|
-
import { type RequestLoaderFactoryContract } from './contracts/RequestLoaderFactoryContract'
|
|
14
|
-
import { type BaseRequestContract, type EventHandlerCallback } from './contracts/BaseRequestContract'
|
|
15
|
-
import { type HeadersContract } from './contracts/HeadersContract'
|
|
16
|
-
import { type ResponseHandlerContract } from './drivers/contracts/ResponseHandlerContract'
|
|
17
|
-
import { type ResponseContract } from './contracts/ResponseContract'
|
|
18
|
-
import { type RequestConcurrencyOptions } from './types/RequestConcurrencyOptions'
|
|
19
|
-
import { type RequestUploadProgress } from './types/RequestUploadProgress'
|
|
20
|
-
import { RequestConcurrencyMode } from './RequestConcurrencyMode.enum'
|
|
21
|
-
import { mergeDeep } from '../support/helpers'
|
|
22
|
-
import { v4 as uuidv4 } from 'uuid'
|
|
23
|
-
|
|
24
|
-
export abstract class BaseRequest<
|
|
25
|
-
RequestLoaderLoadingType,
|
|
26
|
-
ResponseErrorBody,
|
|
27
|
-
ResponseBodyInterface = undefined,
|
|
28
|
-
ResponseClass extends ResponseContract<ResponseBodyInterface> = BaseResponse<ResponseBodyInterface>,
|
|
29
|
-
RequestBodyInterface = undefined,
|
|
30
|
-
RequestParamsInterface extends object = object
|
|
31
|
-
> implements BaseRequestContract<RequestLoaderLoadingType, RequestBodyInterface, ResponseClass, RequestParamsInterface> {
|
|
32
|
-
protected requestId: string = uuidv4()
|
|
33
|
-
protected params: RequestParamsInterface | undefined = undefined
|
|
34
|
-
protected requestBody: RequestBodyInterface | undefined = undefined
|
|
35
|
-
protected requestLoader: RequestLoaderContract<RequestLoaderLoadingType> | undefined = undefined
|
|
36
|
-
protected abortSignal: AbortSignal | undefined = undefined
|
|
37
|
-
protected concurrencyOptions: RequestConcurrencyOptions | undefined = undefined
|
|
38
|
-
/* @ts-expect-error Ignore generics */
|
|
39
|
-
protected events: { [key in RequestEvents]?: EventHandlerCallback[] } = {}
|
|
40
|
-
|
|
41
|
-
protected static defaultBaseUrl: string
|
|
42
|
-
|
|
43
|
-
protected static requestDriver: RequestDriverContract
|
|
44
|
-
protected static requestLoaderFactory: RequestLoaderFactoryContract<unknown>
|
|
45
|
-
protected static concurrencySequenceByKey: Map<string, number> = new Map()
|
|
46
|
-
protected static concurrencyAbortControllerByKey: Map<string, AbortController> = new Map()
|
|
47
|
-
protected static concurrencyInFlightByKey: Map<string, number> = new Map()
|
|
48
|
-
|
|
49
|
-
public constructor() {
|
|
50
|
-
if (BaseRequest.requestLoaderFactory !== undefined) {
|
|
51
|
-
this.requestLoader = BaseRequest.requestLoaderFactory.make() as RequestLoaderContract<RequestLoaderLoadingType>
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public static setRequestDriver(driver: RequestDriverContract) {
|
|
56
|
-
this.requestDriver = driver
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public static setRequestLoaderFactory<T>(factory: RequestLoaderFactoryContract<T>): void {
|
|
60
|
-
this.requestLoaderFactory = factory
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public static setDefaultBaseUrl(url: string) {
|
|
64
|
-
this.defaultBaseUrl = url
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public setRequestLoader(loader: RequestLoaderContract<RequestLoaderLoadingType>): this {
|
|
68
|
-
this.requestLoader = loader
|
|
69
|
-
|
|
70
|
-
return this
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public setConcurrency(options?: RequestConcurrencyOptions): this {
|
|
74
|
-
this.concurrencyOptions = options
|
|
75
|
-
|
|
76
|
-
return this
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public getRequestId(): string {
|
|
80
|
-
return this.requestId
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
public abstract method(): RequestMethodEnum
|
|
84
|
-
|
|
85
|
-
public abstract url(): URL | string
|
|
86
|
-
|
|
87
|
-
public setParams(params?: RequestParamsInterface): this {
|
|
88
|
-
this.params = params
|
|
89
|
-
|
|
90
|
-
return this
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public withParams(params: RequestParamsInterface): this {
|
|
94
|
-
this.params = this.params === undefined ? params : (mergeDeep({}, this.params, params) as RequestParamsInterface)
|
|
95
|
-
|
|
96
|
-
return this
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
public getParams(): RequestParamsInterface | undefined {
|
|
100
|
-
return this.params
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
public setBody(requestBody: RequestBodyInterface): this {
|
|
104
|
-
this.requestBody = requestBody
|
|
105
|
-
|
|
106
|
-
return this
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
public getBody(): RequestBodyInterface | undefined {
|
|
110
|
-
return this.requestBody
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public requestHeaders(): HeadersContract {
|
|
114
|
-
return {}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public buildUrl(): URL {
|
|
118
|
-
const hasParams = this.params !== undefined && Object.keys(this.params).length > 0
|
|
119
|
-
const url = hasParams ? this.url() + '?' + qs.stringify(this.params) : this.url()
|
|
120
|
-
|
|
121
|
-
return new URL(url, this.baseUrl() ?? BaseRequest.defaultBaseUrl)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
public on<T>(event: RequestEvents, handler: EventHandlerCallback<T>): this {
|
|
125
|
-
if (!this.events[event]) {
|
|
126
|
-
this.events[event] = []
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
this.events[event].push(handler)
|
|
130
|
-
|
|
131
|
-
return this
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
protected dispatch<T>(event: RequestEvents, value: T) {
|
|
135
|
-
if (!this.events[event]) {
|
|
136
|
-
return
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
this.events[event].forEach((handler: EventHandlerCallback<T>) => handler(value))
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
public async send(): Promise<ResponseClass> {
|
|
143
|
-
const concurrencyMode: RequestConcurrencyMode = this.concurrencyOptions?.mode ?? RequestConcurrencyMode.ALLOW
|
|
144
|
-
const concurrencyKey = this.concurrencyOptions?.key ?? this.requestId
|
|
145
|
-
const useReplace = concurrencyMode === RequestConcurrencyMode.REPLACE || concurrencyMode === RequestConcurrencyMode.REPLACE_LATEST
|
|
146
|
-
const useLatest = concurrencyMode === RequestConcurrencyMode.LATEST || concurrencyMode === RequestConcurrencyMode.REPLACE_LATEST
|
|
147
|
-
const sequence = this.bumpConcurrencySequence(concurrencyKey)
|
|
148
|
-
this.incrementConcurrencyInFlight(concurrencyKey)
|
|
149
|
-
|
|
150
|
-
if (useReplace) {
|
|
151
|
-
const previousController = BaseRequest.concurrencyAbortControllerByKey.get(concurrencyKey)
|
|
152
|
-
|
|
153
|
-
if (previousController) {
|
|
154
|
-
previousController.abort()
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const controller = new AbortController()
|
|
158
|
-
BaseRequest.concurrencyAbortControllerByKey.set(concurrencyKey, controller)
|
|
159
|
-
this.setAbortSignal(controller.signal)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
this.dispatch<boolean>(RequestEvents.LOADING, true)
|
|
163
|
-
|
|
164
|
-
this.requestLoader?.setLoading(true)
|
|
165
|
-
|
|
166
|
-
const responseSkeleton = this.getResponse()
|
|
167
|
-
|
|
168
|
-
const requestBody = this.requestBody === undefined ? undefined : this.getRequestBodyFactory()?.make(this.requestBody)
|
|
169
|
-
const requestConfig = this.buildRequestConfig(requestBody, concurrencyKey, sequence, useLatest)
|
|
170
|
-
|
|
171
|
-
return this.resolveRequestDriver()
|
|
172
|
-
.send(
|
|
173
|
-
this.buildUrl(),
|
|
174
|
-
this.method(),
|
|
175
|
-
{
|
|
176
|
-
Accept: responseSkeleton.getAcceptHeader(),
|
|
177
|
-
...this.requestHeaders()
|
|
178
|
-
},
|
|
179
|
-
requestBody,
|
|
180
|
-
requestConfig
|
|
181
|
-
)
|
|
182
|
-
.then(async (responseHandler: ResponseHandlerContract) => {
|
|
183
|
-
if (useLatest && !this.isLatestSequence(concurrencyKey, sequence)) {
|
|
184
|
-
throw new StaleResponseException()
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
await responseSkeleton.setResponse(responseHandler)
|
|
188
|
-
|
|
189
|
-
return responseSkeleton
|
|
190
|
-
})
|
|
191
|
-
.catch(async (error) => {
|
|
192
|
-
if (useLatest && !this.isLatestSequence(concurrencyKey, sequence)) {
|
|
193
|
-
throw new StaleResponseException('Stale response ignored', error)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (error instanceof StaleResponseException) {
|
|
197
|
-
throw error
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (error instanceof ResponseException) {
|
|
201
|
-
const handler = new ErrorHandler<ResponseErrorBody>(error.getResponse())
|
|
202
|
-
|
|
203
|
-
await handler.handle()
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
console.error('@blueprint-ts/core: Unknown error received.', error)
|
|
207
|
-
|
|
208
|
-
throw error
|
|
209
|
-
})
|
|
210
|
-
.finally(() => {
|
|
211
|
-
const isStale = useLatest && !this.isLatestSequence(concurrencyKey, sequence)
|
|
212
|
-
|
|
213
|
-
if (!isStale) {
|
|
214
|
-
this.dispatch<boolean>(RequestEvents.LOADING, false)
|
|
215
|
-
this.requestLoader?.setLoading(false)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
this.decrementConcurrencyInFlight(concurrencyKey)
|
|
219
|
-
})
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
public isLoading(): RequestLoaderLoadingType {
|
|
223
|
-
if (!this.requestLoader) {
|
|
224
|
-
throw new Error('Request loader is not set.')
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return this.requestLoader.isLoading()
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
public abstract getResponse(): ResponseClass
|
|
231
|
-
|
|
232
|
-
public getRequestBodyFactory(): BodyFactoryContract<RequestBodyInterface | undefined> | undefined {
|
|
233
|
-
return undefined
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
public setAbortSignal(signal: AbortSignal): this {
|
|
237
|
-
this.abortSignal = signal
|
|
238
|
-
|
|
239
|
-
return this
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
protected bumpConcurrencySequence(key: string): number {
|
|
243
|
-
const next = (BaseRequest.concurrencySequenceByKey.get(key) ?? 0) + 1
|
|
244
|
-
BaseRequest.concurrencySequenceByKey.set(key, next)
|
|
245
|
-
|
|
246
|
-
return next
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
protected isLatestSequence(key: string, sequence: number): boolean {
|
|
250
|
-
return (BaseRequest.concurrencySequenceByKey.get(key) ?? 0) === sequence
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
protected incrementConcurrencyInFlight(key: string): void {
|
|
254
|
-
const next = (BaseRequest.concurrencyInFlightByKey.get(key) ?? 0) + 1
|
|
255
|
-
BaseRequest.concurrencyInFlightByKey.set(key, next)
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
protected decrementConcurrencyInFlight(key: string): void {
|
|
259
|
-
const current = BaseRequest.concurrencyInFlightByKey.get(key)
|
|
260
|
-
|
|
261
|
-
if (current === undefined) {
|
|
262
|
-
return
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const next = current - 1
|
|
266
|
-
|
|
267
|
-
if (next <= 0) {
|
|
268
|
-
BaseRequest.concurrencyInFlightByKey.delete(key)
|
|
269
|
-
BaseRequest.concurrencySequenceByKey.delete(key)
|
|
270
|
-
BaseRequest.concurrencyAbortControllerByKey.delete(key)
|
|
271
|
-
return
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
BaseRequest.concurrencyInFlightByKey.set(key, next)
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
protected baseUrl(): undefined {
|
|
278
|
-
return undefined
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
protected buildRequestConfig(
|
|
282
|
-
requestBody: BodyContract | undefined,
|
|
283
|
-
concurrencyKey: string,
|
|
284
|
-
sequence: number,
|
|
285
|
-
useLatest: boolean
|
|
286
|
-
): DriverConfigContract {
|
|
287
|
-
const config = this.getConfig() ?? {}
|
|
288
|
-
const onUploadProgress = config.onUploadProgress
|
|
289
|
-
|
|
290
|
-
if (requestBody === undefined) {
|
|
291
|
-
return config
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return {
|
|
295
|
-
...config,
|
|
296
|
-
onUploadProgress: (progress: RequestUploadProgress) => {
|
|
297
|
-
onUploadProgress?.(progress)
|
|
298
|
-
|
|
299
|
-
if (useLatest && !this.isLatestSequence(concurrencyKey, sequence)) {
|
|
300
|
-
return
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
this.dispatch<RequestUploadProgress>(RequestEvents.UPLOAD_PROGRESS, progress)
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
protected getConfig(): DriverConfigContract | undefined {
|
|
309
|
-
return {
|
|
310
|
-
abortSignal: this.abortSignal
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
protected resolveRequestDriver(): RequestDriverContract {
|
|
315
|
-
return this.getRequestDriver() ?? BaseRequest.requestDriver
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
protected getRequestDriver(): RequestDriverContract | undefined {
|
|
319
|
-
return undefined
|
|
320
|
-
}
|
|
321
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { PageExpiredException } from './exceptions/PageExpiredException'
|
|
2
|
-
import { NotFoundException } from './exceptions/NotFoundException'
|
|
3
|
-
import { UnauthorizedException } from './exceptions/UnauthorizedException'
|
|
4
|
-
import { ValidationException } from './exceptions/ValidationException'
|
|
5
|
-
import { ResponseException } from './exceptions/ResponseException'
|
|
6
|
-
import { NoResponseReceivedException } from './exceptions/NoResponseReceivedException'
|
|
7
|
-
import { ServerErrorException } from './exceptions/ServerErrorException'
|
|
8
|
-
import { type ResponseHandlerContract } from './drivers/contracts/ResponseHandlerContract'
|
|
9
|
-
import { ForbiddenException } from './exceptions/ForbiddenException'
|
|
10
|
-
import { TooManyRequestsException } from './exceptions/TooManyRequestsException'
|
|
11
|
-
import { LockedException } from './exceptions/LockedException'
|
|
12
|
-
import { NotImplementedException } from './exceptions/NotImplementedException'
|
|
13
|
-
import { ServiceUnavailableException } from './exceptions/ServiceUnavailableException'
|
|
14
|
-
import { MethodNotAllowedException } from './exceptions/MethodNotAllowedException'
|
|
15
|
-
import { RequestTimeoutException } from './exceptions/RequestTimeoutException'
|
|
16
|
-
import { ConflictException } from './exceptions/ConflictException'
|
|
17
|
-
import { GoneException } from './exceptions/GoneException'
|
|
18
|
-
import { PreconditionFailedException } from './exceptions/PreconditionFailedException'
|
|
19
|
-
import { PayloadTooLargeException } from './exceptions/PayloadTooLargeException'
|
|
20
|
-
import { UnsupportedMediaTypeException } from './exceptions/UnsupportedMediaTypeException'
|
|
21
|
-
import { BadGatewayException } from './exceptions/BadGatewayException'
|
|
22
|
-
import { GatewayTimeoutException } from './exceptions/GatewayTimeoutException'
|
|
23
|
-
import { BadRequestException } from './exceptions/BadRequestException'
|
|
24
|
-
import { InvalidJsonException } from './exceptions/InvalidJsonException'
|
|
25
|
-
|
|
26
|
-
export type ErrorHandlerCallback = ((response: ResponseHandlerContract) => boolean | void) | undefined
|
|
27
|
-
|
|
28
|
-
export class ErrorHandler<ResponseErrorBody> {
|
|
29
|
-
protected body: ResponseErrorBody | undefined = undefined
|
|
30
|
-
protected static handler: ErrorHandlerCallback = undefined
|
|
31
|
-
|
|
32
|
-
public constructor(protected response: ResponseHandlerContract) {}
|
|
33
|
-
|
|
34
|
-
public async handle() {
|
|
35
|
-
// Check if there is a global error handler set
|
|
36
|
-
if (ErrorHandler.handler !== undefined) {
|
|
37
|
-
// If handler returns false, we don't process the error further
|
|
38
|
-
if (ErrorHandler.handler(this.response) === false) {
|
|
39
|
-
console.debug('Skipping further error handling due to global handler returning false.')
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
this.body = await this.response.json<ResponseErrorBody>()
|
|
46
|
-
} catch (error) {
|
|
47
|
-
throw new InvalidJsonException(this.response, error)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (this.body === undefined) {
|
|
51
|
-
throw new NoResponseReceivedException(this.response)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
this.handleResponseError(this.response, this.body)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public static registerHandler(callback: ErrorHandlerCallback) {
|
|
58
|
-
ErrorHandler.handler = callback
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
protected handleResponseError(response: ResponseHandlerContract, body: ResponseErrorBody) {
|
|
62
|
-
if (response.getStatusCode() === 400) {
|
|
63
|
-
throw new BadRequestException<ResponseErrorBody>(response, body)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (response.getStatusCode() === 401) {
|
|
67
|
-
throw new UnauthorizedException<ResponseErrorBody>(response, body)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (response.getStatusCode() === 403) {
|
|
71
|
-
throw new ForbiddenException<ResponseErrorBody>(response, body)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (response.getStatusCode() === 404) {
|
|
75
|
-
throw new NotFoundException<ResponseErrorBody>(response, body)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (response.getStatusCode() === 405) {
|
|
79
|
-
throw new MethodNotAllowedException<ResponseErrorBody>(response, body)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (response.getStatusCode() === 408) {
|
|
83
|
-
throw new RequestTimeoutException<ResponseErrorBody>(response, body)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (response.getStatusCode() === 409) {
|
|
87
|
-
throw new ConflictException<ResponseErrorBody>(response, body)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (response.getStatusCode() === 410) {
|
|
91
|
-
throw new GoneException<ResponseErrorBody>(response, body)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (response.getStatusCode() === 412) {
|
|
95
|
-
throw new PreconditionFailedException<ResponseErrorBody>(response, body)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (response.getStatusCode() === 413) {
|
|
99
|
-
throw new PayloadTooLargeException<ResponseErrorBody>(response, body)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (response.getStatusCode() === 415) {
|
|
103
|
-
throw new UnsupportedMediaTypeException<ResponseErrorBody>(response, body)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (response.getStatusCode() === 419) {
|
|
107
|
-
throw new PageExpiredException<ResponseErrorBody>(response, body)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (response.getStatusCode() === 422) {
|
|
111
|
-
throw new ValidationException<ResponseErrorBody>(response, body)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (response.getStatusCode() === 423) {
|
|
115
|
-
throw new LockedException<ResponseErrorBody>(response, body)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (response.getStatusCode() === 429) {
|
|
119
|
-
throw new TooManyRequestsException<ResponseErrorBody>(response, body)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (response.getStatusCode() === 500) {
|
|
123
|
-
throw new ServerErrorException<ResponseErrorBody>(response, body)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (response.getStatusCode() === 501) {
|
|
127
|
-
throw new NotImplementedException<ResponseErrorBody>(response, body)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (response.getStatusCode() === 502) {
|
|
131
|
-
throw new BadGatewayException<ResponseErrorBody>(response, body)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (response.getStatusCode() === 503) {
|
|
135
|
-
throw new ServiceUnavailableException<ResponseErrorBody>(response, body)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (response.getStatusCode() === 504) {
|
|
139
|
-
throw new GatewayTimeoutException<ResponseErrorBody>(response, body)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
throw new ResponseException(response)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { BadRequestException } from './exceptions/BadRequestException'
|
|
2
|
-
import { MethodNotAllowedException } from './exceptions/MethodNotAllowedException'
|
|
3
|
-
import { RequestTimeoutException } from './exceptions/RequestTimeoutException'
|
|
4
|
-
import { ConflictException } from './exceptions/ConflictException'
|
|
5
|
-
import { GoneException } from './exceptions/GoneException'
|
|
6
|
-
import { PreconditionFailedException } from './exceptions/PreconditionFailedException'
|
|
7
|
-
import { PayloadTooLargeException } from './exceptions/PayloadTooLargeException'
|
|
8
|
-
import { UnsupportedMediaTypeException } from './exceptions/UnsupportedMediaTypeException'
|
|
9
|
-
import { ForbiddenException } from './exceptions/ForbiddenException'
|
|
10
|
-
import { LockedException } from './exceptions/LockedException'
|
|
11
|
-
import { NoResponseReceivedException } from './exceptions/NoResponseReceivedException'
|
|
12
|
-
import { NotFoundException } from './exceptions/NotFoundException'
|
|
13
|
-
import { NotImplementedException } from './exceptions/NotImplementedException'
|
|
14
|
-
import { BadGatewayException } from './exceptions/BadGatewayException'
|
|
15
|
-
import { PageExpiredException } from './exceptions/PageExpiredException'
|
|
16
|
-
import { ResponseBodyException } from './exceptions/ResponseBodyException'
|
|
17
|
-
import { ResponseException } from './exceptions/ResponseException'
|
|
18
|
-
import { ServerErrorException } from './exceptions/ServerErrorException'
|
|
19
|
-
import { ServiceUnavailableException } from './exceptions/ServiceUnavailableException'
|
|
20
|
-
import { GatewayTimeoutException } from './exceptions/GatewayTimeoutException'
|
|
21
|
-
import { TooManyRequestsException } from './exceptions/TooManyRequestsException'
|
|
22
|
-
import { UnauthorizedException } from './exceptions/UnauthorizedException'
|
|
23
|
-
import { ValidationException } from './exceptions/ValidationException'
|
|
24
|
-
import { InvalidJsonException } from './exceptions/InvalidJsonException'
|
|
25
|
-
|
|
26
|
-
type RequestExceptionConstructor =
|
|
27
|
-
| typeof BadRequestException
|
|
28
|
-
| typeof MethodNotAllowedException
|
|
29
|
-
| typeof RequestTimeoutException
|
|
30
|
-
| typeof ConflictException
|
|
31
|
-
| typeof GoneException
|
|
32
|
-
| typeof PreconditionFailedException
|
|
33
|
-
| typeof PayloadTooLargeException
|
|
34
|
-
| typeof UnsupportedMediaTypeException
|
|
35
|
-
| typeof UnauthorizedException
|
|
36
|
-
| typeof ForbiddenException
|
|
37
|
-
| typeof NotFoundException
|
|
38
|
-
| typeof PageExpiredException
|
|
39
|
-
| typeof ValidationException
|
|
40
|
-
| typeof LockedException
|
|
41
|
-
| typeof TooManyRequestsException
|
|
42
|
-
| typeof ServerErrorException
|
|
43
|
-
| typeof NotImplementedException
|
|
44
|
-
| typeof BadGatewayException
|
|
45
|
-
| typeof ServiceUnavailableException
|
|
46
|
-
| typeof GatewayTimeoutException
|
|
47
|
-
| typeof NoResponseReceivedException
|
|
48
|
-
| typeof InvalidJsonException
|
|
49
|
-
| typeof ResponseBodyException
|
|
50
|
-
| typeof ResponseException
|
|
51
|
-
|
|
52
|
-
type ErrorHandlerCallback<T extends Error> = (error: T) => void | Promise<void>
|
|
53
|
-
|
|
54
|
-
type UnknownErrorHandlerCallback = (error: unknown) => void | Promise<void>
|
|
55
|
-
|
|
56
|
-
export class RequestErrorRouter {
|
|
57
|
-
protected handlers: Array<{ ctor: RequestExceptionConstructor; handler: ErrorHandlerCallback<Error> }> = []
|
|
58
|
-
protected defaultHandler: UnknownErrorHandlerCallback | undefined = undefined
|
|
59
|
-
|
|
60
|
-
public on<C extends RequestExceptionConstructor>(ctor: C, handler: ErrorHandlerCallback<InstanceType<C>>): this {
|
|
61
|
-
this.handlers.push({ ctor, handler: handler as ErrorHandlerCallback<Error> })
|
|
62
|
-
|
|
63
|
-
return this
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public otherwise(handler: UnknownErrorHandlerCallback): this {
|
|
67
|
-
this.defaultHandler = handler
|
|
68
|
-
|
|
69
|
-
return this
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public async handle(error: unknown): Promise<boolean> {
|
|
73
|
-
for (const entry of this.handlers) {
|
|
74
|
-
if (error instanceof entry.ctor) {
|
|
75
|
-
await entry.handler(error)
|
|
76
|
-
|
|
77
|
-
return true
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (this.defaultHandler !== undefined) {
|
|
82
|
-
await this.defaultHandler(error)
|
|
83
|
-
|
|
84
|
-
return true
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return false
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type BodyContent, type BodyContract } from '../contracts/BodyContract'
|
|
2
|
-
import { type HeadersContract } from '../contracts/HeadersContract'
|
|
3
|
-
|
|
4
|
-
export class BinaryBody<RequestBody extends Exclude<BodyContent, string | FormData>> implements BodyContract {
|
|
5
|
-
public constructor(
|
|
6
|
-
protected data: RequestBody,
|
|
7
|
-
protected contentType?: string
|
|
8
|
-
) {}
|
|
9
|
-
|
|
10
|
-
public getHeaders(): HeadersContract {
|
|
11
|
-
const contentType = this.resolveContentType()
|
|
12
|
-
|
|
13
|
-
return contentType === undefined ? {} : { 'Content-Type': contentType }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public getContent(): RequestBody {
|
|
17
|
-
return this.data
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
protected resolveContentType(): string | undefined {
|
|
21
|
-
if (this.contentType !== undefined) {
|
|
22
|
-
return this.contentType
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (typeof Blob !== 'undefined' && this.data instanceof Blob && this.data.type !== '') {
|
|
26
|
-
return this.data.type
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return undefined
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { type BodyContract } from '../contracts/BodyContract'
|
|
2
|
-
import { type HeadersContract } from '../contracts/HeadersContract'
|
|
3
|
-
import { isObject } from '../../support/helpers'
|
|
4
|
-
|
|
5
|
-
type FormDataPrimitive = string | number | boolean | null | Date | Blob
|
|
6
|
-
type FormDataValue = FormDataPrimitive | FormDataValue[] | { [key: string]: FormDataValue }
|
|
7
|
-
|
|
8
|
-
export class FormDataBody<RequestBody extends Record<string, FormDataValue | undefined>> implements BodyContract {
|
|
9
|
-
protected data: FormData
|
|
10
|
-
|
|
11
|
-
public constructor(data: RequestBody) {
|
|
12
|
-
this.data = this.toFormData(data)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public getContent(): FormData {
|
|
16
|
-
return this.data
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public getHeaders(): HeadersContract {
|
|
20
|
-
return {}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected toFormData(data: Record<string, FormDataValue | undefined>, form: FormData = new FormData(), namespace: string | null = null): FormData {
|
|
24
|
-
for (const property in data) {
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(data, property)) {
|
|
26
|
-
const formKey = namespace ? namespace + '[' + property + ']' : property
|
|
27
|
-
|
|
28
|
-
const value = data[property]
|
|
29
|
-
|
|
30
|
-
// Null is a valid "explicitly empty" value in many APIs.
|
|
31
|
-
// In multipart FormData we encode it as an empty string so the key is still present.
|
|
32
|
-
if (value === null) {
|
|
33
|
-
form.append(formKey, '')
|
|
34
|
-
continue
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Undefined values should not reach the request layer (BaseForm omits them).
|
|
38
|
-
// Reject explicitly to avoid silently dropping keys.
|
|
39
|
-
if (value === undefined) {
|
|
40
|
-
throw new Error('Unexpected value')
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (value instanceof Date) {
|
|
44
|
-
form.append(formKey, value.toISOString())
|
|
45
|
-
continue
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Support arrays via bracket notation: key[0], key[1], ...
|
|
49
|
-
if (Array.isArray(value)) {
|
|
50
|
-
for (let i = 0; i < value.length; i++) {
|
|
51
|
-
const indexed: Record<string, FormDataValue | undefined> = { [String(i)]: value[i] }
|
|
52
|
-
this.toFormData(indexed, form, formKey)
|
|
53
|
-
}
|
|
54
|
-
continue
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Files/Blobs should be appended directly (File extends Blob)
|
|
58
|
-
if (typeof Blob !== 'undefined' && value instanceof Blob) {
|
|
59
|
-
form.append(formKey, value)
|
|
60
|
-
continue
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// if the property is an object, use recursivity.
|
|
64
|
-
if (isObject(value)) {
|
|
65
|
-
this.toFormData(value as Record<string, FormDataValue | undefined>, form, formKey)
|
|
66
|
-
continue
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Primitives: append as strings
|
|
70
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
71
|
-
form.append(formKey, String(value))
|
|
72
|
-
continue
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
throw new Error('Unexpected value')
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return form
|
|
80
|
-
}
|
|
81
|
-
}
|