@wise/dynamic-flow-client 0.4.0 → 0.4.1

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 (465) hide show
  1. package/build/common/constants/DateMode.js +3 -2
  2. package/build/common/constants/DateMode.js.map +1 -0
  3. package/build/common/constants/FormControlType.js +3 -2
  4. package/build/common/constants/FormControlType.js.map +1 -0
  5. package/build/common/constants/MonthFormat.js +3 -2
  6. package/build/common/constants/MonthFormat.js.map +1 -0
  7. package/build/common/constants/SchemaType.js +3 -2
  8. package/build/common/constants/SchemaType.js.map +1 -0
  9. package/build/common/constants/Size.js +3 -2
  10. package/build/common/constants/Size.js.map +1 -0
  11. package/build/common/constants/index.js +2 -1
  12. package/build/common/constants/index.js.map +1 -0
  13. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +16 -27
  14. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js.map +1 -0
  15. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +12 -9
  16. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js.map +1 -0
  17. package/build/common/contexts/eventsContext/EventsContext.js +12 -28
  18. package/build/common/contexts/eventsContext/EventsContext.js.map +1 -0
  19. package/build/common/contexts/fetcherContexts/FetcherContexts.js +15 -27
  20. package/build/common/contexts/fetcherContexts/FetcherContexts.js.map +1 -0
  21. package/build/common/contexts/index.js +2 -1
  22. package/build/common/contexts/index.js.map +1 -0
  23. package/build/common/contexts/logContext/LogContext.js +13 -30
  24. package/build/common/contexts/logContext/LogContext.js.map +1 -0
  25. package/build/common/hooks/index.js +2 -1
  26. package/build/common/hooks/index.js.map +1 -0
  27. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +4 -3
  28. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js.map +1 -0
  29. package/build/common/hooks/useExternal/useExternal.js +9 -8
  30. package/build/common/hooks/useExternal/useExternal.js.map +1 -0
  31. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +21 -31
  32. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js.map +1 -0
  33. package/build/common/hooks/usePersistAsync/usePersistAsync.js +61 -139
  34. package/build/common/hooks/usePersistAsync/usePersistAsync.js.map +1 -0
  35. package/build/common/hooks/usePolling/usePolling.js +21 -21
  36. package/build/common/hooks/usePolling/usePolling.js.map +1 -0
  37. package/build/common/hooks/usePrevious/usePrevious.js +6 -5
  38. package/build/common/hooks/usePrevious/usePrevious.js.map +1 -0
  39. package/build/common/hooks/useStepPolling/useStepPolling.js +16 -14
  40. package/build/common/hooks/useStepPolling/useStepPolling.js.map +1 -0
  41. package/build/common/makeFetcher/index.js +2 -1
  42. package/build/common/makeFetcher/index.js.map +1 -0
  43. package/build/common/makeFetcher/makeFetcher.js +11 -24
  44. package/build/common/makeFetcher/makeFetcher.js.map +1 -0
  45. package/build/common/messages.js +6 -5
  46. package/build/common/messages.js.map +1 -0
  47. package/build/common/utils/api-utils.js +4 -4
  48. package/build/common/utils/api-utils.js.map +1 -0
  49. package/build/common/utils/date-utils.js +12 -11
  50. package/build/common/utils/date-utils.js.map +1 -0
  51. package/build/common/utils/debounce.js +12 -15
  52. package/build/common/utils/debounce.js.map +1 -0
  53. package/build/common/utils/file-utils.js +13 -25
  54. package/build/common/utils/file-utils.js.map +1 -0
  55. package/build/common/utils/id-utils.js +5 -5
  56. package/build/common/utils/id-utils.js.map +1 -0
  57. package/build/common/utils/index.js +2 -1
  58. package/build/common/utils/index.js.map +1 -0
  59. package/build/common/utils/is-equal.js +9 -8
  60. package/build/common/utils/is-equal.js.map +1 -0
  61. package/build/common/utils/schema-utils.js +7 -6
  62. package/build/common/utils/schema-utils.js.map +1 -0
  63. package/build/common/utils/step-utils.js +15 -14
  64. package/build/common/utils/step-utils.js.map +1 -0
  65. package/build/common/validators/index.js +8 -7
  66. package/build/common/validators/index.js.map +1 -0
  67. package/build/common/validators/models/model-validators.js +9 -8
  68. package/build/common/validators/models/model-validators.js.map +1 -0
  69. package/build/common/validators/models/models.utils.js +30 -42
  70. package/build/common/validators/models/models.utils.js.map +1 -0
  71. package/build/common/validators/schemas/schema-validators.js +12 -13
  72. package/build/common/validators/schemas/schema-validators.js.map +1 -0
  73. package/build/common/validators/types/type-validators.js +10 -13
  74. package/build/common/validators/types/type-validators.js.map +1 -0
  75. package/build/common/validators/validationFailures/validation-failures.js +15 -14
  76. package/build/common/validators/validationFailures/validation-failures.js.map +1 -0
  77. package/build/common/validators/validationFailures/validation-failures.utils.js +6 -7
  78. package/build/common/validators/validationFailures/validation-failures.utils.js.map +1 -0
  79. package/build/common/validators/values/value-validators.js +5 -6
  80. package/build/common/validators/values/value-validators.js.map +1 -0
  81. package/build/dynamicFlow/DynamicFlow.js +186 -307
  82. package/build/dynamicFlow/DynamicFlow.js.map +1 -0
  83. package/build/dynamicFlow/DynamicFlowStep.js +13 -23
  84. package/build/dynamicFlow/DynamicFlowStep.js.map +1 -0
  85. package/build/dynamicFlow/DynamicFlowTypes.js +2 -1
  86. package/build/dynamicFlow/DynamicFlowTypes.js.map +1 -0
  87. package/build/dynamicFlow/index.js +7 -14
  88. package/build/dynamicFlow/index.js.map +1 -0
  89. package/build/dynamicFlow/stories/DynamicFlow.story.js +21 -20
  90. package/build/dynamicFlow/stories/DynamicFlow.story.js.map +1 -0
  91. package/build/dynamicFlow/stories/EditableDynamicFlow.js +21 -33
  92. package/build/dynamicFlow/stories/EditableDynamicFlow.js.map +1 -0
  93. package/build/dynamicFlow/stories/fixtureFetcher.js +47 -104
  94. package/build/dynamicFlow/stories/fixtureFetcher.js.map +1 -0
  95. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +23 -40
  96. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js.map +1 -0
  97. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +7 -6
  98. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js.map +1 -0
  99. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +11 -11
  100. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js.map +1 -0
  101. package/build/dynamicFlow/utils/index.js +6 -2
  102. package/build/dynamicFlow/utils/index.js.map +1 -0
  103. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +54 -118
  104. package/build/dynamicFlow/utils/responseParsers/response-parsers.js.map +1 -0
  105. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +10 -9
  106. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js.map +1 -0
  107. package/build/dynamicFlow/utils/useDynamicFlowState.js +52 -74
  108. package/build/dynamicFlow/utils/useDynamicFlowState.js.map +1 -0
  109. package/build/dynamicFlow/utils/useLoader.js +10 -20
  110. package/build/dynamicFlow/utils/useLoader.js.map +1 -0
  111. package/build/fixtures/components/alert.js +9 -8
  112. package/build/fixtures/components/alert.js.map +1 -0
  113. package/build/fixtures/components/box.js +8 -7
  114. package/build/fixtures/components/box.js.map +1 -0
  115. package/build/fixtures/components/button.js +26 -36
  116. package/build/fixtures/components/button.js.map +1 -0
  117. package/build/fixtures/components/columns.js +11 -10
  118. package/build/fixtures/components/columns.js.map +1 -0
  119. package/build/fixtures/components/copyable.js +7 -6
  120. package/build/fixtures/components/copyable.js.map +1 -0
  121. package/build/fixtures/components/decision.js +16 -15
  122. package/build/fixtures/components/decision.js.map +1 -0
  123. package/build/fixtures/components/heading.js +8 -7
  124. package/build/fixtures/components/heading.js.map +1 -0
  125. package/build/fixtures/components/image.js +11 -10
  126. package/build/fixtures/components/image.js.map +1 -0
  127. package/build/fixtures/components/index.js +18 -25
  128. package/build/fixtures/components/index.js.map +1 -0
  129. package/build/fixtures/components/info.js +23 -6
  130. package/build/fixtures/components/info.js.map +1 -0
  131. package/build/fixtures/components/list.js +9 -8
  132. package/build/fixtures/components/list.js.map +1 -0
  133. package/build/fixtures/components/loading-indicator.js +6 -5
  134. package/build/fixtures/components/loading-indicator.js.map +1 -0
  135. package/build/fixtures/components/paragraph.js +10 -9
  136. package/build/fixtures/components/paragraph.js.map +1 -0
  137. package/build/fixtures/components/review.js +12 -11
  138. package/build/fixtures/components/review.js.map +1 -0
  139. package/build/fixtures/examples/camera-capture.js +30 -29
  140. package/build/fixtures/examples/camera-capture.js.map +1 -0
  141. package/build/fixtures/examples/index.js +10 -17
  142. package/build/fixtures/examples/index.js.map +1 -0
  143. package/build/fixtures/examples/recipient-update.js +70 -69
  144. package/build/fixtures/examples/recipient-update.js.map +1 -0
  145. package/build/fixtures/examples/recipient.js +64 -63
  146. package/build/fixtures/examples/recipient.js.map +1 -0
  147. package/build/fixtures/examples/single-file-upload.js +22 -21
  148. package/build/fixtures/examples/single-file-upload.js.map +1 -0
  149. package/build/fixtures/examples/step-validation-errors.js +22 -21
  150. package/build/fixtures/examples/step-validation-errors.js.map +1 -0
  151. package/build/fixtures/features/action-response.js +9 -8
  152. package/build/fixtures/features/action-response.js.map +1 -0
  153. package/build/fixtures/features/external.js +9 -8
  154. package/build/fixtures/features/external.js.map +1 -0
  155. package/build/fixtures/features/index.js +10 -17
  156. package/build/fixtures/features/index.js.map +1 -0
  157. package/build/fixtures/features/persist-async.js +12 -11
  158. package/build/fixtures/features/persist-async.js.map +1 -0
  159. package/build/fixtures/features/polling.js +10 -9
  160. package/build/fixtures/features/polling.js.map +1 -0
  161. package/build/fixtures/features/validation-async.js +11 -10
  162. package/build/fixtures/features/validation-async.js.map +1 -0
  163. package/build/fixtures/index.js +12 -22
  164. package/build/fixtures/index.js.map +1 -0
  165. package/build/fixtures/jsonSchemaForm/allOf.js +31 -30
  166. package/build/fixtures/jsonSchemaForm/allOf.js.map +1 -0
  167. package/build/fixtures/jsonSchemaForm/audRecipient.js +272 -271
  168. package/build/fixtures/jsonSchemaForm/audRecipient.js.map +1 -0
  169. package/build/fixtures/jsonSchemaForm/currency.js +13 -12
  170. package/build/fixtures/jsonSchemaForm/currency.js.map +1 -0
  171. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +12 -11
  172. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js.map +1 -0
  173. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +12 -11
  174. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js.map +1 -0
  175. package/build/fixtures/jsonSchemaForm/oneOf.js +28 -27
  176. package/build/fixtures/jsonSchemaForm/oneOf.js.map +1 -0
  177. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +17 -16
  178. package/build/fixtures/jsonSchemaForm/oneOfTabs.js.map +1 -0
  179. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +18 -17
  180. package/build/fixtures/jsonSchemaForm/promotedOneOf.js.map +1 -0
  181. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +31 -30
  182. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js.map +1 -0
  183. package/build/fixtures/jsonSchemaForm/simple.js +17 -16
  184. package/build/fixtures/jsonSchemaForm/simple.js.map +1 -0
  185. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +20 -19
  186. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js.map +1 -0
  187. package/build/fixtures/jsonSchemaForm/validationAsync.js +9 -8
  188. package/build/fixtures/jsonSchemaForm/validationAsync.js.map +1 -0
  189. package/build/fixtures/layouts/all.js +38 -37
  190. package/build/fixtures/layouts/all.js.map +1 -0
  191. package/build/fixtures/layouts/final-step-layout.js +10 -9
  192. package/build/fixtures/layouts/final-step-layout.js.map +1 -0
  193. package/build/fixtures/layouts/index.js +11 -18
  194. package/build/fixtures/layouts/index.js.map +1 -0
  195. package/build/fixtures/layouts/list.js +11 -10
  196. package/build/fixtures/layouts/list.js.map +1 -0
  197. package/build/fixtures/layouts/pay-in.js +24 -23
  198. package/build/fixtures/layouts/pay-in.js.map +1 -0
  199. package/build/fixtures/layouts/review.js +39 -38
  200. package/build/fixtures/layouts/review.js.map +1 -0
  201. package/build/fixtures/layouts/success.js +16 -15
  202. package/build/fixtures/layouts/success.js.map +1 -0
  203. package/build/fixtures/responses/action-response-final.js +9 -8
  204. package/build/fixtures/responses/action-response-final.js.map +1 -0
  205. package/build/fixtures/responses/action.js +4 -3
  206. package/build/fixtures/responses/action.js.map +1 -0
  207. package/build/fixtures/responses/exit.js +4 -3
  208. package/build/fixtures/responses/exit.js.map +1 -0
  209. package/build/fixtures/responses/index.js +9 -16
  210. package/build/fixtures/responses/index.js.map +1 -0
  211. package/build/fixtures/responses/recipient-update-final.js +9 -8
  212. package/build/fixtures/responses/recipient-update-final.js.map +1 -0
  213. package/build/fixtures/schemas/basic-form.js +12 -11
  214. package/build/fixtures/schemas/basic-form.js.map +1 -0
  215. package/build/fixtures/schemas/index.js +9 -16
  216. package/build/fixtures/schemas/index.js.map +1 -0
  217. package/build/fixtures/schemas/number-and-integer.js +12 -11
  218. package/build/fixtures/schemas/number-and-integer.js.map +1 -0
  219. package/build/fixtures/schemas/one-of.js +44 -46
  220. package/build/fixtures/schemas/one-of.js.map +1 -0
  221. package/build/fixtures/schemas/string-formats.js +16 -15
  222. package/build/fixtures/schemas/string-formats.js.map +1 -0
  223. package/build/fixtures/utils/image-util.js +9 -8
  224. package/build/fixtures/utils/image-util.js.map +1 -0
  225. package/build/formControl/FormControl.js +119 -148
  226. package/build/formControl/FormControl.js.map +1 -0
  227. package/build/formControl/index.js +7 -14
  228. package/build/formControl/index.js.map +1 -0
  229. package/build/formControl/utils/index.js +2 -1
  230. package/build/formControl/utils/index.js.map +1 -0
  231. package/build/formControl/utils/value-utils.js +19 -23
  232. package/build/formControl/utils/value-utils.js.map +1 -0
  233. package/build/i18n/index.js +32 -31
  234. package/build/i18n/index.js.map +1 -0
  235. package/build/index.js +14 -10
  236. package/build/index.js.map +1 -0
  237. package/build/jsonSchemaForm/JsonSchemaForm.js +13 -24
  238. package/build/jsonSchemaForm/JsonSchemaForm.js.map +1 -0
  239. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +25 -37
  240. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js.map +1 -0
  241. package/build/jsonSchemaForm/allOfSchema/index.js +7 -14
  242. package/build/jsonSchemaForm/allOfSchema/index.js.map +1 -0
  243. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +10 -20
  244. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js.map +1 -0
  245. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +10 -20
  246. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js.map +1 -0
  247. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +7 -14
  248. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js.map +1 -0
  249. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +57 -115
  250. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js.map +1 -0
  251. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +8 -7
  252. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js.map +1 -0
  253. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +7 -14
  254. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js.map +1 -0
  255. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -1
  256. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js.map +1 -0
  257. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +20 -71
  258. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js.map +1 -0
  259. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +11 -11
  260. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js.map +1 -0
  261. package/build/jsonSchemaForm/arrayTypeSchema/index.js +7 -14
  262. package/build/jsonSchemaForm/arrayTypeSchema/index.js.map +1 -0
  263. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +46 -62
  264. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js.map +1 -0
  265. package/build/jsonSchemaForm/basicTypeSchema/index.js +7 -14
  266. package/build/jsonSchemaForm/basicTypeSchema/index.js.map +1 -0
  267. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +40 -50
  268. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js.map +1 -0
  269. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +19 -18
  270. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js.map +1 -0
  271. package/build/jsonSchemaForm/controlFeedback/index.js +7 -14
  272. package/build/jsonSchemaForm/controlFeedback/index.js.map +1 -0
  273. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +53 -61
  274. package/build/jsonSchemaForm/genericSchema/GenericSchema.js.map +1 -0
  275. package/build/jsonSchemaForm/genericSchema/index.js +7 -14
  276. package/build/jsonSchemaForm/genericSchema/index.js.map +1 -0
  277. package/build/jsonSchemaForm/help/Help.js +10 -9
  278. package/build/jsonSchemaForm/help/Help.js.map +1 -0
  279. package/build/jsonSchemaForm/help/Help.messages.js +6 -5
  280. package/build/jsonSchemaForm/help/Help.messages.js.map +1 -0
  281. package/build/jsonSchemaForm/help/index.js +7 -14
  282. package/build/jsonSchemaForm/help/index.js.map +1 -0
  283. package/build/jsonSchemaForm/index.js +7 -14
  284. package/build/jsonSchemaForm/index.js.map +1 -0
  285. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +29 -49
  286. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js.map +1 -0
  287. package/build/jsonSchemaForm/objectSchema/index.js +7 -14
  288. package/build/jsonSchemaForm/objectSchema/index.js.map +1 -0
  289. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +55 -74
  290. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js.map +1 -0
  291. package/build/jsonSchemaForm/oneOfSchema/index.js +7 -14
  292. package/build/jsonSchemaForm/oneOfSchema/index.js.map +1 -0
  293. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +4 -3
  294. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js.map +1 -0
  295. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +2 -1
  296. package/build/jsonSchemaForm/oneOfSchema/utils/index.js.map +1 -0
  297. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +20 -20
  298. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js.map +1 -0
  299. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +12 -22
  300. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js.map +1 -0
  301. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +6 -5
  302. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js.map +1 -0
  303. package/build/jsonSchemaForm/persistAsyncSchema/index.js +7 -14
  304. package/build/jsonSchemaForm/persistAsyncSchema/index.js.map +1 -0
  305. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +74 -127
  306. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js.map +1 -0
  307. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +7 -14
  308. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js.map +1 -0
  309. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +46 -110
  310. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js.map +1 -0
  311. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +18 -17
  312. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js.map +1 -0
  313. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +7 -14
  314. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js.map +1 -0
  315. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +29 -47
  316. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js.map +1 -0
  317. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +7 -14
  318. package/build/jsonSchemaForm/promotedOneOfSchema/index.js.map +1 -0
  319. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +5 -4
  320. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js.map +1 -0
  321. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +14 -24
  322. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js.map +1 -0
  323. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +12 -22
  324. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js.map +1 -0
  325. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +13 -23
  326. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js.map +1 -0
  327. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +25 -26
  328. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js.map +1 -0
  329. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +7 -6
  330. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js.map +1 -0
  331. package/build/jsonSchemaForm/readOnlySchema/index.js +7 -14
  332. package/build/jsonSchemaForm/readOnlySchema/index.js.map +1 -0
  333. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +27 -39
  334. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js.map +1 -0
  335. package/build/jsonSchemaForm/schemaFormControl/index.js +7 -14
  336. package/build/jsonSchemaForm/schemaFormControl/index.js.map +1 -0
  337. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +6 -5
  338. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js.map +1 -0
  339. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +2 -1
  340. package/build/jsonSchemaForm/schemaFormControl/utils/index.js.map +1 -0
  341. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +31 -47
  342. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js.map +1 -0
  343. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +58 -119
  344. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js.map +1 -0
  345. package/build/jsonSchemaForm/validationAsyncSchema/index.js +7 -14
  346. package/build/jsonSchemaForm/validationAsyncSchema/index.js.map +1 -0
  347. package/build/layout/DynamicLayout.js +11 -21
  348. package/build/layout/DynamicLayout.js.map +1 -0
  349. package/build/layout/alert/DynamicAlert.js +10 -9
  350. package/build/layout/alert/DynamicAlert.js.map +1 -0
  351. package/build/layout/box/DynamicBox.js +13 -23
  352. package/build/layout/box/DynamicBox.js.map +1 -0
  353. package/build/layout/button/DynamicButton.js +17 -27
  354. package/build/layout/button/DynamicButton.js.map +1 -0
  355. package/build/layout/columns/DynamicColumns.js +14 -24
  356. package/build/layout/columns/DynamicColumns.js.map +1 -0
  357. package/build/layout/decision/DynamicDecision.js +17 -27
  358. package/build/layout/decision/DynamicDecision.js.map +1 -0
  359. package/build/layout/divider/DynamicDivider.js +8 -8
  360. package/build/layout/divider/DynamicDivider.js.map +1 -0
  361. package/build/layout/external/DynamicExternal.js +17 -28
  362. package/build/layout/external/DynamicExternal.js.map +1 -0
  363. package/build/layout/external/DynamicExternal.messages.js +6 -5
  364. package/build/layout/external/DynamicExternal.messages.js.map +1 -0
  365. package/build/layout/form/DynamicForm.js +11 -21
  366. package/build/layout/form/DynamicForm.js.map +1 -0
  367. package/build/layout/heading/DynamicHeading.js +13 -23
  368. package/build/layout/heading/DynamicHeading.js.map +1 -0
  369. package/build/layout/icon/DynamicIcon.js +10 -10
  370. package/build/layout/icon/DynamicIcon.js.map +1 -0
  371. package/build/layout/image/DynamicImage.js +44 -93
  372. package/build/layout/image/DynamicImage.js.map +1 -0
  373. package/build/layout/index.js +22 -29
  374. package/build/layout/index.js.map +1 -0
  375. package/build/layout/info/DynamicInfo.js +8 -19
  376. package/build/layout/info/DynamicInfo.js.map +1 -0
  377. package/build/layout/list/DynamicList.js +15 -26
  378. package/build/layout/list/DynamicList.js.map +1 -0
  379. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +9 -9
  380. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js.map +1 -0
  381. package/build/layout/paragraph/DynamicParagraph.js +20 -37
  382. package/build/layout/paragraph/DynamicParagraph.js.map +1 -0
  383. package/build/layout/paragraph/DynamicParagraph.messages.js +7 -6
  384. package/build/layout/paragraph/DynamicParagraph.messages.js.map +1 -0
  385. package/build/layout/paragraph/useSnackBarIfAvailable.js +5 -4
  386. package/build/layout/paragraph/useSnackBarIfAvailable.js.map +1 -0
  387. package/build/layout/review/DynamicReview.js +15 -26
  388. package/build/layout/review/DynamicReview.js.map +1 -0
  389. package/build/layout/utils.js +5 -6
  390. package/build/layout/utils.js.map +1 -0
  391. package/build/step/cameraStep/CameraStep.js +43 -88
  392. package/build/step/cameraStep/CameraStep.js.map +1 -0
  393. package/build/step/cameraStep/cameraCapture/CameraCapture.js +49 -105
  394. package/build/step/cameraStep/cameraCapture/CameraCapture.js.map +1 -0
  395. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +8 -7
  396. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js.map +1 -0
  397. package/build/step/cameraStep/cameraCapture/components/index.js +11 -28
  398. package/build/step/cameraStep/cameraCapture/components/index.js.map +1 -0
  399. package/build/step/cameraStep/cameraCapture/hooks/index.js +18 -72
  400. package/build/step/cameraStep/cameraCapture/hooks/index.js.map +1 -0
  401. package/build/step/cameraStep/cameraCapture/index.js +7 -14
  402. package/build/step/cameraStep/cameraCapture/index.js.map +1 -0
  403. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +34 -45
  404. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js.map +1 -0
  405. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +9 -19
  406. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js.map +1 -0
  407. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +7 -6
  408. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js.map +1 -0
  409. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +10 -21
  410. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js.map +1 -0
  411. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +8 -7
  412. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js.map +1 -0
  413. package/build/step/cameraStep/cameraCapture/screens/index.js +7 -14
  414. package/build/step/cameraStep/cameraCapture/screens/index.js.map +1 -0
  415. package/build/step/cameraStep/cameraCapture/tracking/index.js +18 -99
  416. package/build/step/cameraStep/cameraCapture/tracking/index.js.map +1 -0
  417. package/build/step/cameraStep/cameraCapture/utils/index.js +34 -96
  418. package/build/step/cameraStep/cameraCapture/utils/index.js.map +1 -0
  419. package/build/step/cameraStep/index.js +7 -14
  420. package/build/step/cameraStep/index.js.map +1 -0
  421. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +21 -21
  422. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js.map +1 -0
  423. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +9 -8
  424. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js.map +1 -0
  425. package/build/step/externalConfirmationStep/index.js +7 -14
  426. package/build/step/externalConfirmationStep/index.js.map +1 -0
  427. package/build/step/index.js +8 -15
  428. package/build/step/index.js.map +1 -0
  429. package/build/step/layoutStep/LayoutStep.js +20 -19
  430. package/build/step/layoutStep/LayoutStep.js.map +1 -0
  431. package/build/step/layoutStep/index.js +7 -14
  432. package/build/step/layoutStep/index.js.map +1 -0
  433. package/build/step/layoutStep/utils/index.js +4 -14
  434. package/build/step/layoutStep/utils/index.js.map +1 -0
  435. package/build/step/layoutStep/utils/inline-reference-utils.js +30 -46
  436. package/build/step/layoutStep/utils/inline-reference-utils.js.map +1 -0
  437. package/build/step/layoutStep/utils/layout-utils.js +35 -53
  438. package/build/step/layoutStep/utils/layout-utils.js.map +1 -0
  439. package/build/types/common/FormControl.js +2 -1
  440. package/build/types/common/FormControl.js.map +1 -0
  441. package/build/types/index.js +14 -13
  442. package/build/types/index.js.map +1 -0
  443. package/build/types/specification/Action.js +2 -1
  444. package/build/types/specification/Action.js.map +1 -0
  445. package/build/types/specification/FileUploadSchema.js +2 -1
  446. package/build/types/specification/FileUploadSchema.js.map +1 -0
  447. package/build/types/specification/LayoutComponent.js +2 -1
  448. package/build/types/specification/LayoutComponent.js.map +1 -0
  449. package/build/types/specification/Model.js +10 -17
  450. package/build/types/specification/Model.js.map +1 -0
  451. package/build/types/specification/PersistAsync.js +2 -1
  452. package/build/types/specification/PersistAsync.js.map +1 -0
  453. package/build/types/specification/Polling.js +2 -1
  454. package/build/types/specification/Polling.js.map +1 -0
  455. package/build/types/specification/Promotion.js +2 -1
  456. package/build/types/specification/Promotion.js.map +1 -0
  457. package/build/types/specification/Schema.js +9 -8
  458. package/build/types/specification/Schema.js.map +1 -0
  459. package/build/types/specification/Step.js +4 -5
  460. package/build/types/specification/Step.js.map +1 -0
  461. package/build/types/specification/ValidationAsync.js +2 -1
  462. package/build/types/specification/ValidationAsync.js.map +1 -0
  463. package/build/types/specification/core.js +2 -1
  464. package/build/types/specification/core.js.map +1 -0
  465. package/package.json +1 -1
@@ -1,172 +1,93 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
50
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
4
  };
52
- exports.__esModule = true;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
53
6
  exports.usePersistAsync = void 0;
54
- var react_1 = require("react");
55
- var react_intl_1 = require("react-intl");
56
- var validators_1 = require("../../../common/validators");
57
- var PersistAsyncSchema_messages_1 = __importDefault(require("../../../jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages"));
58
- var PersistAsyncBasicSchema_1 = require("../../../jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema"); // FIXME: extract these functions form that schema component to either here or their own module
59
- var types_1 = require("../../../types");
60
- var contexts_1 = require("../../contexts");
61
- var validators_2 = require("../../validators");
62
- var usePersistAsync = function (persistAsync) {
63
- var _a = (0, react_1.useState)(null), abortController = _a[0], setAbortController = _a[1];
64
- var fetcher = (0, contexts_1.useFetcher)();
65
- var intl = (0, react_intl_1.useIntl)();
66
- var schema = persistAsync.schema;
67
- function handlePersistAsync(model) {
68
- return __awaiter(this, void 0, void 0, function () {
69
- var isInvalidSchema;
70
- return __generator(this, function (_a) {
71
- switch (_a.label) {
72
- case 0:
73
- isInvalidSchema = model instanceof Blob ? !(0, types_1.isBlobSchema)(schema) : !(0, validators_2.isValidSchema)(model, schema);
74
- if ((0, validators_1.isNull)(model) || isInvalidSchema) {
75
- handleError();
76
- }
77
- return [4 /*yield*/, performPersistAsync(model)];
78
- case 1: return [2 /*return*/, _a.sent()];
79
- }
80
- });
81
- });
7
+ const react_1 = require("react");
8
+ const react_intl_1 = require("react-intl");
9
+ const validators_1 = require("../../../common/validators");
10
+ const PersistAsyncSchema_messages_1 = __importDefault(require("../../../jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages"));
11
+ const PersistAsyncBasicSchema_1 = require("../../../jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema"); // FIXME: extract these functions form that schema component to either here or their own module
12
+ const types_1 = require("../../../types");
13
+ const contexts_1 = require("../../contexts");
14
+ const validators_2 = require("../../validators");
15
+ const usePersistAsync = (persistAsync) => {
16
+ const [abortController, setAbortController] = (0, react_1.useState)(null);
17
+ const fetcher = (0, contexts_1.useFetcher)();
18
+ const intl = (0, react_intl_1.useIntl)();
19
+ const { schema } = persistAsync;
20
+ async function handlePersistAsync(model) {
21
+ const isInvalidSchema = model instanceof Blob ? !(0, types_1.isBlobSchema)(schema) : !(0, validators_2.isValidSchema)(model, schema);
22
+ if ((0, validators_1.isNull)(model) || isInvalidSchema) {
23
+ handleError();
24
+ }
25
+ return await performPersistAsync(model);
82
26
  }
83
- var abortCurrentRequestAndGetNewAbortSignal = function () {
27
+ const abortCurrentRequestAndGetNewAbortSignal = () => {
84
28
  if (abortController) {
85
29
  abortController.abort();
86
30
  }
87
- var newAbortController = new AbortController();
31
+ const newAbortController = new AbortController();
88
32
  setAbortController(newAbortController);
89
33
  return newAbortController.signal;
90
34
  };
91
35
  function constructFetchInit(model) {
92
- var _a;
93
- var isBlob = (0, types_1.isBlobSchema)(schema);
94
- var signal = abortCurrentRequestAndGetNewAbortSignal();
95
- var requestKey = persistAsync.param;
96
- var requestBody = isBlob
36
+ const isBlob = (0, types_1.isBlobSchema)(schema);
37
+ const signal = abortCurrentRequestAndGetNewAbortSignal();
38
+ const requestKey = persistAsync.param;
39
+ const requestBody = isBlob
97
40
  ? wrapInFormData(requestKey, model)
98
- : JSON.stringify((_a = {}, _a[requestKey] = model, _a));
41
+ : JSON.stringify({ [requestKey]: model });
99
42
  return {
100
43
  method: persistAsync.method,
101
- headers: __assign({}, (!isBlob && { 'Content-Type': 'application/json' })),
44
+ headers: Object.assign({}, (!isBlob && { 'Content-Type': 'application/json' })),
102
45
  body: requestBody,
103
- signal: signal
46
+ signal,
104
47
  };
105
48
  }
106
- function performPersistAsync(payload) {
107
- return __awaiter(this, void 0, void 0, function () {
108
- var response, jsonResponse, id, error_1;
109
- return __generator(this, function (_a) {
110
- switch (_a.label) {
111
- case 0:
112
- _a.trys.push([0, 3, , 4]);
113
- return [4 /*yield*/, fetcher(persistAsync.url, constructFetchInit(payload))];
114
- case 1:
115
- response = _a.sent();
116
- if (!response.ok) {
117
- return [2 /*return*/, handleHTTPError(response)];
118
- }
119
- return [4 /*yield*/, response.json()];
120
- case 2:
121
- jsonResponse = _a.sent();
122
- if ((0, validators_1.isObject)(jsonResponse)) {
123
- id = jsonResponse[persistAsync.idProperty];
124
- if ((0, validators_1.isString)(id) || (0, validators_1.isNumber)(id)) {
125
- return [2 /*return*/, { data: id }];
126
- }
127
- }
128
- return [2 /*return*/, handleError()];
129
- case 3:
130
- error_1 = _a.sent();
131
- return [2 /*return*/, handleError(error_1)];
132
- case 4: return [2 /*return*/];
49
+ async function performPersistAsync(payload) {
50
+ try {
51
+ const response = await fetcher(persistAsync.url, constructFetchInit(payload));
52
+ if (!response.ok) {
53
+ return handleHTTPError(response);
54
+ }
55
+ const jsonResponse = await response.json();
56
+ if ((0, validators_1.isObject)(jsonResponse)) {
57
+ const id = jsonResponse[persistAsync.idProperty];
58
+ if ((0, validators_1.isString)(id) || (0, validators_1.isNumber)(id)) {
59
+ return { data: id };
133
60
  }
134
- });
135
- });
61
+ }
62
+ return handleError();
63
+ }
64
+ catch (error) {
65
+ return handleError(error);
66
+ }
136
67
  }
137
- function handleHTTPError(response) {
138
- return __awaiter(this, void 0, void 0, function () {
139
- var jsonResponse, error;
140
- return __generator(this, function (_a) {
141
- switch (_a.label) {
142
- case 0:
143
- if (!(response.status === 422)) return [3 /*break*/, 2];
144
- return [4 /*yield*/, response.json()];
145
- case 1:
146
- jsonResponse = _a.sent();
147
- if ((0, validators_1.isObject)(jsonResponse)) {
148
- error = (0, PersistAsyncBasicSchema_1.getErrorFromResponse)(persistAsync.param, jsonResponse);
149
- if ((0, validators_1.isString)(error)) {
150
- throw new Error(error);
151
- }
152
- }
153
- _a.label = 2;
154
- case 2: throw new Error(intl.formatMessage(PersistAsyncSchema_messages_1["default"].genericError));
68
+ async function handleHTTPError(response) {
69
+ if (response.status === 422) {
70
+ const jsonResponse = await response.json();
71
+ if ((0, validators_1.isObject)(jsonResponse)) {
72
+ const error = (0, PersistAsyncBasicSchema_1.getErrorFromResponse)(persistAsync.param, jsonResponse);
73
+ if ((0, validators_1.isString)(error)) {
74
+ throw new Error(error);
155
75
  }
156
- });
157
- });
76
+ }
77
+ }
78
+ throw new Error(intl.formatMessage(PersistAsyncSchema_messages_1.default.genericError));
158
79
  }
159
- var handleError = function (error) {
160
- var message = hasStringMessage(error)
80
+ const handleError = (error) => {
81
+ const message = hasStringMessage(error)
161
82
  ? error.message
162
- : intl.formatMessage(PersistAsyncSchema_messages_1["default"].genericError);
83
+ : intl.formatMessage(PersistAsyncSchema_messages_1.default.genericError);
163
84
  throw new Error(message);
164
85
  };
165
86
  return handlePersistAsync;
166
87
  };
167
88
  exports.usePersistAsync = usePersistAsync;
168
89
  function wrapInFormData(key, value) {
169
- var formData = new FormData();
90
+ const formData = new FormData();
170
91
  if (value !== null) {
171
92
  formData.append(key, value);
172
93
  }
@@ -175,3 +96,4 @@ function wrapInFormData(key, value) {
175
96
  function hasStringMessage(value) {
176
97
  return (0, validators_1.isObject)(value) && 'message' in value && typeof value.message === 'string';
177
98
  }
99
+ //# sourceMappingURL=usePersistAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePersistAsync.js","sourceRoot":"","sources":["../../../../src/common/hooks/usePersistAsync/usePersistAsync.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAiC;AACjC,2CAAqC;AAErC,2DAAkF;AAClF,yIAA8F;AAC9F,wIAAkI,CAAC,+FAA+F;AAClO,0CAA4D;AAC5D,6CAA4C;AAC5C,iDAAiD;AAQ1C,MAAM,eAAe,GAAG,CAAC,YAA0B,EAA+B,EAAE;IACzF,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAyB,IAAI,CAAC,CAAC;IAErF,MAAM,OAAO,GAAG,IAAA,qBAAU,GAAE,CAAC;IAE7B,MAAM,IAAI,GAAG,IAAA,oBAAO,GAAE,CAAC;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAEhC,KAAK,UAAU,kBAAkB,CAAC,KAAwB;QACxD,MAAM,eAAe,GACnB,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAY,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAa,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEhF,IAAI,IAAA,mBAAM,EAAC,KAAK,CAAC,IAAI,eAAe,EAAE;YACpC,WAAW,EAAE,CAAC;SACf;QAED,OAAO,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,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C;IAChC,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC7B;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,IAAA,qBAAQ,EAAC,KAAK,CAAC,IAAI,SAAS,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC;AACpF,CAAC"}
@@ -1,44 +1,43 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createPollingClosure = exports.usePolling = void 0;
4
4
  /* eslint-disable fp/no-mutation */
5
- var react_1 = require("react");
6
- function usePolling(_a) {
7
- var asyncFn = _a.asyncFn, interval = _a.interval, maxAttempts = _a.maxAttempts, maxConsecutiveFails = _a.maxConsecutiveFails, onPollingResponse = _a.onPollingResponse, onFailure = _a.onFailure;
8
- var onPollingResponseReference = (0, react_1.useRef)(onPollingResponse);
9
- var onFailureReference = (0, react_1.useRef)(onFailure);
10
- var poll = (0, react_1.useMemo)(function () {
11
- return createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, function (pollingResponse) { return onPollingResponseReference.current(pollingResponse); }, function () { return onFailureReference.current(); });
12
- }, [asyncFn, maxAttempts, maxConsecutiveFails]);
13
- (0, react_1.useEffect)(function () {
5
+ const react_1 = require("react");
6
+ function usePolling({ asyncFn, interval, maxAttempts, maxConsecutiveFails, onPollingResponse, onFailure, }) {
7
+ const onPollingResponseReference = (0, react_1.useRef)(onPollingResponse);
8
+ const onFailureReference = (0, react_1.useRef)(onFailure);
9
+ const poll = (0, react_1.useMemo)(() => createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, (pollingResponse) => onPollingResponseReference.current(pollingResponse), () => onFailureReference.current()), [asyncFn, maxAttempts, maxConsecutiveFails]);
10
+ (0, react_1.useEffect)(() => {
14
11
  if (interval > 0) {
15
- var intervalReference_1 = setInterval(function () {
12
+ const intervalReference = setInterval(() => {
16
13
  poll();
17
14
  }, interval);
18
- return function () { return clearInterval(intervalReference_1); };
15
+ return () => clearInterval(intervalReference);
19
16
  }
20
17
  }, [poll, interval]);
21
- (0, react_1.useEffect)(function () {
18
+ (0, react_1.useEffect)(() => {
22
19
  onPollingResponseReference.current = onPollingResponse;
23
20
  onFailureReference.current = onFailure;
24
21
  }, [onPollingResponse, onFailure]);
25
22
  }
26
23
  exports.usePolling = usePolling;
27
24
  function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPollingResponse, onFailure) {
28
- var isPolling = true;
29
- var consecutiveFailures = 0;
30
- var attemptCount = 0;
25
+ let isPolling = true;
26
+ let consecutiveFailures = 0;
27
+ let attemptCount = 0;
31
28
  return asyncFn
32
- ? function () {
29
+ ? () => {
33
30
  if (isPolling) {
34
31
  attemptCount++;
35
32
  asyncFn()
36
- .then(function (pollingResponse) {
33
+ .then((pollingResponse) => {
37
34
  consecutiveFailures = 0;
38
35
  isPolling = onPollingResponse(pollingResponse);
39
- })["catch"](function () {
36
+ })
37
+ .catch(() => {
40
38
  consecutiveFailures++;
41
- })["finally"](function () {
39
+ })
40
+ .finally(() => {
42
41
  if (consecutiveFailures >= maxConsecutiveFails || attemptCount >= maxAttempts) {
43
42
  onFailure();
44
43
  isPolling = false;
@@ -46,8 +45,9 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
46
45
  });
47
46
  }
48
47
  }
49
- : function () {
48
+ : () => {
50
49
  //
51
50
  };
52
51
  }
53
52
  exports.createPollingClosure = createPollingClosure;
53
+ //# sourceMappingURL=usePolling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePolling.js","sourceRoot":"","sources":["../../../../src/common/hooks/usePolling/usePolling.tsx"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,iCAAmD;AAWnD,SAAgB,UAAU,CAAkB,EAC1C,OAAO,EACP,QAAQ,EACR,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Z,CAAC,CAAC,GAAG,EAAE;YACH,IAAI,SAAS,EAAE;gBACb,YAAY,EAAE,CAAC;gBACf,OAAO,EAAE;qBACN,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;oBACxB,mBAAmB,GAAG,CAAC,CAAC;oBACxB,SAAS,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;gBACjD,CAAC,CAAC;qBACD,KAAK,CAAC,GAAG,EAAE;oBACV,mBAAmB,EAAE,CAAC;gBACxB,CAAC,CAAC;qBACD,OAAO,CAAC,GAAG,EAAE;oBACZ,IAAI,mBAAmB,IAAI,mBAAmB,IAAI,YAAY,IAAI,WAAW,EAAE;wBAC7E,SAAS,EAAE,CAAC;wBACZ,SAAS,GAAG,KAAK,CAAC;qBACnB;gBACH,CAAC,CAAC,CAAC;aACN;QACH,CAAC;QACH,CAAC,CAAC,GAAG,EAAE;YACH,EAAE;QACJ,CAAC,CAAC;AACR,CAAC;AAlCD,oDAkCC"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.usePrevious = void 0;
4
- var react_1 = require("react");
5
- var usePrevious = function (value) {
6
- var reference = (0, react_1.useRef)();
7
- (0, react_1.useEffect)(function () {
4
+ const react_1 = require("react");
5
+ const usePrevious = (value) => {
6
+ const reference = (0, react_1.useRef)();
7
+ (0, react_1.useEffect)(() => {
8
8
  reference.current = value;
9
9
  }, [value]);
10
10
  return reference.current;
11
11
  };
12
12
  exports.usePrevious = usePrevious;
13
+ //# sourceMappingURL=usePrevious.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrevious.js","sourceRoot":"","sources":["../../../../src/common/hooks/usePrevious/usePrevious.js"],"names":[],"mappings":";;;AAAA,iCAA0C;AAEnC,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,EAAE;IACnC,MAAM,SAAS,GAAG,IAAA,cAAM,GAAE,CAAC;IAE3B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;IAC5B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,SAAS,CAAC,OAAO,CAAC;AAC3B,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB"}
@@ -1,19 +1,20 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useStepPolling = void 0;
4
- var react_1 = require("react");
5
- var __1 = require("..");
6
- var contexts_1 = require("../../contexts");
4
+ const react_1 = require("react");
5
+ const __1 = require("..");
6
+ const contexts_1 = require("../../contexts");
7
7
  function useStepPolling(polling, onAction) {
8
- var fetcher = (0, contexts_1.useFetcher)();
9
- var asyncFn = (0, react_1.useMemo)(function () {
8
+ const fetcher = (0, contexts_1.useFetcher)();
9
+ const asyncFn = (0, react_1.useMemo)(() => {
10
10
  if (polling) {
11
- return function () {
12
- return fetcher(polling.url).then(function (response) {
11
+ return () => {
12
+ return fetcher(polling.url).then((response) => {
13
13
  if (response.ok) {
14
14
  return response
15
15
  .json()
16
- .then(function (pollingResponse) { return pollingResponse; })["catch"](function (error) { return null; });
16
+ .then((pollingResponse) => pollingResponse)
17
+ .catch((error) => null);
17
18
  }
18
19
  else {
19
20
  throw new Error('failed');
@@ -25,7 +26,7 @@ function useStepPolling(polling, onAction) {
25
26
  return undefined;
26
27
  }
27
28
  }, [polling, fetcher]);
28
- var onPollingResponse = (0, react_1.useCallback)(function (pollingResponse) {
29
+ const onPollingResponse = (0, react_1.useCallback)((pollingResponse) => {
29
30
  if (pollingResponse === null || pollingResponse === void 0 ? void 0 : pollingResponse.action) {
30
31
  onAction(pollingResponse.action);
31
32
  return false; // stop polling
@@ -33,16 +34,17 @@ function useStepPolling(polling, onAction) {
33
34
  return true; // continue polling
34
35
  }, [onAction]);
35
36
  (0, __1.usePolling)({
36
- asyncFn: asyncFn,
37
+ asyncFn,
37
38
  interval: 1000 * ((polling === null || polling === void 0 ? void 0 : polling.interval) || 0),
38
39
  maxAttempts: (polling === null || polling === void 0 ? void 0 : polling.maxAttempts) || 0,
39
40
  maxConsecutiveFails: 1,
40
- onPollingResponse: onPollingResponse,
41
- onFailure: (0, react_1.useCallback)(function () {
41
+ onPollingResponse,
42
+ onFailure: (0, react_1.useCallback)(() => {
42
43
  if (polling) {
43
44
  onAction(polling.onError.action);
44
45
  }
45
- }, [onAction, polling])
46
+ }, [onAction, polling]),
46
47
  });
47
48
  }
48
49
  exports.useStepPolling = useStepPolling;
50
+ //# sourceMappingURL=useStepPolling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStepPolling.js","sourceRoot":"","sources":["../../../../src/common/hooks/useStepPolling/useStepPolling.tsx"],"names":[],"mappings":";;;AAAA,iCAA6C;AAE7C,0BAAgC;AAEhC,6CAA4C;AAE5C,SAAgB,cAAc,CAC5B,OAAyC,EACzC,QAAkC;IAElC,MAAM,OAAO,GAAG,IAAA,qBAAU,GAAE,CAAC;IAE7B,MAAM,OAAO,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC3B,IAAI,OAAO,EAAE;YACX,OAAO,GAAG,EAAE;gBACV,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;oBAC5C,IAAI,QAAQ,CAAC,EAAE,EAAE;wBACf,OAAO,QAAQ;6BACZ,IAAI,EAAE;6BACN,IAAI,CAAC,CAAC,eAAgC,EAAE,EAAE,CAAC,eAAe,CAAC;6BAC3D,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;qBAC3B;yBAAM;wBACL,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;qBAC3B;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;SACH;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvB,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,CAAC,eAAgC,EAAE,EAAE;QACnC,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE;YAC3B,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YACjC,OAAO,KAAK,CAAC,CAAC,eAAe;SAC9B;QACD,OAAO,IAAI,CAAC,CAAC,mBAAmB;IAClC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,IAAA,cAAU,EAAkB;QAC1B,OAAO;QACP,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,CAAC,CAAC;QACzC,WAAW,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,CAAC;QACtC,mBAAmB,EAAE,CAAC;QACtB,iBAAiB;QACjB,SAAS,EAAE,IAAA,mBAAW,EAAC,GAAG,EAAE;YAC1B,IAAI,OAAO,EAAE;gBACX,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aAClC;QACH,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;KACxB,CAAC,CAAC;AACL,CAAC;AAhDD,wCAgDC"}
@@ -13,5 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
- exports.__esModule = true;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./makeFetcher"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/makeFetcher/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
@@ -1,37 +1,24 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.makeFetcher = void 0;
15
- var api_utils_1 = require("../utils/api-utils");
16
- var makeFetcher = function (baseUrl, additionalHeaders) {
17
- return function (input, init) {
18
- var resource = applyBaseUrl(input, baseUrl || '');
19
- var headers = mergeHeaders(init === null || init === void 0 ? void 0 : init.headers, additionalHeaders);
20
- return fetch(resource, __assign(__assign({}, (init || {})), { headers: headers }));
21
- };
4
+ const api_utils_1 = require("../utils/api-utils");
5
+ const makeFetcher = (baseUrl, additionalHeaders) => (input, init) => {
6
+ const resource = applyBaseUrl(input, baseUrl || '');
7
+ const headers = mergeHeaders(init === null || init === void 0 ? void 0 : init.headers, additionalHeaders);
8
+ return fetch(resource, Object.assign(Object.assign({}, (init || {})), { headers }));
22
9
  };
23
10
  exports.makeFetcher = makeFetcher;
24
- var applyBaseUrl = function (input, baseUrl) {
11
+ const applyBaseUrl = (input, baseUrl) => {
25
12
  return typeof input === 'string' && (0, api_utils_1.isRelativePath)(input) ? baseUrl + input : input;
26
13
  };
27
- var mergeHeaders = function (initHeaders, additionalHeaders) {
14
+ const mergeHeaders = (initHeaders, additionalHeaders) => {
28
15
  if (!initHeaders && !additionalHeaders) {
29
16
  return {};
30
17
  }
31
- var headers = new Headers(initHeaders);
32
- for (var _i = 0, _a = Object.entries(additionalHeaders || {}); _i < _a.length; _i++) {
33
- var _b = _a[_i], key = _b[0], value = _b[1];
18
+ const headers = new Headers(initHeaders);
19
+ for (const [key, value] of Object.entries(additionalHeaders || {})) {
34
20
  headers.set(key, value);
35
21
  }
36
22
  return headers;
37
23
  };
24
+ //# sourceMappingURL=makeFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeFetcher.js","sourceRoot":"","sources":["../../../src/common/makeFetcher/makeFetcher.ts"],"names":[],"mappings":";;;AAAA,kDAAoD;AAI7C,MAAM,WAAW,GACtB,CAAC,OAAe,EAAE,iBAA+B,EAAW,EAAE,CAC9D,CAAC,KAAK,EAAE,IAAK,EAAE,EAAE;IACf,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC/D,OAAO,KAAK,CAAC,QAAQ,kCAAO,CAAC,IAAI,IAAI,EAAE,CAAC,KAAE,OAAO,IAAG,CAAC;AACvD,CAAC,CAAC;AANS,QAAA,WAAW,eAMpB;AAEJ,MAAM,YAAY,GAAG,CAAC,KAA6B,EAAE,OAAe,EAAE,EAAE;IACtE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAA,0BAAc,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,WAAyB,EAAE,iBAA+B,EAAE,EAAE;IAClF,IAAI,CAAC,WAAW,IAAI,CAAC,iBAAiB,EAAE;QACtC,OAAO,EAAE,CAAC;KACX;IACD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,EAAE;QAClE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAe,CAAC,CAAC;KACnC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var react_intl_1 = require("react-intl");
4
- exports["default"] = (0, react_intl_1.defineMessages)({
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_intl_1 = require("react-intl");
4
+ exports.default = (0, react_intl_1.defineMessages)({
5
5
  required: {
6
6
  id: 'dynamicFlows.DefaultErrorMessages.required',
7
7
  defaultMessage: 'Please fill out this field.',
8
- description: 'Customer has left the required field empty'
9
- }
8
+ description: 'Customer has left the required field empty',
9
+ },
10
10
  });
11
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/common/messages.ts"],"names":[],"mappings":";;AAAA,2CAA4C;AAE5C,kBAAe,IAAA,2BAAc,EAAC;IAC5B,QAAQ,EAAE;QACR,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,6BAA6B;QAC7C,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isRelativePath = exports.getJson = exports.isStatus422 = exports.isStatus2xx = void 0;
4
4
  function isStatus2xx(status) {
5
5
  return status >= 200 && status < 300;
@@ -13,8 +13,8 @@ function getJson(response) {
13
13
  return response.json();
14
14
  }
15
15
  exports.getJson = getJson;
16
- function isRelativePath(url) {
17
- if (url === void 0) { url = ''; }
18
- return (['https://', 'http://', 'data:'].some(function (prefix) { return url.slice(0, prefix.length) === prefix && url.length > prefix.length; }) === false);
16
+ function isRelativePath(url = '') {
17
+ return (['https://', 'http://', 'data:'].some((prefix) => url.slice(0, prefix.length) === prefix && url.length > prefix.length) === false);
19
18
  }
20
19
  exports.isRelativePath = isRelativePath;
20
+ //# sourceMappingURL=api-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-utils.js","sourceRoot":"","sources":["../../../src/common/utils/api-utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,MAA0B;IACpD,OAAO,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;AACvC,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW,CAAC,MAA0B;IACpD,OAAO,MAAM,KAAK,GAAG,CAAC;AACxB,CAAC;AAFD,kCAEC;AAED,SAAgB,OAAO,CAAC,QAAkB;IACxC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AAFD,0BAEC;AAED,SAAgB,cAAc,CAAC,GAAG,GAAG,EAAE;IACrC,OAAO,CACL,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CACnC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CACjF,KAAK,KAAK,CACZ,CAAC;AACJ,CAAC;AAND,wCAMC"}
@@ -1,27 +1,28 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dateToDateString = exports.dateStringToDate = void 0;
4
- var validators_1 = require("../validators");
4
+ const validators_1 = require("../validators");
5
5
  // function taken from: https://stackoverflow.com/questions/23593052/format-javascript-date-as-yyyy-mm-dd
6
6
  function formatDate(date) {
7
- var d = new Date(date);
8
- var month = "".concat(d.getMonth() + 1);
9
- var day = "".concat(d.getDate());
10
- var year = d.getFullYear();
11
- var formattedMonth = month.length < 2 ? "0".concat(month) : month;
12
- var formattedDay = day.length < 2 ? "0".concat(day) : day;
7
+ const d = new Date(date);
8
+ const month = `${d.getMonth() + 1}`;
9
+ const day = `${d.getDate()}`;
10
+ const year = d.getFullYear();
11
+ const formattedMonth = month.length < 2 ? `0${month}` : month;
12
+ const formattedDay = day.length < 2 ? `0${day}` : day;
13
13
  return [year, formattedMonth, formattedDay].join('-');
14
14
  }
15
- var dateStringToDate = function (dateString) {
15
+ const dateStringToDate = (dateString) => {
16
16
  if (!dateString) {
17
17
  return null;
18
18
  }
19
- var _a = dateString.split('-').map(function (number) { return parseInt(number, 10); }), year = _a[0], month = _a[1], date = _a[2];
19
+ const [year, month, date] = dateString.split('-').map((number) => parseInt(number, 10));
20
20
  if (!(0, validators_1.isNumber)(year) || !(0, validators_1.isNumber)(month) || !(0, validators_1.isNumber)(date)) {
21
21
  return null;
22
22
  }
23
23
  return new Date(year, month - 1, date);
24
24
  };
25
25
  exports.dateStringToDate = dateStringToDate;
26
- var dateToDateString = function (date) { return formatDate(date); };
26
+ const dateToDateString = (date) => formatDate(date);
27
27
  exports.dateToDateString = dateToDateString;
28
+ //# sourceMappingURL=date-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../../src/common/utils/date-utils.ts"],"names":[],"mappings":";;;AAAA,8CAAyC;AAEzC,yGAAyG;AACzG,SAAS,UAAU,CAAC,IAAmB;IACrC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAE7B,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9D,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAEtD,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,YAA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