@blueprint-ts/core 4.1.0-beta.1 → 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.
Files changed (507) hide show
  1. package/dist/bulkRequests/BulkRequestEvent.enum.d.ts +4 -0
  2. package/dist/bulkRequests/BulkRequestEvent.enum.js +5 -0
  3. package/dist/bulkRequests/BulkRequestSender.d.ts +31 -0
  4. package/dist/bulkRequests/BulkRequestSender.js +161 -0
  5. package/dist/bulkRequests/BulkRequestWrapper.d.ts +15 -0
  6. package/dist/bulkRequests/BulkRequestWrapper.js +50 -0
  7. package/dist/bulkRequests/index.d.ts +5 -0
  8. package/dist/bulkRequests/index.js +5 -0
  9. package/{src/laravel/pagination/contracts/PaginationResponseBodyContract.ts → dist/laravel/pagination/contracts/PaginationResponseBodyContract.d.ts} +4 -4
  10. package/dist/laravel/pagination/contracts/PaginationResponseBodyContract.js +1 -0
  11. package/dist/laravel/pagination/dataDrivers/RequestDriver.d.ts +10 -0
  12. package/dist/laravel/pagination/dataDrivers/RequestDriver.js +18 -0
  13. package/dist/laravel/pagination/index.d.ts +4 -0
  14. package/dist/laravel/pagination/index.js +2 -0
  15. package/dist/laravel/requests/JsonBaseRequest.d.ts +14 -0
  16. package/dist/laravel/requests/JsonBaseRequest.js +15 -0
  17. package/dist/laravel/requests/PaginationJsonBaseRequest.d.ts +8 -0
  18. package/dist/laravel/requests/PaginationJsonBaseRequest.js +13 -0
  19. package/dist/laravel/requests/index.d.ts +7 -0
  20. package/dist/laravel/requests/index.js +5 -0
  21. package/dist/laravel/requests/responses/JsonResponse.d.ts +5 -0
  22. package/dist/laravel/requests/responses/JsonResponse.js +6 -0
  23. package/dist/laravel/requests/responses/PaginationResponse.d.ts +7 -0
  24. package/dist/laravel/requests/responses/PaginationResponse.js +9 -0
  25. package/dist/pagination/BasePaginator.d.ts +19 -0
  26. package/dist/pagination/BasePaginator.js +65 -0
  27. package/dist/pagination/InfiniteScroller.d.ts +6 -0
  28. package/dist/pagination/InfiniteScroller.js +17 -0
  29. package/dist/pagination/PageAwarePaginator.d.ts +32 -0
  30. package/dist/pagination/PageAwarePaginator.js +86 -0
  31. package/dist/pagination/StatePaginator.d.ts +25 -0
  32. package/dist/pagination/StatePaginator.js +55 -0
  33. package/dist/pagination/contracts/BaseViewDriverContract.d.ts +6 -0
  34. package/dist/pagination/contracts/BaseViewDriverContract.js +1 -0
  35. package/{src/pagination/contracts/BaseViewDriverFactoryContract.ts → dist/pagination/contracts/BaseViewDriverFactoryContract.d.ts} +2 -3
  36. package/dist/pagination/contracts/BaseViewDriverFactoryContract.js +1 -0
  37. package/dist/pagination/contracts/PaginateableRequestContract.d.ts +4 -0
  38. package/dist/pagination/contracts/PaginateableRequestContract.js +1 -0
  39. package/dist/pagination/contracts/PaginationDataDriverContract.d.ts +4 -0
  40. package/dist/pagination/contracts/PaginationDataDriverContract.js +1 -0
  41. package/{src/pagination/contracts/PaginationResponseContract.ts → dist/pagination/contracts/PaginationResponseContract.d.ts} +3 -5
  42. package/dist/pagination/contracts/PaginationResponseContract.js +1 -0
  43. package/{src/pagination/contracts/PaginatorLoadDataOptions.ts → dist/pagination/contracts/PaginatorLoadDataOptions.d.ts} +2 -2
  44. package/dist/pagination/contracts/PaginatorLoadDataOptions.js +1 -0
  45. package/{src/pagination/contracts/StatePaginationDataDriverContract.ts → dist/pagination/contracts/StatePaginationDataDriverContract.d.ts} +2 -3
  46. package/dist/pagination/contracts/StatePaginationDataDriverContract.js +1 -0
  47. package/dist/pagination/contracts/ViewDriverContract.d.ts +9 -0
  48. package/dist/pagination/contracts/ViewDriverContract.js +1 -0
  49. package/dist/pagination/contracts/ViewDriverFactoryContract.d.ts +4 -0
  50. package/dist/pagination/contracts/ViewDriverFactoryContract.js +1 -0
  51. package/dist/pagination/dataDrivers/ArrayDriver.d.ts +9 -0
  52. package/dist/pagination/dataDrivers/ArrayDriver.js +20 -0
  53. package/dist/pagination/dtos/PaginationDataDto.d.ts +7 -0
  54. package/dist/pagination/dtos/PaginationDataDto.js +12 -0
  55. package/dist/pagination/dtos/StatePaginationDataDto.d.ts +7 -0
  56. package/dist/pagination/dtos/StatePaginationDataDto.js +13 -0
  57. package/dist/pagination/factories/VueBaseViewDriverFactory.d.ts +5 -0
  58. package/dist/pagination/factories/VueBaseViewDriverFactory.js +6 -0
  59. package/dist/pagination/factories/VuePaginationDriverFactory.d.ts +5 -0
  60. package/dist/pagination/factories/VuePaginationDriverFactory.js +6 -0
  61. package/dist/pagination/frontendDrivers/VueBaseViewDriver.d.ts +11 -0
  62. package/dist/pagination/frontendDrivers/VueBaseViewDriver.js +19 -0
  63. package/dist/pagination/frontendDrivers/VuePaginationDriver.d.ts +21 -0
  64. package/dist/pagination/frontendDrivers/VuePaginationDriver.js +41 -0
  65. package/dist/pagination/index.d.ts +22 -0
  66. package/dist/pagination/index.js +13 -0
  67. package/dist/persistenceDrivers/LocalStorageDriver.d.ts +9 -0
  68. package/dist/persistenceDrivers/LocalStorageDriver.js +18 -0
  69. package/dist/persistenceDrivers/NonPersistentDriver.d.ts +7 -0
  70. package/dist/persistenceDrivers/NonPersistentDriver.js +8 -0
  71. package/dist/persistenceDrivers/SessionStorageDriver.d.ts +9 -0
  72. package/dist/persistenceDrivers/SessionStorageDriver.js +18 -0
  73. package/dist/persistenceDrivers/index.d.ts +6 -0
  74. package/dist/persistenceDrivers/index.js +4 -0
  75. package/dist/persistenceDrivers/types/PersistenceDriver.d.ts +5 -0
  76. package/dist/persistenceDrivers/types/PersistenceDriver.js +1 -0
  77. package/dist/requests/BaseRequest.d.ts +62 -0
  78. package/dist/requests/BaseRequest.js +224 -0
  79. package/dist/requests/ErrorHandler.d.ts +11 -0
  80. package/dist/requests/ErrorHandler.js +127 -0
  81. package/dist/requests/RequestConcurrencyMode.enum.d.ts +6 -0
  82. package/dist/requests/RequestConcurrencyMode.enum.js +7 -0
  83. package/dist/requests/RequestErrorRouter.d.ts +38 -0
  84. package/dist/requests/RequestErrorRouter.js +38 -0
  85. package/dist/requests/RequestEvents.enum.d.ts +4 -0
  86. package/dist/requests/RequestEvents.enum.js +5 -0
  87. package/dist/requests/RequestMethod.enum.d.ts +8 -0
  88. package/dist/requests/RequestMethod.enum.js +9 -0
  89. package/dist/requests/bodies/BinaryBody.d.ts +10 -0
  90. package/dist/requests/bodies/BinaryBody.js +22 -0
  91. package/dist/requests/bodies/FormDataBody.d.ts +14 -0
  92. package/dist/requests/bodies/FormDataBody.js +60 -0
  93. package/dist/requests/bodies/JsonBody.d.ts +8 -0
  94. package/dist/requests/bodies/JsonBody.js +13 -0
  95. package/{src/requests/contracts/AbortableRequestContract.ts → dist/requests/contracts/AbortableRequestContract.d.ts} +1 -1
  96. package/dist/requests/contracts/AbortableRequestContract.js +1 -0
  97. package/dist/requests/contracts/BaseRequestContract.d.ts +23 -0
  98. package/dist/requests/contracts/BaseRequestContract.js +1 -0
  99. package/dist/requests/contracts/BodyContract.d.ts +6 -0
  100. package/dist/requests/contracts/BodyContract.js +1 -0
  101. package/dist/requests/contracts/BodyFactoryContract.d.ts +4 -0
  102. package/dist/requests/contracts/BodyFactoryContract.js +1 -0
  103. package/dist/requests/contracts/DriverConfigContract.d.ts +8 -0
  104. package/dist/requests/contracts/DriverConfigContract.js +1 -0
  105. package/dist/requests/contracts/HeadersContract.d.ts +7 -0
  106. package/dist/requests/contracts/HeadersContract.js +1 -0
  107. package/dist/requests/contracts/RequestDriverContract.d.ts +8 -0
  108. package/dist/requests/contracts/RequestDriverContract.js +1 -0
  109. package/dist/requests/contracts/RequestLoaderContract.d.ts +4 -0
  110. package/dist/requests/contracts/RequestLoaderContract.js +1 -0
  111. package/{src/requests/contracts/RequestLoaderFactoryContract.ts → dist/requests/contracts/RequestLoaderFactoryContract.d.ts} +2 -3
  112. package/dist/requests/contracts/RequestLoaderFactoryContract.js +1 -0
  113. package/dist/requests/contracts/ResponseContract.d.ts +5 -0
  114. package/dist/requests/contracts/ResponseContract.js +1 -0
  115. package/dist/requests/drivers/contracts/ResponseHandlerContract.d.ts +9 -0
  116. package/dist/requests/drivers/contracts/ResponseHandlerContract.js +1 -0
  117. package/dist/requests/drivers/fetch/FetchDriver.d.ts +26 -0
  118. package/dist/requests/drivers/fetch/FetchDriver.js +73 -0
  119. package/dist/requests/drivers/fetch/FetchResponse.d.ts +12 -0
  120. package/dist/requests/drivers/fetch/FetchResponse.js +38 -0
  121. package/dist/requests/drivers/xhr/XMLHttpRequestDriver.d.ts +13 -0
  122. package/dist/requests/drivers/xhr/XMLHttpRequestDriver.js +107 -0
  123. package/dist/requests/drivers/xhr/XMLHttpRequestResponse.d.ts +17 -0
  124. package/dist/requests/drivers/xhr/XMLHttpRequestResponse.js +84 -0
  125. package/dist/requests/exceptions/BadGatewayException.d.ts +3 -0
  126. package/dist/requests/exceptions/BadGatewayException.js +3 -0
  127. package/dist/requests/exceptions/BadRequestException.d.ts +3 -0
  128. package/dist/requests/exceptions/BadRequestException.js +3 -0
  129. package/dist/requests/exceptions/ConflictException.d.ts +3 -0
  130. package/dist/requests/exceptions/ConflictException.js +3 -0
  131. package/dist/requests/exceptions/ForbiddenException.d.ts +3 -0
  132. package/dist/requests/exceptions/ForbiddenException.js +3 -0
  133. package/dist/requests/exceptions/GatewayTimeoutException.d.ts +3 -0
  134. package/dist/requests/exceptions/GatewayTimeoutException.js +3 -0
  135. package/dist/requests/exceptions/GoneException.d.ts +3 -0
  136. package/dist/requests/exceptions/GoneException.js +3 -0
  137. package/dist/requests/exceptions/InvalidJsonException.d.ts +7 -0
  138. package/dist/requests/exceptions/InvalidJsonException.js +10 -0
  139. package/dist/requests/exceptions/LockedException.d.ts +3 -0
  140. package/dist/requests/exceptions/LockedException.js +3 -0
  141. package/dist/requests/exceptions/MethodNotAllowedException.d.ts +3 -0
  142. package/dist/requests/exceptions/MethodNotAllowedException.js +3 -0
  143. package/dist/requests/exceptions/NoResponseReceivedException.d.ts +3 -0
  144. package/{src/requests/exceptions/NoResponseReceivedException.ts → dist/requests/exceptions/NoResponseReceivedException.js} +3 -3
  145. package/dist/requests/exceptions/NotFoundException.d.ts +3 -0
  146. package/dist/requests/exceptions/NotFoundException.js +3 -0
  147. package/dist/requests/exceptions/NotImplementedException.d.ts +3 -0
  148. package/dist/requests/exceptions/NotImplementedException.js +3 -0
  149. package/dist/requests/exceptions/PageExpiredException.d.ts +3 -0
  150. package/dist/requests/exceptions/PageExpiredException.js +3 -0
  151. package/dist/requests/exceptions/PayloadTooLargeException.d.ts +3 -0
  152. package/dist/requests/exceptions/PayloadTooLargeException.js +3 -0
  153. package/dist/requests/exceptions/PreconditionFailedException.d.ts +3 -0
  154. package/dist/requests/exceptions/PreconditionFailedException.js +3 -0
  155. package/dist/requests/exceptions/RequestTimeoutException.d.ts +3 -0
  156. package/dist/requests/exceptions/RequestTimeoutException.js +3 -0
  157. package/dist/requests/exceptions/ResponseBodyException.d.ts +7 -0
  158. package/dist/requests/exceptions/ResponseBodyException.js +10 -0
  159. package/dist/requests/exceptions/ResponseException.d.ts +6 -0
  160. package/dist/requests/exceptions/ResponseException.js +9 -0
  161. package/dist/requests/exceptions/ServerErrorException.d.ts +3 -0
  162. package/dist/requests/exceptions/ServerErrorException.js +3 -0
  163. package/dist/requests/exceptions/ServiceUnavailableException.d.ts +3 -0
  164. package/dist/requests/exceptions/ServiceUnavailableException.js +3 -0
  165. package/dist/requests/exceptions/StaleResponseException.d.ts +5 -0
  166. package/dist/requests/exceptions/StaleResponseException.js +10 -0
  167. package/dist/requests/exceptions/TooManyRequestsException.d.ts +3 -0
  168. package/dist/requests/exceptions/TooManyRequestsException.js +3 -0
  169. package/dist/requests/exceptions/UnauthorizedException.d.ts +3 -0
  170. package/dist/requests/exceptions/UnauthorizedException.js +3 -0
  171. package/dist/requests/exceptions/UnsupportedMediaTypeException.d.ts +3 -0
  172. package/dist/requests/exceptions/UnsupportedMediaTypeException.js +3 -0
  173. package/dist/requests/exceptions/ValidationException.d.ts +3 -0
  174. package/dist/requests/exceptions/ValidationException.js +3 -0
  175. package/dist/requests/exceptions/index.d.ts +25 -0
  176. package/dist/requests/exceptions/index.js +25 -0
  177. package/dist/requests/factories/BinaryBodyFactory.d.ts +8 -0
  178. package/dist/requests/factories/BinaryBodyFactory.js +9 -0
  179. package/dist/requests/factories/FormDataFactory.d.ts +12 -0
  180. package/dist/requests/factories/FormDataFactory.js +6 -0
  181. package/dist/requests/factories/JsonBodyFactory.d.ts +5 -0
  182. package/dist/requests/factories/JsonBodyFactory.js +6 -0
  183. package/dist/requests/index.d.ts +31 -0
  184. package/dist/requests/index.js +19 -0
  185. package/dist/requests/responses/BaseResponse.d.ts +14 -0
  186. package/dist/requests/responses/BaseResponse.js +36 -0
  187. package/dist/requests/responses/BlobResponse.d.ts +7 -0
  188. package/dist/requests/responses/BlobResponse.js +16 -0
  189. package/dist/requests/responses/JsonResponse.d.ts +5 -0
  190. package/dist/requests/responses/JsonResponse.js +12 -0
  191. package/dist/requests/responses/PlainTextResponse.d.ts +5 -0
  192. package/dist/requests/responses/PlainTextResponse.js +12 -0
  193. package/{src/requests/types/RequestConcurrencyOptions.ts → dist/requests/types/RequestConcurrencyOptions.d.ts} +4 -5
  194. package/dist/requests/types/RequestConcurrencyOptions.js +1 -0
  195. package/dist/requests/types/RequestUploadProgress.d.ts +6 -0
  196. package/dist/requests/types/RequestUploadProgress.js +1 -0
  197. package/dist/support/DeferredPromise.d.ts +37 -0
  198. package/dist/support/DeferredPromise.js +55 -0
  199. package/dist/support/helpers.d.ts +5 -0
  200. package/dist/support/helpers.js +69 -0
  201. package/{src/support/index.ts → dist/support/index.d.ts} +3 -4
  202. package/dist/support/index.js +3 -0
  203. package/dist/vue/composables/useConfirmDialog.d.ts +20 -0
  204. package/dist/vue/composables/useConfirmDialog.js +52 -0
  205. package/dist/vue/composables/useGlobalCheckbox.d.ts +13 -0
  206. package/dist/vue/composables/useGlobalCheckbox.js +123 -0
  207. package/dist/vue/composables/useIsEmpty.d.ts +4 -0
  208. package/dist/vue/composables/useIsEmpty.js +27 -0
  209. package/dist/vue/composables/useIsOpen.d.ts +5 -0
  210. package/dist/vue/composables/useIsOpen.js +25 -0
  211. package/dist/vue/composables/useIsOpenFromVar.d.ts +6 -0
  212. package/dist/vue/composables/useIsOpenFromVar.js +45 -0
  213. package/dist/vue/composables/useModelWrapper.d.ts +9 -0
  214. package/dist/vue/composables/useModelWrapper.js +18 -0
  215. package/dist/vue/composables/useOnOpen.d.ts +7 -0
  216. package/dist/vue/composables/useOnOpen.js +25 -0
  217. package/{src/vue/contracts/ModelValueOptions.ts → dist/vue/contracts/ModelValueOptions.d.ts} +1 -1
  218. package/dist/vue/contracts/ModelValueOptions.js +1 -0
  219. package/dist/vue/contracts/ModelValueProps.d.ts +3 -0
  220. package/dist/vue/contracts/ModelValueProps.js +1 -0
  221. package/dist/vue/forms/BaseForm.d.ts +162 -0
  222. package/dist/vue/forms/BaseForm.js +997 -0
  223. package/dist/vue/forms/PropertyAwareArray.d.ts +53 -0
  224. package/dist/vue/forms/PropertyAwareArray.js +54 -0
  225. package/{src/vue/forms/index.ts → dist/vue/forms/index.d.ts} +9 -11
  226. package/dist/vue/forms/index.js +6 -0
  227. package/dist/vue/forms/types/PersistedForm.d.ts +6 -0
  228. package/dist/vue/forms/types/PersistedForm.js +1 -0
  229. package/dist/vue/forms/validation/ValidationMode.enum.d.ts +11 -0
  230. package/dist/vue/forms/validation/ValidationMode.enum.js +14 -0
  231. package/dist/vue/forms/validation/index.d.ts +12 -0
  232. package/dist/vue/forms/validation/index.js +9 -0
  233. package/dist/vue/forms/validation/rules/BaseRule.d.ts +5 -0
  234. package/dist/vue/forms/validation/rules/BaseRule.js +5 -0
  235. package/dist/vue/forms/validation/rules/ConfirmedRule.d.ts +10 -0
  236. package/dist/vue/forms/validation/rules/ConfirmedRule.js +26 -0
  237. package/dist/vue/forms/validation/rules/EmailRule.d.ts +7 -0
  238. package/dist/vue/forms/validation/rules/EmailRule.js +19 -0
  239. package/dist/vue/forms/validation/rules/JsonRule.d.ts +7 -0
  240. package/dist/vue/forms/validation/rules/JsonRule.js +25 -0
  241. package/dist/vue/forms/validation/rules/MinRule.d.ts +26 -0
  242. package/dist/vue/forms/validation/rules/MinRule.js +52 -0
  243. package/dist/vue/forms/validation/rules/RequiredRule.d.ts +7 -0
  244. package/dist/vue/forms/validation/rules/RequiredRule.js +16 -0
  245. package/dist/vue/forms/validation/rules/UrlRule.d.ts +7 -0
  246. package/dist/vue/forms/validation/rules/UrlRule.js +22 -0
  247. package/{src/vue/forms/validation/types/BidirectionalRule.ts → dist/vue/forms/validation/types/BidirectionalRule.d.ts} +4 -4
  248. package/dist/vue/forms/validation/types/BidirectionalRule.js +1 -0
  249. package/dist/vue/forms/validation/types/ValidationRules.d.ts +11 -0
  250. package/dist/vue/forms/validation/types/ValidationRules.js +1 -0
  251. package/dist/vue/index.d.ts +11 -0
  252. package/dist/vue/index.js +10 -0
  253. package/dist/vue/requests/factories/VueRequestLoaderFactory.d.ts +6 -0
  254. package/dist/vue/requests/factories/VueRequestLoaderFactory.js +6 -0
  255. package/{src/vue/requests/index.ts → dist/vue/requests/index.d.ts} +4 -5
  256. package/dist/vue/requests/index.js +4 -0
  257. package/dist/vue/requests/loaders/VueRequestBatchLoader.d.ts +12 -0
  258. package/dist/vue/requests/loaders/VueRequestBatchLoader.js +29 -0
  259. package/dist/vue/requests/loaders/VueRequestLoader.d.ts +8 -0
  260. package/dist/vue/requests/loaders/VueRequestLoader.js +12 -0
  261. package/dist/vue/router/routeResourceBinding/RouteResourceBoundView.d.ts +57 -0
  262. package/dist/vue/router/routeResourceBinding/RouteResourceBoundView.js +135 -0
  263. package/dist/vue/router/routeResourceBinding/RouteResourceRequestResolver.d.ts +6 -0
  264. package/dist/vue/router/routeResourceBinding/RouteResourceRequestResolver.js +20 -0
  265. package/dist/vue/router/routeResourceBinding/defineRoute.d.ts +23 -0
  266. package/dist/vue/router/routeResourceBinding/defineRoute.js +42 -0
  267. package/dist/vue/router/routeResourceBinding/index.d.ts +8 -0
  268. package/dist/vue/router/routeResourceBinding/index.js +6 -0
  269. package/dist/vue/router/routeResourceBinding/installRouteInjection.d.ts +14 -0
  270. package/dist/vue/router/routeResourceBinding/installRouteInjection.js +133 -0
  271. package/dist/vue/router/routeResourceBinding/types.d.ts +55 -0
  272. package/dist/vue/router/routeResourceBinding/types.js +1 -0
  273. package/dist/vue/router/routeResourceBinding/useRouteResource.d.ts +8 -0
  274. package/dist/vue/router/routeResourceBinding/useRouteResource.js +29 -0
  275. package/dist/vue/state/State.d.ts +75 -0
  276. package/dist/vue/state/State.js +267 -0
  277. package/dist/vue/state/index.d.ts +2 -0
  278. package/dist/vue/state/index.js +2 -0
  279. package/package.json +81 -23
  280. package/.editorconfig +0 -508
  281. package/.eslintrc.cjs +0 -15
  282. package/.prettierrc.json +0 -8
  283. package/CHANGELOG.md +0 -213
  284. package/docker-compose.yaml +0 -8
  285. package/docs/.vitepress/config.ts +0 -124
  286. package/docs/index.md +0 -13
  287. package/docs/laravel/pagination.md +0 -67
  288. package/docs/laravel/requests.md +0 -62
  289. package/docs/services/pagination/index.md +0 -46
  290. package/docs/services/pagination/infinite-scroller.md +0 -20
  291. package/docs/services/pagination/page-aware.md +0 -51
  292. package/docs/services/pagination/state-pagination.md +0 -77
  293. package/docs/services/pagination/updating-rows.md +0 -52
  294. package/docs/services/persistence/index.md +0 -46
  295. package/docs/services/requests/abort-requests.md +0 -29
  296. package/docs/services/requests/bulk-requests.md +0 -70
  297. package/docs/services/requests/concurrency.md +0 -58
  298. package/docs/services/requests/drivers.md +0 -115
  299. package/docs/services/requests/error-handling.md +0 -153
  300. package/docs/services/requests/events.md +0 -53
  301. package/docs/services/requests/file-uploads.md +0 -105
  302. package/docs/services/requests/getting-started.md +0 -201
  303. package/docs/services/requests/headers.md +0 -40
  304. package/docs/services/requests/loading.md +0 -63
  305. package/docs/services/requests/request-bodies.md +0 -61
  306. package/docs/services/requests/responses.md +0 -34
  307. package/docs/services/support/deferred-promise.md +0 -63
  308. package/docs/services/support/helpers.md +0 -77
  309. package/docs/services/support/index.md +0 -6
  310. package/docs/upgrading/v1-to-v2.md +0 -64
  311. package/docs/upgrading/v2-to-v3.md +0 -52
  312. package/docs/upgrading/v3-to-v4.md +0 -214
  313. package/docs/upgrading.md +0 -0
  314. package/docs/vue/composables/use-confirm-dialog.md +0 -96
  315. package/docs/vue/composables/use-global-checkbox.md +0 -73
  316. package/docs/vue/composables/use-is-empty.md +0 -26
  317. package/docs/vue/composables/use-is-open-from-var.md +0 -32
  318. package/docs/vue/composables/use-is-open.md +0 -28
  319. package/docs/vue/composables/use-model-wrapper.md +0 -29
  320. package/docs/vue/composables/use-on-open.md +0 -26
  321. package/docs/vue/forms/arrays.md +0 -102
  322. package/docs/vue/forms/errors.md +0 -52
  323. package/docs/vue/forms/index.md +0 -99
  324. package/docs/vue/forms/payloads.md +0 -99
  325. package/docs/vue/forms/persistence.md +0 -19
  326. package/docs/vue/forms/state-and-properties.md +0 -26
  327. package/docs/vue/forms/utilities.md +0 -27
  328. package/docs/vue/forms/validation.md +0 -189
  329. package/docs/vue/requests/loading.md +0 -51
  330. package/docs/vue/router/route-resource-binding.md +0 -240
  331. package/docs/vue/state.md +0 -309
  332. package/env.d.ts +0 -1
  333. package/eslint.config.js +0 -15
  334. package/release-tool.json +0 -26
  335. package/src/bulkRequests/BulkRequestEvent.enum.ts +0 -4
  336. package/src/bulkRequests/BulkRequestSender.ts +0 -196
  337. package/src/bulkRequests/BulkRequestWrapper.ts +0 -49
  338. package/src/bulkRequests/index.ts +0 -6
  339. package/src/laravel/pagination/dataDrivers/RequestDriver.ts +0 -30
  340. package/src/laravel/pagination/index.ts +0 -6
  341. package/src/laravel/requests/JsonBaseRequest.ts +0 -35
  342. package/src/laravel/requests/PaginationJsonBaseRequest.ts +0 -29
  343. package/src/laravel/requests/index.ts +0 -9
  344. package/src/laravel/requests/responses/JsonResponse.ts +0 -8
  345. package/src/laravel/requests/responses/PaginationResponse.ts +0 -16
  346. package/src/pagination/BasePaginator.ts +0 -94
  347. package/src/pagination/InfiniteScroller.ts +0 -22
  348. package/src/pagination/PageAwarePaginator.ts +0 -132
  349. package/src/pagination/StatePaginator.ts +0 -86
  350. package/src/pagination/contracts/BaseViewDriverContract.ts +0 -6
  351. package/src/pagination/contracts/PaginateableRequestContract.ts +0 -13
  352. package/src/pagination/contracts/PaginationDataDriverContract.ts +0 -5
  353. package/src/pagination/contracts/ViewDriverContract.ts +0 -10
  354. package/src/pagination/contracts/ViewDriverFactoryContract.ts +0 -5
  355. package/src/pagination/dataDrivers/ArrayDriver.ts +0 -28
  356. package/src/pagination/dtos/PaginationDataDto.ts +0 -14
  357. package/src/pagination/dtos/StatePaginationDataDto.ts +0 -19
  358. package/src/pagination/factories/VueBaseViewDriverFactory.ts +0 -9
  359. package/src/pagination/factories/VuePaginationDriverFactory.ts +0 -9
  360. package/src/pagination/frontendDrivers/VueBaseViewDriver.ts +0 -28
  361. package/src/pagination/frontendDrivers/VuePaginationDriver.ts +0 -61
  362. package/src/pagination/index.ts +0 -46
  363. package/src/persistenceDrivers/LocalStorageDriver.ts +0 -22
  364. package/src/persistenceDrivers/NonPersistentDriver.ts +0 -12
  365. package/src/persistenceDrivers/SessionStorageDriver.ts +0 -22
  366. package/src/persistenceDrivers/index.ts +0 -8
  367. package/src/persistenceDrivers/types/PersistenceDriver.ts +0 -5
  368. package/src/requests/BaseRequest.ts +0 -321
  369. package/src/requests/ErrorHandler.ts +0 -144
  370. package/src/requests/RequestConcurrencyMode.enum.ts +0 -6
  371. package/src/requests/RequestErrorRouter.ts +0 -89
  372. package/src/requests/RequestEvents.enum.ts +0 -4
  373. package/src/requests/RequestMethod.enum.ts +0 -8
  374. package/src/requests/bodies/FormDataBody.ts +0 -81
  375. package/src/requests/bodies/JsonBody.ts +0 -16
  376. package/src/requests/contracts/BaseRequestContract.ts +0 -39
  377. package/src/requests/contracts/BodyContract.ts +0 -7
  378. package/src/requests/contracts/BodyFactoryContract.ts +0 -5
  379. package/src/requests/contracts/DriverConfigContract.ts +0 -9
  380. package/src/requests/contracts/HeadersContract.ts +0 -5
  381. package/src/requests/contracts/RequestDriverContract.ts +0 -15
  382. package/src/requests/contracts/RequestLoaderContract.ts +0 -5
  383. package/src/requests/contracts/ResponseContract.ts +0 -7
  384. package/src/requests/drivers/contracts/ResponseHandlerContract.ts +0 -10
  385. package/src/requests/drivers/fetch/FetchDriver.ts +0 -115
  386. package/src/requests/drivers/fetch/FetchResponse.ts +0 -30
  387. package/src/requests/drivers/xhr/XMLHttpRequestDriver.ts +0 -138
  388. package/src/requests/drivers/xhr/XMLHttpRequestResponse.ts +0 -95
  389. package/src/requests/exceptions/BadGatewayException.ts +0 -3
  390. package/src/requests/exceptions/BadRequestException.ts +0 -3
  391. package/src/requests/exceptions/ConflictException.ts +0 -3
  392. package/src/requests/exceptions/ForbiddenException.ts +0 -3
  393. package/src/requests/exceptions/GatewayTimeoutException.ts +0 -3
  394. package/src/requests/exceptions/GoneException.ts +0 -3
  395. package/src/requests/exceptions/InvalidJsonException.ts +0 -15
  396. package/src/requests/exceptions/LockedException.ts +0 -3
  397. package/src/requests/exceptions/MethodNotAllowedException.ts +0 -3
  398. package/src/requests/exceptions/NotFoundException.ts +0 -3
  399. package/src/requests/exceptions/NotImplementedException.ts +0 -3
  400. package/src/requests/exceptions/PageExpiredException.ts +0 -3
  401. package/src/requests/exceptions/PayloadTooLargeException.ts +0 -3
  402. package/src/requests/exceptions/PreconditionFailedException.ts +0 -3
  403. package/src/requests/exceptions/RequestTimeoutException.ts +0 -3
  404. package/src/requests/exceptions/ResponseBodyException.ts +0 -15
  405. package/src/requests/exceptions/ResponseException.ts +0 -11
  406. package/src/requests/exceptions/ServerErrorException.ts +0 -3
  407. package/src/requests/exceptions/ServiceUnavailableException.ts +0 -3
  408. package/src/requests/exceptions/StaleResponseException.ts +0 -13
  409. package/src/requests/exceptions/TooManyRequestsException.ts +0 -3
  410. package/src/requests/exceptions/UnauthorizedException.ts +0 -3
  411. package/src/requests/exceptions/UnsupportedMediaTypeException.ts +0 -3
  412. package/src/requests/exceptions/ValidationException.ts +0 -3
  413. package/src/requests/exceptions/index.ts +0 -51
  414. package/src/requests/factories/FormDataFactory.ts +0 -17
  415. package/src/requests/factories/JsonBodyFactory.ts +0 -9
  416. package/src/requests/index.ts +0 -61
  417. package/src/requests/responses/BaseResponse.ts +0 -41
  418. package/src/requests/responses/BlobResponse.ts +0 -19
  419. package/src/requests/responses/JsonResponse.ts +0 -15
  420. package/src/requests/responses/PlainTextResponse.ts +0 -15
  421. package/src/requests/types/RequestUploadProgress.ts +0 -6
  422. package/src/support/DeferredPromise.ts +0 -67
  423. package/src/support/helpers.ts +0 -78
  424. package/src/vue/composables/useConfirmDialog.ts +0 -63
  425. package/src/vue/composables/useGlobalCheckbox.ts +0 -145
  426. package/src/vue/composables/useIsEmpty.ts +0 -34
  427. package/src/vue/composables/useIsOpen.ts +0 -37
  428. package/src/vue/composables/useIsOpenFromVar.ts +0 -61
  429. package/src/vue/composables/useModelWrapper.ts +0 -27
  430. package/src/vue/composables/useOnOpen.ts +0 -34
  431. package/src/vue/contracts/ModelValueProps.ts +0 -3
  432. package/src/vue/forms/BaseForm.ts +0 -1192
  433. package/src/vue/forms/PropertyAwareArray.ts +0 -81
  434. package/src/vue/forms/types/PersistedForm.ts +0 -6
  435. package/src/vue/forms/validation/ValidationMode.enum.ts +0 -14
  436. package/src/vue/forms/validation/index.ts +0 -15
  437. package/src/vue/forms/validation/rules/BaseRule.ts +0 -7
  438. package/src/vue/forms/validation/rules/ConfirmedRule.ts +0 -39
  439. package/src/vue/forms/validation/rules/EmailRule.ts +0 -23
  440. package/src/vue/forms/validation/rules/JsonRule.ts +0 -28
  441. package/src/vue/forms/validation/rules/MinRule.ts +0 -61
  442. package/src/vue/forms/validation/rules/RequiredRule.ts +0 -19
  443. package/src/vue/forms/validation/rules/UrlRule.ts +0 -24
  444. package/src/vue/forms/validation/types/ValidationRules.ts +0 -15
  445. package/src/vue/index.ts +0 -14
  446. package/src/vue/requests/factories/VueRequestLoaderFactory.ts +0 -10
  447. package/src/vue/requests/loaders/VueRequestBatchLoader.ts +0 -35
  448. package/src/vue/requests/loaders/VueRequestLoader.ts +0 -18
  449. package/src/vue/router/routeResourceBinding/RouteResourceBoundView.ts +0 -145
  450. package/src/vue/router/routeResourceBinding/RouteResourceRequestResolver.ts +0 -11
  451. package/src/vue/router/routeResourceBinding/defineRoute.ts +0 -59
  452. package/src/vue/router/routeResourceBinding/index.ts +0 -11
  453. package/src/vue/router/routeResourceBinding/installRouteInjection.ts +0 -164
  454. package/src/vue/router/routeResourceBinding/types.ts +0 -53
  455. package/src/vue/router/routeResourceBinding/useRouteResource.ts +0 -24
  456. package/src/vue/state/State.ts +0 -380
  457. package/src/vue/state/index.ts +0 -3
  458. package/tests/service/bulkRequests/BulkRequestSender.test.ts +0 -76
  459. package/tests/service/bulkRequests/BulkRequestWrapper.test.ts +0 -51
  460. package/tests/service/helpers/mergeDeep.test.ts +0 -53
  461. package/tests/service/laravel/pagination/dataDrivers/RequestDriver.test.ts +0 -84
  462. package/tests/service/laravel/requests/JsonBaseRequest.test.ts +0 -43
  463. package/tests/service/laravel/requests/PaginationJsonBaseRequest.test.ts +0 -58
  464. package/tests/service/laravel/requests/responses/JsonResponse.test.ts +0 -59
  465. package/tests/service/laravel/requests/responses/PaginationResponse.test.ts +0 -127
  466. package/tests/service/pagination/BasePaginator.test.ts +0 -100
  467. package/tests/service/pagination/InfiniteScroller.test.ts +0 -101
  468. package/tests/service/pagination/PageAwarePaginator.test.ts +0 -133
  469. package/tests/service/pagination/StatePaginator.test.ts +0 -76
  470. package/tests/service/pagination/VueViewDrivers.test.ts +0 -46
  471. package/tests/service/pagination/dtos/PaginationDataDto.test.ts +0 -35
  472. package/tests/service/pagination/dtos/StatePaginationDataDto.test.ts +0 -14
  473. package/tests/service/pagination/factories/VuePaginationDriverFactory.test.ts +0 -32
  474. package/tests/service/pagination/frontendDrivers/VuePaginationDriver.test.ts +0 -66
  475. package/tests/service/persistenceDrivers/PersistenceDrivers.test.ts +0 -56
  476. package/tests/service/requests/BaseRequest.test.ts +0 -250
  477. package/tests/service/requests/BodiesAndFactories.test.ts +0 -28
  478. package/tests/service/requests/Enums.test.ts +0 -20
  479. package/tests/service/requests/ErrorHandler.test.ts +0 -188
  480. package/tests/service/requests/FormDataBody.test.ts +0 -63
  481. package/tests/service/requests/RequestErrorRouter.test.ts +0 -44
  482. package/tests/service/requests/Responses.test.ts +0 -83
  483. package/tests/service/requests/exceptions/Exceptions.test.ts +0 -43
  484. package/tests/service/requests/fetch/FetchDriver.test.ts +0 -76
  485. package/tests/service/requests/fetch/FetchResponse.test.ts +0 -21
  486. package/tests/service/requests/xhr/XMLHttpRequestDriver.test.ts +0 -178
  487. package/tests/service/support/DeferredPromise.test.ts +0 -40
  488. package/tests/service/support/helpers.test.ts +0 -37
  489. package/tests/vue/composables/useConfirmDialog.test.ts +0 -77
  490. package/tests/vue/composables/useGlobalCheckbox.test.ts +0 -126
  491. package/tests/vue/composables/useIsEmpty.test.ts +0 -18
  492. package/tests/vue/composables/useIsOpen.test.ts +0 -25
  493. package/tests/vue/composables/useIsOpenFromVar.test.ts +0 -22
  494. package/tests/vue/composables/useModelWrapper.test.ts +0 -30
  495. package/tests/vue/composables/useOnOpen.test.ts +0 -26
  496. package/tests/vue/forms/BaseForm.behavior.test.ts +0 -98
  497. package/tests/vue/forms/BaseForm.transformers.test.ts +0 -109
  498. package/tests/vue/forms/PropertyAwareArray.test.ts +0 -30
  499. package/tests/vue/forms/validation/ValidationRules.test.ts +0 -79
  500. package/tests/vue/requests/VueRequestLoaders.test.ts +0 -48
  501. package/tests/vue/router/routeResourceBinding/RouteResourceBoundView.test.ts +0 -344
  502. package/tests/vue/router/routeResourceBinding/RouteResourceUtils.test.ts +0 -70
  503. package/tests/vue/router/routeResourceBinding/installRouteInjection.test.ts +0 -450
  504. package/tests/vue/state/State.test.ts +0 -151
  505. package/tsconfig.json +0 -114
  506. package/vite.config.ts +0 -34
  507. package/vitest.config.ts +0 -23
@@ -1,52 +0,0 @@
1
- # Updating Rows
2
-
3
- All paginators (including `InfiniteScroller`) inherit `updateRows` from `BasePaginator`. It lets you update items in the
4
- current page data without reloading.
5
-
6
- ## Usage
7
-
8
- `updateRows` accepts:
9
-
10
- - a predicate to select rows
11
- - an updater to mutate or replace them
12
-
13
- ```typescript
14
- // Mark a single item as selected
15
- paginator.updateRows(
16
- (row) => row.id === targetId,
17
- (row) => {
18
- row.selected = true
19
- }
20
- )
21
-
22
- // Replace matching items with new objects
23
- paginator.updateRows(
24
- (row) => row.status === 'draft',
25
- (row) => ({ ...row, status: 'published' })
26
- )
27
- ```
28
-
29
- It returns the number of rows updated:
30
-
31
- ```typescript
32
- const updated = paginator.updateRows(
33
- (row) => row.id === targetId,
34
- (row) => ({ ...row, updatedAt: new Date().toISOString() })
35
- )
36
- ```
37
-
38
- ## Removing Rows
39
-
40
- Use `removeRows` to delete items from the current page data without reloading. By default it also decrements `total`
41
- by the number of removed rows. Set `adjustTotal: false` to skip that behavior.
42
-
43
- ```typescript
44
- // Remove a single item
45
- const removed = paginator.removeRows((row) => row.id === targetId)
46
-
47
- // Remove all drafts without adjusting total
48
- const removedDrafts = paginator.removeRows(
49
- (row) => row.status === 'draft',
50
- { adjustTotal: false }
51
- )
52
- ```
@@ -1,46 +0,0 @@
1
- # Persistence
2
-
3
- This service provides simple persistence drivers that implement a common `PersistenceDriver` interface. It is used by `BaseForm`, but can also be used directly.
4
-
5
- ## Available Drivers
6
-
7
- - `NonPersistentDriver` — no persistence (default for `BaseForm`)
8
- - `SessionStorageDriver` — uses `sessionStorage`
9
- - `LocalStorageDriver` — uses `localStorage`
10
-
11
- All drivers are exported from `@blueprint-ts/core/persistenceDrivers`.
12
-
13
- ## Using A Driver
14
-
15
- ```ts
16
- import { LocalStorageDriver } from '@blueprint-ts/core/persistenceDrivers'
17
-
18
- const driver = new LocalStorageDriver('optional-suffix')
19
-
20
- driver.set('my-key', { value: 123 })
21
- const value = driver.get<{ value: number }>('my-key')
22
- ```
23
-
24
- ## Implementing A Custom Driver
25
-
26
- Implement the `PersistenceDriver` interface:
27
-
28
- ```ts
29
- import { type PersistenceDriver } from '@blueprint-ts/core/persistenceDrivers'
30
-
31
- export class MemoryDriver implements PersistenceDriver {
32
- private store = new Map<string, unknown>()
33
-
34
- get<T>(key: string): T | null {
35
- return (this.store.get(key) as T) ?? null
36
- }
37
-
38
- set<T>(key: string, state: T): void {
39
- this.store.set(key, state)
40
- }
41
-
42
- remove(key: string): void {
43
- this.store.delete(key)
44
- }
45
- }
46
- ```
@@ -1,29 +0,0 @@
1
- # Aborting Requests
2
-
3
- Requests can be aborted by passing an `AbortSignal` to the request.
4
-
5
- If you want the request library to abort previous in-flight requests automatically, see [Concurrency](/services/requests/concurrency).
6
-
7
- ## Using AbortController
8
-
9
- ```typescript
10
- const controller = new AbortController()
11
-
12
- const request = new ExpenseIndexRequest()
13
- .setAbortSignal(controller.signal)
14
-
15
- const promise = request.send()
16
-
17
- // Later, when you want to abort:
18
- controller.abort()
19
- ```
20
-
21
- Note: If you enable request concurrency with `REPLACE` or `REPLACE_LATEST`, the request will assign its own abort signal and override this one. See [Concurrency](/services/requests/concurrency) for details.
22
-
23
- ## Bulk Requests
24
-
25
- `BulkRequestSender` internally manages an `AbortController` for its requests. You can abort the entire bulk operation:
26
-
27
- ```typescript
28
- bulkRequestSenderInstance.abort()
29
- ```
@@ -1,70 +0,0 @@
1
- # Bulk Requests
2
-
3
- Bulk requests let you send many requests together with a shared execution mode and retry policy.
4
-
5
- ## Basic Usage
6
-
7
- Wrap each request in a `BulkRequestWrapper`, then send them with `BulkRequestSender`:
8
-
9
- ```typescript
10
- import {
11
- BulkRequestExecutionMode,
12
- BulkRequestSender,
13
- BulkRequestWrapper,
14
- BulkRequestEventEnum
15
- } from '@blueprint-ts/core/bulkRequests'
16
-
17
- const requests = items.map((item) =>
18
- new BulkRequestWrapper(new DeleteRequest(item.id))
19
- )
20
-
21
- const sender = new BulkRequestSender(requests, BulkRequestExecutionMode.PARALLEL, 1)
22
-
23
- await sender
24
- .on(BulkRequestEventEnum.REQUEST_SUCCESSFUL, () => {
25
- // handle success
26
- })
27
- .on(BulkRequestEventEnum.REQUEST_FAILED, () => {
28
- // handle failure
29
- })
30
- .send()
31
- ```
32
-
33
- ## Wrapper State
34
-
35
- `BulkRequestWrapper` tracks per-request state so you can inspect individual results:
36
-
37
- - `wasSent()`
38
- - `hasError()`
39
- - `getError()`
40
- - `getResponse()`
41
-
42
- ## Sequential vs Parallel
43
-
44
- - `BulkRequestExecutionMode.PARALLEL` sends all requests at once.
45
- - `BulkRequestExecutionMode.SEQUENTIAL` sends requests one after another.
46
-
47
- ## Retries
48
-
49
- Pass a retry count to the sender to retry failed requests:
50
-
51
- ```typescript
52
- const sender = new BulkRequestSender(requests, BulkRequestExecutionMode.SEQUENTIAL, 2)
53
- ```
54
-
55
- ## Results
56
-
57
- `send()` resolves with a summary object:
58
-
59
- - `getSuccessCount()`
60
- - `getErrorCount()`
61
- - `getSuccessfulResponses()`
62
- - `getFailedResponses()`
63
-
64
- ## Reusing a Sender
65
-
66
- You can reuse a sender instance with a new set of requests:
67
-
68
- ```typescript
69
- sender.setRequests(nextRequests)
70
- ```
@@ -1,58 +0,0 @@
1
- # Request Concurrency
2
-
3
- Concurrent requests can cause two common problems:
4
-
5
- 1. A slower, older response overwrites newer data ("stale results").
6
- 2. Loading state flickers because earlier requests finish after later ones.
7
-
8
- To solve this, `BaseRequest` supports an optional concurrency policy that can abort older requests and/or ignore stale responses.
9
-
10
- ## Basic Usage
11
-
12
- ```typescript
13
- import { RequestConcurrencyMode } from '@blueprint-ts/core/requests'
14
-
15
- const request = new ExpenseIndexRequest()
16
-
17
- request.setConcurrency({
18
- mode: RequestConcurrencyMode.REPLACE_LATEST,
19
- key: 'expense-search'
20
- })
21
-
22
- request.send()
23
- ```
24
-
25
- ## Modes
26
-
27
- - `ALLOW` (default): no aborts and no stale-response filtering.
28
- - `REPLACE`: aborts any in-flight request with the same key.
29
- - `LATEST`: ignores stale responses; only the most recent response is applied.
30
- - `REPLACE_LATEST`: aborts older requests and ignores stale responses.
31
-
32
- ## Abort Signals
33
-
34
- When using `REPLACE` or `REPLACE_LATEST`, the request creates and assigns its own `AbortController` for the concurrency key. This replaces any previously configured abort signal on that request instance. If you need to preserve a custom abort signal, apply it per request without using replace modes.
35
-
36
- ## Keys
37
-
38
- The `key` lets you coordinate concurrency across multiple request instances. If you omit it, the request instance ID is used.
39
-
40
- Use a shared key when multiple instances represent the same logical request stream (for example, a search box that creates new request objects).
41
-
42
- ## Stale Responses
43
-
44
- When `LATEST` or `REPLACE_LATEST` is used, stale responses raise a `StaleResponseException` so the caller can ignore them safely.
45
-
46
- If you don't want to handle it explicitly, catch and ignore it:
47
-
48
- ```typescript
49
- import { StaleResponseException } from '@blueprint-ts/core/requests'
50
-
51
- request.send().catch((error) => {
52
- if (error instanceof StaleResponseException) {
53
- return
54
- }
55
-
56
- throw error
57
- })
58
- ```
@@ -1,115 +0,0 @@
1
- # Drivers
2
-
3
- Requests are executed by a request driver. The library includes a `FetchDriver`, an `XMLHttpRequestDriver`, and also
4
- lets you provide your own by implementing `RequestDriverContract`.
5
-
6
- ## Fetch Driver
7
-
8
- ```typescript
9
- import { BaseRequest, FetchDriver } from '@blueprint-ts/core/requests'
10
-
11
- BaseRequest.setRequestDriver(new FetchDriver())
12
- ```
13
-
14
- The `FetchDriver` supports:
15
-
16
- - Global headers
17
- - `corsWithCredentials` configuration
18
- - `AbortSignal` via request config
19
-
20
- ## XMLHttpRequest Driver
21
-
22
- Use `XMLHttpRequestDriver` when you need upload progress events for file uploads:
23
-
24
- ```typescript
25
- import { BaseRequest, XMLHttpRequestDriver } from '@blueprint-ts/core/requests'
26
-
27
- BaseRequest.setRequestDriver(new XMLHttpRequestDriver())
28
- ```
29
-
30
- It supports the same configuration as `FetchDriver` and additionally forwards upload progress through
31
- `RequestEvents.UPLOAD_PROGRESS`.
32
-
33
- That includes:
34
-
35
- - `corsWithCredentials`
36
- - `headers`
37
- - dynamic header callbacks such as `() => getCookie('XSRF-TOKEN')`
38
-
39
- ## Request-Defined Driver
40
-
41
- If a specific request class should always use a different driver, define it inside the request:
42
-
43
- ```typescript
44
- import {
45
- BaseRequest,
46
- FetchDriver,
47
- JsonResponse,
48
- RequestMethodEnum,
49
- XMLHttpRequestDriver
50
- } from '@blueprint-ts/core/requests'
51
-
52
- BaseRequest.setRequestDriver(new FetchDriver())
53
-
54
- class UploadAvatarRequest extends BaseRequest<boolean, { message: string }, { ok: true }, JsonResponse<{ ok: true }>> {
55
- public method(): RequestMethodEnum {
56
- return RequestMethodEnum.POST
57
- }
58
-
59
- public url(): string {
60
- return '/api/v1/avatar'
61
- }
62
-
63
- public getResponse(): JsonResponse<{ ok: true }> {
64
- return new JsonResponse<{ ok: true }>()
65
- }
66
-
67
- protected override getRequestDriver() {
68
- return new XMLHttpRequestDriver({
69
- corsWithCredentials: true,
70
- headers: {
71
- 'X-XSRF-TOKEN': () => getCookie('XSRF-TOKEN')
72
- }
73
- })
74
- }
75
- }
76
- ```
77
-
78
- This keeps the driver choice encapsulated inside the request class while still allowing the application to keep a
79
- global default driver for everything else.
80
-
81
- Important: request-defined drivers do not inherit configuration from the globally registered driver instance. If your
82
- upload request needs credential support or shared headers, configure them on the `XMLHttpRequestDriver` you return from
83
- `getRequestDriver()`.
84
-
85
- ## Custom Driver
86
-
87
- To implement your own driver, implement `RequestDriverContract` and return a `ResponseHandlerContract`:
88
-
89
- ```typescript
90
- import { type RequestDriverContract } from '@blueprint-ts/core/requests'
91
- import { type ResponseHandlerContract } from '@blueprint-ts/core/requests'
92
- import { type RequestMethodEnum } from '@blueprint-ts/core/requests'
93
- import { type HeadersContract } from '@blueprint-ts/core/requests'
94
- import { type BodyContract } from '@blueprint-ts/core/requests'
95
- import { type DriverConfigContract } from '@blueprint-ts/core/requests'
96
-
97
- class CustomDriver implements RequestDriverContract {
98
- public async send(
99
- url: URL | string,
100
- method: RequestMethodEnum,
101
- headers: HeadersContract,
102
- body?: BodyContract,
103
- requestConfig?: DriverConfigContract
104
- ): Promise<ResponseHandlerContract> {
105
- // Implement your transport here and return a ResponseHandlerContract.
106
- throw new Error('Not implemented')
107
- }
108
- }
109
- ```
110
-
111
- Register your driver during app boot:
112
-
113
- ```typescript
114
- BaseRequest.setRequestDriver(new CustomDriver())
115
- ```
@@ -1,153 +0,0 @@
1
- # Error Handling
2
-
3
- When a request fails, `BaseRequest.send()` routes error responses through the request error handler and throws a typed exception.
4
-
5
- ## Flow Overview
6
-
7
- - The request driver throws a `ResponseException` when it receives a non-OK response.
8
- - `BaseRequest.send()` catches that `ResponseException` and delegates to `ErrorHandler`.
9
- - `ErrorHandler` parses the response body with `response.json()` into the request's `ResponseErrorBody` generic.
10
- - If the parsed body is `undefined`, `NoResponseReceivedException` is thrown.
11
- - Otherwise, the handler maps the HTTP status to a specific exception and throws it.
12
- - If the error is not a `ResponseException`, `BaseRequest.send()` rethrows the original error.
13
-
14
- ## Catching Errors
15
-
16
- When using request concurrency (see [Concurrency](/services/requests/concurrency)), `BaseRequest` can throw a `StaleResponseException` for outdated responses. These should usually be ignored:
17
-
18
- ```typescript
19
- import { StaleResponseException } from '@blueprint-ts/core/requests'
20
-
21
- try {
22
- await request.send()
23
- } catch (error: unknown) {
24
- if (error instanceof StaleResponseException) {
25
- return
26
- }
27
-
28
- throw error
29
- }
30
- ```
31
-
32
- - `400` -> `BadRequestException`
33
- - `401` -> `UnauthorizedException`
34
- - `403` -> `ForbiddenException`
35
- - `404` -> `NotFoundException`
36
- - `405` -> `MethodNotAllowedException`
37
- - `408` -> `RequestTimeoutException`
38
- - `409` -> `ConflictException`
39
- - `410` -> `GoneException`
40
- - `412` -> `PreconditionFailedException`
41
- - `413` -> `PayloadTooLargeException`
42
- - `415` -> `UnsupportedMediaTypeException`
43
- - `419` -> `PageExpiredException`
44
- - `422` -> `ValidationException`
45
- - `423` -> `LockedException`
46
- - `429` -> `TooManyRequestsException`
47
- - `500` -> `ServerErrorException`
48
- - `501` -> `NotImplementedException`
49
- - `502` -> `BadGatewayException`
50
- - `503` -> `ServiceUnavailableException`
51
- - `504` -> `GatewayTimeoutException`
52
- - Any other status -> `ResponseException`
53
-
54
- All mapped exceptions extend `ResponseBodyException`, so they provide both `getResponse()` and `getBody()` accessors. `ResponseException` only exposes `getResponse()`.
55
- Error handling assumes error responses are JSON; if JSON parsing fails, an `InvalidJsonException` is thrown before status mapping runs.
56
-
57
- When handling errors, treat the caught error as `unknown` and narrow with `instanceof`:
58
-
59
- ```typescript
60
- import {
61
- ResponseException,
62
- ValidationException,
63
- UnauthorizedException
64
- } from '@blueprint-ts/core/requests/exceptions'
65
-
66
- try {
67
- await request.send()
68
- } catch (error: unknown) {
69
- if (error instanceof ValidationException) {
70
- const response = error.getResponse()
71
- const body = error.getBody()
72
- // Handle validation errors using response/body.
73
- } else if (error instanceof UnauthorizedException) {
74
- const response = error.getResponse()
75
- const body = error.getBody()
76
- // Handle auth errors using response/body.
77
- } else if (error instanceof ResponseException) {
78
- const response = error.getResponse()
79
- // Handle other response errors.
80
- }
81
- }
82
- ```
83
-
84
- If you prefer to avoid manual `instanceof` checks, use the fluent `RequestErrorRouter`:
85
-
86
- ```typescript
87
- import { RequestErrorRouter } from '@blueprint-ts/core/requests'
88
- import {
89
- ResponseException,
90
- ValidationException,
91
- UnauthorizedException
92
- } from '@blueprint-ts/core/requests/exceptions'
93
-
94
- try {
95
- await request.send()
96
- } catch (error: unknown) {
97
- await new RequestErrorRouter()
98
- .on(ValidationException, (exception) => {
99
- const response = exception.getResponse()
100
- const body = exception.getBody()
101
- // Handle validation errors using response/body.
102
- })
103
- .on(UnauthorizedException, (exception) => {
104
- const response = exception.getResponse()
105
- const body = exception.getBody()
106
- // Handle auth errors using response/body.
107
- })
108
- .on(ResponseException, (exception) => {
109
- const response = exception.getResponse()
110
- // Handle other response errors.
111
- })
112
- .otherwise((exception) => {
113
- // Handle non-response errors or rethrow.
114
- throw exception
115
- })
116
- .handle(error)
117
- }
118
- ```
119
-
120
- Handlers run in the order they are registered. Register specific exceptions before base types like `ResponseException`.
121
- `RequestErrorRouter.handle()` returns `true` when a handler ran and `false` when no handler matched, so you can rethrow or fall back if needed.
122
-
123
- ## Global Error Handling
124
-
125
- You can register a global handler that runs before the normal error mapping:
126
-
127
- ```typescript
128
- import { ErrorHandler } from '@blueprint-ts/core/requests'
129
-
130
- ErrorHandler.registerHandler((response) => {
131
- // Inspect response here.
132
- // Return false to indicate that normal handling should be skipped.
133
- })
134
- ```
135
-
136
- Note: the handler only aborts when it explicitly returns `false`. Returning `true`, `undefined`, or nothing continues normal error mapping.
137
-
138
- Example: redirect to login on `401` responses:
139
-
140
- ```typescript
141
- import { ErrorHandler } from '@blueprint-ts/core/requests'
142
- import { type ResponseHandlerContract } from '@blueprint-ts/core/requests'
143
-
144
- ErrorHandler.registerHandler((response: ResponseHandlerContract) => {
145
- if (response.getStatusCode() !== 401) {
146
- return
147
- }
148
-
149
- auth.logout()
150
-
151
- router.push({ name: 'login' })
152
- })
153
- ```
@@ -1,53 +0,0 @@
1
- # Events
2
-
3
- Requests can emit lifecycle events via `BaseRequest.on(...)`.
4
-
5
- ## Available Events
6
-
7
- - `RequestEvents.LOADING`: Emits `true` when a request starts and `false` when it finishes.
8
- - `RequestEvents.UPLOAD_PROGRESS`: Emits upload progress for drivers that support it, such as `XMLHttpRequestDriver`.
9
-
10
- ## Loading Event
11
-
12
- Use the `RequestEvents.LOADING` event to track request loading state:
13
-
14
- ```typescript
15
- import { RequestEvents } from '@blueprint-ts/core/requests'
16
-
17
- const request = new ExpenseIndexRequest()
18
-
19
- request.on(RequestEvents.LOADING, (isLoading: boolean) => {
20
- // Handle loading state
21
- })
22
-
23
- request.send()
24
- ```
25
-
26
- You can also pass the event payload type explicitly via the generic:
27
-
28
- ```typescript
29
- request.on<boolean>(RequestEvents.LOADING, (isLoading) => {
30
- // isLoading is typed as boolean
31
- })
32
- ```
33
-
34
- ## Upload Progress Event
35
-
36
- Use `RequestEvents.UPLOAD_PROGRESS` to drive file upload progress indicators:
37
-
38
- ```typescript
39
- import { RequestEvents, type RequestUploadProgress } from '@blueprint-ts/core/requests'
40
-
41
- request.on<RequestUploadProgress>(RequestEvents.UPLOAD_PROGRESS, (progress) => {
42
- console.log(progress.loaded, progress.total, progress.progress)
43
- })
44
- ```
45
-
46
- The payload contains:
47
-
48
- - `loaded`: Bytes uploaded so far.
49
- - `total`: Total bytes when the browser can compute it.
50
- - `lengthComputable`: Whether `total` is reliable.
51
- - `progress`: A normalized value between `0` and `1` when `total` is known.
52
-
53
- Note: The default `FetchDriver` does not emit upload progress. Use `XMLHttpRequestDriver` for upload progress support.
@@ -1,105 +0,0 @@
1
- # File Uploads
2
-
3
- Use `FormDataFactory` to build multipart payloads, and use `XMLHttpRequestDriver` when the consuming application needs
4
- upload progress for a progress bar.
5
-
6
- ## Request Definition
7
-
8
- ```typescript
9
- import {
10
- BaseRequest,
11
- FormDataFactory,
12
- JsonResponse,
13
- RequestMethodEnum,
14
- XMLHttpRequestDriver
15
- } from '@blueprint-ts/core/requests'
16
-
17
- interface UploadAvatarPayload {
18
- avatar: File
19
- }
20
-
21
- interface UploadAvatarResponse {
22
- id: string
23
- url: string
24
- }
25
-
26
- class UploadAvatarRequest extends BaseRequest<
27
- boolean,
28
- { message: string },
29
- UploadAvatarResponse,
30
- JsonResponse<UploadAvatarResponse>,
31
- UploadAvatarPayload
32
- > {
33
- public method(): RequestMethodEnum {
34
- return RequestMethodEnum.POST
35
- }
36
-
37
- public url(): string {
38
- return '/api/v1/avatar'
39
- }
40
-
41
- public getResponse(): JsonResponse<UploadAvatarResponse> {
42
- return new JsonResponse<UploadAvatarResponse>()
43
- }
44
-
45
- public override getRequestBodyFactory() {
46
- return new FormDataFactory<UploadAvatarPayload>()
47
- }
48
-
49
- protected override getRequestDriver() {
50
- return new XMLHttpRequestDriver({
51
- corsWithCredentials: true,
52
- headers: {
53
- 'X-XSRF-TOKEN': () => getCookie('XSRF-TOKEN')
54
- }
55
- })
56
- }
57
- }
58
- ```
59
-
60
- ## Global Default Driver
61
-
62
- You can keep `FetchDriver` as the application default. The upload request above will still use `XMLHttpRequestDriver`
63
- because it defines its own driver internally:
64
-
65
- ```typescript
66
- import { BaseRequest, FetchDriver } from '@blueprint-ts/core/requests'
67
-
68
- BaseRequest.setRequestDriver(new FetchDriver())
69
- ```
70
-
71
- Important: the upload request's `XMLHttpRequestDriver` does not inherit config from the global `FetchDriver`. If the
72
- upload request needs credentials or shared headers, define them on the `XMLHttpRequestDriver` returned by
73
- `getRequestDriver()`.
74
-
75
- ## Listening for Upload Progress
76
-
77
- ```typescript
78
- import { RequestEvents, type RequestUploadProgress } from '@blueprint-ts/core/requests'
79
-
80
- const request = new UploadAvatarRequest()
81
-
82
- request.on<RequestUploadProgress>(RequestEvents.UPLOAD_PROGRESS, (progress) => {
83
- if (!progress.lengthComputable || progress.progress === undefined) {
84
- return
85
- }
86
-
87
- progressBar.value = progress.progress * 100
88
- })
89
-
90
- await request.setBody({
91
- avatar: fileInput.files![0],
92
- }).send()
93
- ```
94
-
95
- ## Notes
96
-
97
- - Upload progress requires `XMLHttpRequestDriver`. The default `FetchDriver` does not emit upload progress events.
98
- - Define `XMLHttpRequestDriver` inside the upload request class when that request should always support progress.
99
- - `XMLHttpRequestDriver` supports the same `corsWithCredentials` and `headers` options as `FetchDriver`, including
100
- header callbacks.
101
- - Request-defined drivers do not automatically inherit config from the globally registered driver.
102
- - Some browsers cannot compute a reliable total size for every upload. Check `lengthComputable` before rendering a
103
- percentage.
104
- - Upload event listeners may cause CORS preflight requests on cross-origin uploads. Ensure the server is configured
105
- accordingly.