@sarafapp/iron_core 1.0.62 → 1.0.64

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 (321) hide show
  1. package/dist/IronCore.js +18 -8
  2. package/dist/IronCore.umd.cjs +1 -1
  3. package/dist/core/index.d.ts +31 -0
  4. package/dist/{src → core/src}/BaseModel.d.ts +4 -4
  5. package/dist/core/src/baseForm/UseForm.d.ts +18 -0
  6. package/dist/{src → core/src}/baseTable/BaseTable.d.ts +3 -2
  7. package/dist/{src → core/src}/baseTable/Constants.d.ts +4 -3
  8. package/dist/{src → core/src}/baseTable/SelectableTable.d.ts +2 -2
  9. package/dist/{src → core/src}/baseTable/generator/SelectableTableGenerator.d.ts +3 -3
  10. package/dist/{src → core/src}/baseTable/moduleConnection/Table.d.ts +1 -1
  11. package/dist/{src → core/src}/baseTable/moduleConnection/generator/GColumn.d.ts +1 -1
  12. package/dist/{src → core/src}/composables/UseCrud.d.ts +4 -4
  13. package/dist/{src → core/src}/composables/UseData.d.ts +4 -3
  14. package/dist/core/src/composables/UseLoadingStatus.d.ts +15 -0
  15. package/dist/{src → core/src}/composables/UseParams.d.ts +3 -1
  16. package/dist/core/src/composables/UseRepository.d.ts +67 -0
  17. package/dist/core/src/composables/UseStaticTableService.d.ts +5 -0
  18. package/dist/{src → core/src}/crudService/CrudService.d.ts +8 -8
  19. package/dist/{src → core/src}/dateHandling/Converter.d.ts +1 -1
  20. package/dist/{src → core/src}/httpClient/ErrorHandlerRegistry.d.ts +1 -1
  21. package/dist/{src → core/src}/json/JsonMapper.d.ts +1 -1
  22. package/dist/core/src/layout/DialogService.d.ts +406 -0
  23. package/dist/core/src/layout/DrawerService.d.ts +14 -0
  24. package/dist/{src → core/src}/lib/Formatter.d.ts +1 -1
  25. package/dist/{src → core/src}/lib/Util.d.ts +2 -1
  26. package/dist/core/vite.config.d.ts +2 -0
  27. package/dist/example-vue/src/AntTableConfig.d.ts +6 -0
  28. package/dist/example-vue/src/TableService.d.ts +12 -0
  29. package/dist/example-vue/src/TextCell.vue.d.ts +5 -0
  30. package/dist/example-vue/src/app/App.vue.d.ts +2 -0
  31. package/dist/example-vue/src/app/router/index.d.ts +1 -0
  32. package/dist/example-vue/src/app/screens/Index.vue.d.ts +2 -0
  33. package/dist/example-vue/src/main.d.ts +0 -0
  34. package/dist/example-vue/vite.config.d.ts +2 -0
  35. package/dist/index.d.ts +2 -31
  36. package/index.ts +37 -0
  37. package/package.json +2 -5
  38. package/src/BaseModel.ts +127 -0
  39. package/src/Utils.ts +16 -0
  40. package/src/accessHandling/AccessControl.ts +33 -0
  41. package/src/accessHandling/AccessLevel.ts +52 -0
  42. package/src/accessHandling/Accessible.ts +3 -0
  43. package/src/accessHandling/EveryDirectiveAccess.ts +7 -0
  44. package/src/accessHandling/SSO/AuthorizationDirective.ts +65 -0
  45. package/src/accessHandling/SSO/AuthorizationService.ts +74 -0
  46. package/src/accessHandling/SSO/EveryLevelAuthorizationDirective.ts +7 -0
  47. package/src/accessHandling/SSO/SomeLevelsAuthorizationDirective.ts +7 -0
  48. package/src/accessHandling/SomeDirectiveAccess.ts +7 -0
  49. package/src/accessHandling/index.ts +9 -0
  50. package/src/baseDirective/BeforeMountDirective.ts +3 -0
  51. package/src/baseDirective/BeforeUnMountDirective.ts +3 -0
  52. package/src/baseDirective/BeforeUpdateDirective.ts +3 -0
  53. package/src/baseDirective/CreatedDirective.ts +3 -0
  54. package/src/baseDirective/MountedDirective.ts +3 -0
  55. package/src/baseDirective/UnMountedDirective.ts +3 -0
  56. package/src/baseDirective/UpdateDirective.ts +3 -0
  57. package/src/baseDirective/index.ts +7 -0
  58. package/src/baseForm/BaseRequestBodyFilter.ts +7 -0
  59. package/src/baseForm/FormManager.ts +95 -0
  60. package/src/baseForm/InputControl.ts +182 -0
  61. package/src/baseForm/InputControlBuilder.ts +59 -0
  62. package/src/baseForm/InputControlData.ts +16 -0
  63. package/src/baseForm/RequestBodyFilter.ts +3 -0
  64. package/src/baseForm/TouchSensitiveForm.ts +47 -0
  65. package/src/baseForm/UseForm.ts +32 -0
  66. package/src/baseForm/index.ts +8 -0
  67. package/src/baseSchedule/Schedule.ts +3 -0
  68. package/src/baseSchedule/Scheduler.ts +29 -0
  69. package/src/baseSchedule/index.ts +2 -0
  70. package/src/baseTable/BaseTable.ts +162 -0
  71. package/src/baseTable/Constants.ts +26 -0
  72. package/src/baseTable/OnDestory.ts +3 -0
  73. package/src/baseTable/RowActionSource.ts +5 -0
  74. package/src/baseTable/RowClick.ts +3 -0
  75. package/src/baseTable/RowDoubleClick.ts +3 -0
  76. package/src/baseTable/RowMetaClick.ts +3 -0
  77. package/src/baseTable/SelectableTable.ts +86 -0
  78. package/src/baseTable/TableAction.ts +10 -0
  79. package/src/baseTable/TableHeaderSchema.ts +44 -0
  80. package/src/baseTable/TableLoader.ts +3 -0
  81. package/src/baseTable/TablePaginate.ts +3 -0
  82. package/src/baseTable/TableService.ts +10 -0
  83. package/src/baseTable/TableSort.ts +5 -0
  84. package/src/baseTable/TableSummarySchema.ts +11 -0
  85. package/src/baseTable/generator/SelectableTableGenerator.ts +65 -0
  86. package/src/baseTable/generator/TableCellComponentRegistry.ts +15 -0
  87. package/src/baseTable/generator/TableConfig.ts +18 -0
  88. package/src/baseTable/generator/TableGenerator.ts +147 -0
  89. package/src/baseTable/generator/TableSource.ts +34 -0
  90. package/src/baseTable/index.ts +43 -0
  91. package/src/baseTable/moduleConnection/Action.ts +12 -0
  92. package/src/baseTable/moduleConnection/Column.ts +11 -0
  93. package/src/baseTable/moduleConnection/Table.ts +49 -0
  94. package/src/baseTable/moduleConnection/TableDestroy.ts +7 -0
  95. package/src/baseTable/moduleConnection/TableRowClick.ts +7 -0
  96. package/src/baseTable/moduleConnection/generator/GColumn.ts +10 -0
  97. package/src/baseTable/moduleConnection/generator/GTable.ts +11 -0
  98. package/src/composables/UseCrud.ts +53 -0
  99. package/src/composables/UseData.ts +70 -0
  100. package/src/composables/UseLoadingStatus.ts +65 -0
  101. package/src/composables/UseParams.ts +93 -0
  102. package/src/composables/UseRepository.ts +207 -0
  103. package/src/composables/UseState.ts +30 -0
  104. package/src/composables/UseStaticTableService.ts +45 -0
  105. package/src/composables/index.ts +7 -0
  106. package/src/constants/Constants.ts +126 -0
  107. package/src/constants/index.ts +19 -0
  108. package/src/crudService/CrudService.ts +121 -0
  109. package/src/crudService/index.ts +1 -0
  110. package/src/dateHandling/Constants.ts +5 -0
  111. package/src/dateHandling/Converter.ts +15 -0
  112. package/src/dateHandling/JalaliDateSetup.ts +42 -0
  113. package/src/dateHandling/Model.ts +27 -0
  114. package/src/dateHandling/Utils.ts +49 -0
  115. package/src/dateHandling/index.ts +5 -0
  116. package/src/debounce/DebounceAction.ts +4 -0
  117. package/src/debounce/DebounceService.ts +27 -0
  118. package/src/debounce/index.ts +2 -0
  119. package/src/deviceManagement/Constants.ts +4 -0
  120. package/src/deviceManagement/Visibility.ts +4 -0
  121. package/src/deviceManagement/VisibilityManager.ts +18 -0
  122. package/src/deviceManagement/index.ts +3 -0
  123. package/src/errorHandling/ErrorHandler.ts +3 -0
  124. package/src/errorHandling/HandleError.ts +20 -0
  125. package/src/errorHandling/index.ts +2 -0
  126. package/src/eventSystem/CustomEventDispatcher.ts +13 -0
  127. package/src/eventSystem/Model.ts +29 -0
  128. package/src/eventSystem/OnEvent.ts +25 -0
  129. package/src/eventSystem/index.ts +3 -0
  130. package/src/feedbackHandling/FailureFeedback.ts +3 -0
  131. package/src/feedbackHandling/Feedback.ts +34 -0
  132. package/src/feedbackHandling/HandleFeedback.ts +28 -0
  133. package/src/feedbackHandling/InfoFeedback.ts +3 -0
  134. package/src/feedbackHandling/SuccessFeedback.ts +3 -0
  135. package/src/feedbackHandling/WarningFeedback.ts +3 -0
  136. package/src/feedbackHandling/index.ts +6 -0
  137. package/src/httpClient/ApiBuilder.ts +57 -0
  138. package/src/httpClient/ErrorHandlerRegistry.ts +29 -0
  139. package/src/httpClient/HttpClient.ts +77 -0
  140. package/src/httpClient/Interceptor.ts +5 -0
  141. package/src/httpClient/index.ts +4 -0
  142. package/src/initializer/ApplicationInitializer.ts +15 -0
  143. package/src/initializer/Initializer.ts +3 -0
  144. package/src/initializer/index.ts +2 -0
  145. package/src/json/JsonMapper.ts +48 -0
  146. package/src/json/index.ts +1 -0
  147. package/src/layout/Constants.ts +11 -0
  148. package/src/layout/DialogService.ts +75 -0
  149. package/src/layout/DrawerService.ts +25 -0
  150. package/src/layout/Toast.ts +14 -0
  151. package/src/layout/index.ts +4 -0
  152. package/src/lib/Constants.ts +433 -0
  153. package/src/lib/Formatter.ts +68 -0
  154. package/src/lib/Util.ts +113 -0
  155. package/src/lib/index.ts +3 -0
  156. package/src/observables/AbstractSubject.ts +21 -0
  157. package/src/observables/BehaviorSubject.ts +58 -0
  158. package/src/observables/Observer.ts +3 -0
  159. package/src/observables/Subject.ts +9 -0
  160. package/src/observables/index.ts +4 -0
  161. package/src/process/Proccess.ts +21 -0
  162. package/src/process/ProcessManager.ts +31 -0
  163. package/src/process/index.ts +2 -0
  164. package/src/repository/Params.ts +10 -0
  165. package/src/repository/Repository.ts +44 -0
  166. package/src/repository/SyncDetail.ts +8 -0
  167. package/src/repository/index.ts +4 -0
  168. package/src/repository/model.ts +9 -0
  169. package/src/routeGuard/RouteGuard.ts +38 -0
  170. package/src/routeGuard/index.ts +1 -0
  171. package/src/search/client/ClientArraySearch.ts +25 -0
  172. package/src/search/client/ClientSearch.ts +3 -0
  173. package/src/search/index.ts +2 -0
  174. package/src/sort/SortDetail.ts +11 -0
  175. package/src/sort/client/Sorter.ts +28 -0
  176. package/src/sort/index.ts +4 -0
  177. package/src/sort/strategies/SimpleSort.ts +35 -0
  178. package/src/sort/strategies/SortStrategy.ts +4 -0
  179. package/src/types/Global.ts +1 -0
  180. package/src/types/index.ts +1 -0
  181. package/src/validators/Validator.ts +5 -0
  182. package/src/validators/index.ts +1 -0
  183. package/src/webSocket/Constants.ts +6 -0
  184. package/src/webSocket/Model.ts +16 -0
  185. package/src/webSocket/WebSocketService.ts +153 -0
  186. package/src/webSocket/index.ts +3 -0
  187. package/vite.config.ts +55 -0
  188. package/dist/src/baseForm/UseForm.d.ts +0 -5
  189. package/dist/src/composables/UseLoadingStatus.d.ts +0 -15
  190. package/dist/src/composables/UseRepository.d.ts +0 -63
  191. package/dist/src/composables/UseStaticTableService.d.ts +0 -4
  192. package/dist/src/layout/DialogService.d.ts +0 -1
  193. package/dist/src/layout/DrawerService.d.ts +0 -1
  194. package/dist/vite.config.d.ts +0 -2
  195. /package/dist/{src → core/src}/Utils.d.ts +0 -0
  196. /package/dist/{src → core/src}/accessHandling/AccessControl.d.ts +0 -0
  197. /package/dist/{src → core/src}/accessHandling/AccessLevel.d.ts +0 -0
  198. /package/dist/{src → core/src}/accessHandling/Accessible.d.ts +0 -0
  199. /package/dist/{src → core/src}/accessHandling/EveryDirectiveAccess.d.ts +0 -0
  200. /package/dist/{src → core/src}/accessHandling/SSO/AuthorizationDirective.d.ts +0 -0
  201. /package/dist/{src → core/src}/accessHandling/SSO/AuthorizationService.d.ts +0 -0
  202. /package/dist/{src → core/src}/accessHandling/SSO/EveryLevelAuthorizationDirective.d.ts +0 -0
  203. /package/dist/{src → core/src}/accessHandling/SSO/SomeLevelsAuthorizationDirective.d.ts +0 -0
  204. /package/dist/{src → core/src}/accessHandling/SomeDirectiveAccess.d.ts +0 -0
  205. /package/dist/{src → core/src}/accessHandling/index.d.ts +0 -0
  206. /package/dist/{src → core/src}/baseDirective/BeforeMountDirective.d.ts +0 -0
  207. /package/dist/{src → core/src}/baseDirective/BeforeUnMountDirective.d.ts +0 -0
  208. /package/dist/{src → core/src}/baseDirective/BeforeUpdateDirective.d.ts +0 -0
  209. /package/dist/{src → core/src}/baseDirective/CreatedDirective.d.ts +0 -0
  210. /package/dist/{src → core/src}/baseDirective/MountedDirective.d.ts +0 -0
  211. /package/dist/{src → core/src}/baseDirective/UnMountedDirective.d.ts +0 -0
  212. /package/dist/{src → core/src}/baseDirective/UpdateDirective.d.ts +0 -0
  213. /package/dist/{src → core/src}/baseDirective/index.d.ts +0 -0
  214. /package/dist/{src → core/src}/baseForm/BaseRequestBodyFilter.d.ts +0 -0
  215. /package/dist/{src → core/src}/baseForm/FormManager.d.ts +0 -0
  216. /package/dist/{src → core/src}/baseForm/InputControl.d.ts +0 -0
  217. /package/dist/{src → core/src}/baseForm/InputControlBuilder.d.ts +0 -0
  218. /package/dist/{src → core/src}/baseForm/InputControlData.d.ts +0 -0
  219. /package/dist/{src → core/src}/baseForm/RequestBodyFilter.d.ts +0 -0
  220. /package/dist/{src → core/src}/baseForm/TouchSensitiveForm.d.ts +0 -0
  221. /package/dist/{src → core/src}/baseForm/index.d.ts +0 -0
  222. /package/dist/{src → core/src}/baseSchedule/Schedule.d.ts +0 -0
  223. /package/dist/{src → core/src}/baseSchedule/Scheduler.d.ts +0 -0
  224. /package/dist/{src → core/src}/baseSchedule/index.d.ts +0 -0
  225. /package/dist/{src → core/src}/baseTable/OnDestory.d.ts +0 -0
  226. /package/dist/{src → core/src}/baseTable/RowActionSource.d.ts +0 -0
  227. /package/dist/{src → core/src}/baseTable/RowClick.d.ts +0 -0
  228. /package/dist/{src → core/src}/baseTable/RowDoubleClick.d.ts +0 -0
  229. /package/dist/{src → core/src}/baseTable/RowMetaClick.d.ts +0 -0
  230. /package/dist/{src → core/src}/baseTable/TableAction.d.ts +0 -0
  231. /package/dist/{src → core/src}/baseTable/TableHeaderSchema.d.ts +0 -0
  232. /package/dist/{src → core/src}/baseTable/TableLoader.d.ts +0 -0
  233. /package/dist/{src → core/src}/baseTable/TablePaginate.d.ts +0 -0
  234. /package/dist/{src → core/src}/baseTable/TableService.d.ts +0 -0
  235. /package/dist/{src → core/src}/baseTable/TableSort.d.ts +0 -0
  236. /package/dist/{src → core/src}/baseTable/TableSummarySchema.d.ts +0 -0
  237. /package/dist/{src → core/src}/baseTable/generator/TableCellComponentRegistry.d.ts +0 -0
  238. /package/dist/{src → core/src}/baseTable/generator/TableConfig.d.ts +0 -0
  239. /package/dist/{src → core/src}/baseTable/generator/TableGenerator.d.ts +0 -0
  240. /package/dist/{src → core/src}/baseTable/generator/TableSource.d.ts +0 -0
  241. /package/dist/{src → core/src}/baseTable/index.d.ts +0 -0
  242. /package/dist/{src → core/src}/baseTable/moduleConnection/Action.d.ts +0 -0
  243. /package/dist/{src → core/src}/baseTable/moduleConnection/Column.d.ts +0 -0
  244. /package/dist/{src → core/src}/baseTable/moduleConnection/TableDestroy.d.ts +0 -0
  245. /package/dist/{src → core/src}/baseTable/moduleConnection/TableRowClick.d.ts +0 -0
  246. /package/dist/{src → core/src}/baseTable/moduleConnection/generator/GTable.d.ts +0 -0
  247. /package/dist/{src → core/src}/composables/UseState.d.ts +0 -0
  248. /package/dist/{src → core/src}/composables/index.d.ts +0 -0
  249. /package/dist/{src → core/src}/constants/Constants.d.ts +0 -0
  250. /package/dist/{src → core/src}/constants/index.d.ts +0 -0
  251. /package/dist/{src → core/src}/crudService/index.d.ts +0 -0
  252. /package/dist/{src → core/src}/dateHandling/Constants.d.ts +0 -0
  253. /package/dist/{src → core/src}/dateHandling/JalaliDateSetup.d.ts +0 -0
  254. /package/dist/{src → core/src}/dateHandling/Model.d.ts +0 -0
  255. /package/dist/{src → core/src}/dateHandling/Utils.d.ts +0 -0
  256. /package/dist/{src → core/src}/dateHandling/index.d.ts +0 -0
  257. /package/dist/{src → core/src}/debounce/DebounceAction.d.ts +0 -0
  258. /package/dist/{src → core/src}/debounce/DebounceService.d.ts +0 -0
  259. /package/dist/{src → core/src}/debounce/index.d.ts +0 -0
  260. /package/dist/{src → core/src}/deviceManagement/Constants.d.ts +0 -0
  261. /package/dist/{src → core/src}/deviceManagement/Visibility.d.ts +0 -0
  262. /package/dist/{src → core/src}/deviceManagement/VisibilityManager.d.ts +0 -0
  263. /package/dist/{src → core/src}/deviceManagement/index.d.ts +0 -0
  264. /package/dist/{src → core/src}/errorHandling/ErrorHandler.d.ts +0 -0
  265. /package/dist/{src → core/src}/errorHandling/HandleError.d.ts +0 -0
  266. /package/dist/{src → core/src}/errorHandling/index.d.ts +0 -0
  267. /package/dist/{src → core/src}/eventSystem/CustomEventDispatcher.d.ts +0 -0
  268. /package/dist/{src → core/src}/eventSystem/Model.d.ts +0 -0
  269. /package/dist/{src → core/src}/eventSystem/OnEvent.d.ts +0 -0
  270. /package/dist/{src → core/src}/eventSystem/index.d.ts +0 -0
  271. /package/dist/{src → core/src}/feedbackHandling/FailureFeedback.d.ts +0 -0
  272. /package/dist/{src → core/src}/feedbackHandling/Feedback.d.ts +0 -0
  273. /package/dist/{src → core/src}/feedbackHandling/HandleFeedback.d.ts +0 -0
  274. /package/dist/{src → core/src}/feedbackHandling/InfoFeedback.d.ts +0 -0
  275. /package/dist/{src → core/src}/feedbackHandling/SuccessFeedback.d.ts +0 -0
  276. /package/dist/{src → core/src}/feedbackHandling/WarningFeedback.d.ts +0 -0
  277. /package/dist/{src → core/src}/feedbackHandling/index.d.ts +0 -0
  278. /package/dist/{src → core/src}/httpClient/ApiBuilder.d.ts +0 -0
  279. /package/dist/{src → core/src}/httpClient/HttpClient.d.ts +0 -0
  280. /package/dist/{src → core/src}/httpClient/Interceptor.d.ts +0 -0
  281. /package/dist/{src → core/src}/httpClient/index.d.ts +0 -0
  282. /package/dist/{src → core/src}/initializer/ApplicationInitializer.d.ts +0 -0
  283. /package/dist/{src → core/src}/initializer/Initializer.d.ts +0 -0
  284. /package/dist/{src → core/src}/initializer/index.d.ts +0 -0
  285. /package/dist/{src → core/src}/json/index.d.ts +0 -0
  286. /package/dist/{src → core/src}/layout/Constants.d.ts +0 -0
  287. /package/dist/{src → core/src}/layout/Toast.d.ts +0 -0
  288. /package/dist/{src → core/src}/layout/index.d.ts +0 -0
  289. /package/dist/{src → core/src}/lib/Constants.d.ts +0 -0
  290. /package/dist/{src → core/src}/lib/index.d.ts +0 -0
  291. /package/dist/{src → core/src}/observables/AbstractSubject.d.ts +0 -0
  292. /package/dist/{src → core/src}/observables/BehaviorSubject.d.ts +0 -0
  293. /package/dist/{src → core/src}/observables/Observer.d.ts +0 -0
  294. /package/dist/{src → core/src}/observables/Subject.d.ts +0 -0
  295. /package/dist/{src → core/src}/observables/index.d.ts +0 -0
  296. /package/dist/{src → core/src}/process/Proccess.d.ts +0 -0
  297. /package/dist/{src → core/src}/process/ProcessManager.d.ts +0 -0
  298. /package/dist/{src → core/src}/process/index.d.ts +0 -0
  299. /package/dist/{src → core/src}/repository/Params.d.ts +0 -0
  300. /package/dist/{src → core/src}/repository/Repository.d.ts +0 -0
  301. /package/dist/{src → core/src}/repository/SyncDetail.d.ts +0 -0
  302. /package/dist/{src → core/src}/repository/index.d.ts +0 -0
  303. /package/dist/{src → core/src}/repository/model.d.ts +0 -0
  304. /package/dist/{src → core/src}/routeGuard/RouteGuard.d.ts +0 -0
  305. /package/dist/{src → core/src}/routeGuard/index.d.ts +0 -0
  306. /package/dist/{src → core/src}/search/client/ClientArraySearch.d.ts +0 -0
  307. /package/dist/{src → core/src}/search/client/ClientSearch.d.ts +0 -0
  308. /package/dist/{src → core/src}/search/index.d.ts +0 -0
  309. /package/dist/{src → core/src}/sort/SortDetail.d.ts +0 -0
  310. /package/dist/{src → core/src}/sort/client/Sorter.d.ts +0 -0
  311. /package/dist/{src → core/src}/sort/index.d.ts +0 -0
  312. /package/dist/{src → core/src}/sort/strategies/SimpleSort.d.ts +0 -0
  313. /package/dist/{src → core/src}/sort/strategies/SortStrategy.d.ts +0 -0
  314. /package/dist/{src → core/src}/types/Global.d.ts +0 -0
  315. /package/dist/{src → core/src}/types/index.d.ts +0 -0
  316. /package/dist/{src → core/src}/validators/Validator.d.ts +0 -0
  317. /package/dist/{src → core/src}/validators/index.d.ts +0 -0
  318. /package/dist/{src → core/src}/webSocket/Constants.d.ts +0 -0
  319. /package/dist/{src → core/src}/webSocket/Model.d.ts +0 -0
  320. /package/dist/{src → core/src}/webSocket/WebSocketService.d.ts +0 -0
  321. /package/dist/{src → core/src}/webSocket/index.d.ts +0 -0
@@ -0,0 +1,77 @@
1
+ import {
2
+ Axios,
3
+ AxiosHeaders,
4
+ type AxiosResponse,
5
+ type InternalAxiosRequestConfig,
6
+ } from "axios";
7
+
8
+ type axiosConfig = { headers?: AxiosHeaders } & Omit<
9
+ InternalAxiosRequestConfig,
10
+ "headers"
11
+ >;
12
+
13
+ export class HttpClient {
14
+ private axiosInstance: Axios;
15
+
16
+ constructor(instance: Axios) {
17
+ this.axiosInstance = instance;
18
+ }
19
+
20
+ public async get<T>(
21
+ url: string,
22
+ config?: axiosConfig,
23
+ ): Promise<AxiosResponse<T>> {
24
+ return await this.axiosInstance.get(
25
+ url,
26
+ config as InternalAxiosRequestConfig,
27
+ );
28
+ }
29
+
30
+ public async post<T>(
31
+ url: string,
32
+ data?: unknown,
33
+ config?: axiosConfig,
34
+ ): Promise<AxiosResponse<T>> {
35
+ return await this.axiosInstance.post(
36
+ url,
37
+ data,
38
+ config as InternalAxiosRequestConfig,
39
+ );
40
+ }
41
+
42
+ public async patch<T>(
43
+ url: string,
44
+ data?: unknown,
45
+ config?: axiosConfig,
46
+ ): Promise<AxiosResponse<T>> {
47
+ return await this.axiosInstance.patch(
48
+ url,
49
+ data,
50
+ config as InternalAxiosRequestConfig,
51
+ );
52
+ }
53
+
54
+ public async put<T>(
55
+ url: string,
56
+ data?: unknown,
57
+ config?: axiosConfig,
58
+ ): Promise<AxiosResponse<T>> {
59
+ return await this.axiosInstance.put(
60
+ url,
61
+ data,
62
+ config as InternalAxiosRequestConfig,
63
+ );
64
+ }
65
+
66
+ public async delete<T>(
67
+ url: string,
68
+ config?: axiosConfig,
69
+ ): Promise<AxiosResponse<T>> {
70
+ return await this.axiosInstance.delete(
71
+ url,
72
+ config as InternalAxiosRequestConfig,
73
+ );
74
+ }
75
+ }
76
+
77
+ export default HttpClient;
@@ -0,0 +1,5 @@
1
+ import { type InternalAxiosRequestConfig } from "axios";
2
+
3
+ export interface Interceptor {
4
+ intercept(config: InternalAxiosRequestConfig): InternalAxiosRequestConfig;
5
+ }
@@ -0,0 +1,4 @@
1
+ export { APIErrorHandlerRegistry } from "./ErrorHandlerRegistry";
2
+ export { ApiBuilder } from "./ApiBuilder";
3
+ export { HttpClient } from "./HttpClient";
4
+ export { type Interceptor } from './Interceptor';
@@ -0,0 +1,15 @@
1
+ import { type Initializer } from "./Initializer";
2
+
3
+ export class ApplicationInitializer {
4
+ private _initializer: Initializer[] = [];
5
+
6
+ public setupInitializers(initializers: Initializer[]) {
7
+ this._initializer.push(...initializers);
8
+ }
9
+
10
+ public initialize() {
11
+ for (const initializer of this._initializer) {
12
+ initializer.initialize();
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ export interface Initializer {
2
+ initialize(): void
3
+ }
@@ -0,0 +1,2 @@
1
+ export { ApplicationInitializer } from './ApplicationInitializer';
2
+ export { type Initializer } from './Initializer';
@@ -0,0 +1,48 @@
1
+ import type { Nullable } from "../types";
2
+ import { JsonConvert } from "json2typescript";
3
+
4
+ export class JsonMapper {
5
+ private static Instance: Nullable<JsonMapper> = null;
6
+ private jsonConverter = new JsonConvert();
7
+
8
+ private constructor() {}
9
+
10
+ public serializeObject<T extends object>(
11
+ object: object,
12
+ model: { new (): T },
13
+ ) {
14
+ return this.jsonConverter.serializeObject(object, model) as T;
15
+ }
16
+
17
+ public deserializeObject<T extends object>(
18
+ object: object,
19
+ model: { new (): T },
20
+ ) {
21
+ return this.jsonConverter.deserializeObject(object, model) as T;
22
+ }
23
+
24
+ public deserializeArray<T extends object>(
25
+ array: Array<T>,
26
+ model: { new (): T[] },
27
+ ) {
28
+ return this.jsonConverter.deserializeArray(array, model) as Array<T>;
29
+ }
30
+
31
+ public tryDeserialize(object: object, models: { new (): any }[]) {
32
+ for (const model of models) {
33
+ try {
34
+ return this.deserializeObject(object, model);
35
+ } catch (e) {
36
+ // ignore
37
+ }
38
+ }
39
+ throw new Error("Unable to deserialize object");
40
+ }
41
+
42
+ public static GetInstance() {
43
+ if (!JsonMapper.Instance) {
44
+ JsonMapper.Instance = new JsonMapper();
45
+ }
46
+ return JsonMapper.Instance;
47
+ }
48
+ }
@@ -0,0 +1 @@
1
+ export { JsonMapper } from './JsonMapper';
@@ -0,0 +1,11 @@
1
+ export const enum ToastType {
2
+ Success = 'success',
3
+ Failure = 'error',
4
+ Info = 'info',
5
+ Warning = 'warning',
6
+ }
7
+
8
+ export const enum ToastLocation {
9
+ BottomLeft = 'bottomLeft',
10
+ TopLeft = 'topLeft',
11
+ }
@@ -0,0 +1,75 @@
1
+ import { type Component, computed, reactive } from 'vue';
2
+ import { defineStore } from 'pinia';
3
+ import { StoreNames, DialogDimensions } from '../constants';
4
+ import { type Nullable } from '../types';
5
+
6
+ export const useDialogService = defineStore(StoreNames.Dialog, () => {
7
+ const dialogData = reactive<{
8
+ dialogComponent: Nullable<Component>;
9
+ props: Nullable<Record<string, unknown>>;
10
+ header: string;
11
+ width: DialogDimensions;
12
+ height: DialogDimensions;
13
+ }>({
14
+ dialogComponent: null,
15
+ width: DialogDimensions.DefaultWidth,
16
+ height: DialogDimensions.DefaultHeight,
17
+ props: null,
18
+ header: '',
19
+ });
20
+
21
+ const isDialogExists = computed<boolean>(() => {
22
+ return Boolean(dialogData.dialogComponent);
23
+ });
24
+
25
+ const hasDefaultHeader = computed<boolean>(() => {
26
+ return Boolean(dialogData.header);
27
+ });
28
+
29
+ function openDialog(component: Component) {
30
+ dialogData.dialogComponent = component;
31
+ }
32
+
33
+ function setDialogHeader(header: string) {
34
+ dialogData.header = header;
35
+ }
36
+
37
+ function setProps(props: Record<string, unknown>) {
38
+ if (!isDialogExists.value) {
39
+ throw new Error('there is no dialog to set props on');
40
+ }
41
+ dialogData.props = props;
42
+ }
43
+
44
+ function setSize(size: number, type: DialogDimensions) {
45
+ if (!isDialogExists.value) {
46
+ throw new Error('there is no dialog to set size on');
47
+ }
48
+
49
+ if (size < DialogDimensions.MinimalAvailableSize) {
50
+ throw new Error('negative size not supported');
51
+ }
52
+
53
+ if (type === DialogDimensions.Width) dialogData.width = size;
54
+ else dialogData.height = size;
55
+ }
56
+
57
+ function clearDialog() {
58
+ dialogData.props = null;
59
+ dialogData.height = DialogDimensions.DefaultHeight;
60
+ dialogData.width = DialogDimensions.DefaultWidth;
61
+ dialogData.header = '';
62
+ dialogData.dialogComponent = null;
63
+ }
64
+
65
+ return {
66
+ dialogData,
67
+ openDialog,
68
+ clearDialog,
69
+ setSize,
70
+ setDialogHeader,
71
+ setProps,
72
+ isDialogExists,
73
+ hasDefaultHeader
74
+ };
75
+ });
@@ -0,0 +1,25 @@
1
+ import { computed, ref } from 'vue';
2
+ import { defineStore } from 'pinia';
3
+ import { StoreNames, ApplicationDrawerStatus } from '../constants';
4
+
5
+ export const useDrawerService = defineStore(StoreNames.Drawer, () => {
6
+ const drawerStatus = ref<ApplicationDrawerStatus>(ApplicationDrawerStatus.Close);
7
+
8
+ const isDrawerOpen = computed<boolean>(() => {
9
+ return drawerStatus.value === ApplicationDrawerStatus.Open;
10
+ });
11
+
12
+ function closeDrawer() {
13
+ drawerStatus.value = ApplicationDrawerStatus.Close;
14
+ }
15
+
16
+ function openDrawer() {
17
+ drawerStatus.value = ApplicationDrawerStatus.Open;
18
+ }
19
+
20
+ return {
21
+ closeDrawer,
22
+ openDrawer,
23
+ isDrawerOpen,
24
+ };
25
+ });
@@ -0,0 +1,14 @@
1
+ import { ToastLocation, ToastType } from "./Constants";
2
+
3
+ export class ToastMessage {
4
+ public type: ToastType;
5
+ public message: string;
6
+ public description: string;
7
+ public placement: ToastLocation = ToastLocation.BottomLeft;
8
+
9
+ constructor(type: ToastType, message: string, description: string) {
10
+ this.type = type;
11
+ this.message = message;
12
+ this.description = description;
13
+ }
14
+ }
@@ -0,0 +1,4 @@
1
+ export { ToastLocation, ToastType } from './Constants';
2
+ export { ToastMessage } from './Toast';
3
+ export { useDialogService } from './DialogService';
4
+ export { useDrawerService } from './DrawerService';