taxtank-core 0.33.2 → 0.33.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (450) hide show
  1. package/common/src/db/enums/user/user-roles.enum.d.ts +1 -0
  2. package/common/src/services/mixpanel.service.d.ts +1 -0
  3. package/esm2022/common/src/common.module.mjs +7 -5
  4. package/esm2022/common/src/db/enums/user/user-roles.enum.mjs +2 -1
  5. package/esm2022/common/src/interceptors/interceptors.module.mjs +5 -5
  6. package/esm2022/common/src/interceptors/jwt-interceptor.mjs +6 -6
  7. package/esm2022/common/src/services/auth/auth.service.mjs +6 -6
  8. package/esm2022/common/src/services/auth/jwt.service.mjs +4 -4
  9. package/esm2022/common/src/services/mixpanel.service.mjs +13 -7
  10. package/esm2022/public-api.mjs +2 -3
  11. package/esm2022/src/lib/collections/bank-transaction.collection.mjs +2 -2
  12. package/esm2022/src/lib/collections/chat/chat.collection.mjs +1 -19
  13. package/esm2022/src/lib/collections/client-movement.collection.mjs +5 -4
  14. package/esm2022/src/lib/collections/client.collection.mjs +1 -1
  15. package/esm2022/src/lib/collections/collection-dictionary.mjs +4 -1
  16. package/esm2022/src/lib/collections/collection.mjs +14 -3
  17. package/esm2022/src/lib/collections/firm/employee-invite.collection.mjs +10 -0
  18. package/esm2022/src/lib/collections/firm/employee.collection.mjs +18 -0
  19. package/esm2022/src/lib/collections/firm/index.mjs +3 -0
  20. package/esm2022/src/lib/collections/holding/holding-sale.collection.mjs +2 -2
  21. package/esm2022/src/lib/collections/income-source/income-source.collection.mjs +2 -2
  22. package/esm2022/src/lib/collections/index.mjs +3 -2
  23. package/esm2022/src/lib/collections/property/property-valuation.collection.mjs +11 -1
  24. package/esm2022/src/lib/collections/report/property/property-report-item-depreciation.collection.mjs +2 -2
  25. package/esm2022/src/lib/collections/report/property/property-report-item-transaction.collection.mjs +2 -2
  26. package/esm2022/src/lib/collections/report/property/property-report-item.collection.mjs +1 -1
  27. package/esm2022/src/lib/collections/tax-review.collection.mjs +1 -7
  28. package/esm2022/src/lib/collections/transaction/transaction.collection.mjs +4 -1
  29. package/esm2022/src/lib/collections/user/user.collection.mjs +4 -0
  30. package/esm2022/src/lib/collections/vehicle/vehicle-logbook.collection.mjs +13 -1
  31. package/esm2022/src/lib/core.module.mjs +6 -5
  32. package/esm2022/src/lib/db/Enums/bank/bank-connection-status.enum.mjs +2 -1
  33. package/esm2022/src/lib/db/Enums/chart-accounts/chart-accounts-property-adjustments-list.enum.mjs +2 -2
  34. package/esm2022/src/lib/db/Enums/firm/employee-invite-role.enum.mjs +6 -0
  35. package/esm2022/src/lib/db/Enums/firm/firm-type.enum.mjs +6 -0
  36. package/esm2022/src/lib/db/Enums/firm/index.mjs +3 -0
  37. package/esm2022/src/lib/db/Enums/holding/holding-type-exchange-list.enum.mjs +6 -5
  38. package/esm2022/src/lib/db/Enums/index.mjs +3 -1
  39. package/esm2022/src/lib/db/Enums/user/gender.enum.mjs +14 -0
  40. package/esm2022/src/lib/db/Enums/user/index.mjs +2 -0
  41. package/esm2022/src/lib/db/Json/chart-accounts/chart-accounts-value.json +59 -4
  42. package/esm2022/src/lib/db/Models/bank/bank-account.mjs +1 -1
  43. package/esm2022/src/lib/db/Models/bank/bank-connection.mjs +1 -1
  44. package/esm2022/src/lib/db/Models/client/annual-client-details.mjs +1 -1
  45. package/esm2022/src/lib/db/Models/client/client-details.mjs +1 -1
  46. package/esm2022/src/lib/db/Models/firm/accountant/tax-review.mjs +1 -1
  47. package/esm2022/src/lib/db/Models/firm/chat.mjs +1 -1
  48. package/esm2022/src/lib/db/Models/firm/client-invite.mjs +1 -1
  49. package/esm2022/src/lib/db/Models/firm/client-movement.mjs +1 -1
  50. package/esm2022/src/lib/db/Models/firm/employee-invite.mjs +1 -1
  51. package/esm2022/src/lib/db/Models/firm/firm.mjs +1 -1
  52. package/esm2022/src/lib/db/Models/firm/message-document.mjs +1 -1
  53. package/esm2022/src/lib/db/Models/incomeSource/income-source-forecast.mjs +1 -1
  54. package/esm2022/src/lib/db/Models/incomeSource/income-source.mjs +1 -1
  55. package/esm2022/src/lib/db/Models/incomeSource/salary-forecast.mjs +1 -1
  56. package/esm2022/src/lib/db/Models/property/property-forecast.mjs +1 -1
  57. package/esm2022/src/lib/db/Models/sole/sole-business-loss.mjs +1 -1
  58. package/esm2022/src/lib/db/Models/sole/sole-business.mjs +3 -3
  59. package/esm2022/src/lib/db/Models/sole/sole-forecast.mjs +1 -1
  60. package/esm2022/src/lib/db/Models/transaction/transaction-base.mjs +3 -4
  61. package/esm2022/src/lib/db/Models/user/employee-details.mjs +1 -1
  62. package/esm2022/src/lib/db/Models/user/user.mjs +1 -1
  63. package/esm2022/src/lib/db/Models/vehicle/vehicle-claim-details.mjs +1 -1
  64. package/esm2022/src/lib/forms/abstract.form.mjs +9 -4
  65. package/esm2022/src/lib/forms/address/address.form.mjs +1 -1
  66. package/esm2022/src/lib/forms/bank/bank-account/bank-accounts-import.form.mjs +2 -2
  67. package/esm2022/src/lib/forms/chat/chat-filter.form.mjs +36 -0
  68. package/esm2022/src/lib/forms/chat/index.mjs +2 -0
  69. package/esm2022/src/lib/forms/client/annual-client-details.form.mjs +1 -2
  70. package/esm2022/src/lib/forms/client/capital-loss.form.mjs +13 -0
  71. package/esm2022/src/lib/forms/client/index.mjs +2 -1
  72. package/esm2022/src/lib/forms/collection.form.mjs +29 -0
  73. package/esm2022/src/lib/forms/firm/client-invite-put.form.mjs +13 -0
  74. package/esm2022/src/lib/forms/firm/client-invite.form.mjs +18 -0
  75. package/esm2022/src/lib/forms/firm/client-movement.form.mjs +22 -0
  76. package/esm2022/src/lib/forms/firm/employee-details.form.mjs +21 -0
  77. package/esm2022/src/lib/forms/firm/employee-invite.form.mjs +24 -0
  78. package/esm2022/src/lib/forms/firm/firm-branch.form.mjs +13 -0
  79. package/esm2022/src/lib/forms/firm/firm-invite.form.mjs +18 -0
  80. package/esm2022/src/lib/forms/firm/index.mjs +8 -1
  81. package/esm2022/src/lib/forms/holding/holding-reinvest.form.mjs +30 -4
  82. package/esm2022/src/lib/forms/index.mjs +4 -1
  83. package/esm2022/src/lib/forms/loan/loan.form.mjs +3 -7
  84. package/esm2022/src/lib/forms/register/register-client.form.mjs +9 -6
  85. package/esm2022/src/lib/forms/register/register-firm.form.mjs +4 -4
  86. package/esm2022/src/lib/forms/report/my-tax/my-tax-deductions.form.mjs +1 -1
  87. package/esm2022/src/lib/forms/report/my-tax/my-tax-rent.form.mjs +1 -1
  88. package/esm2022/src/lib/forms/sole/bas-report.form.mjs +3 -2
  89. package/esm2022/src/lib/forms/sole/sole-contact.form.mjs +4 -3
  90. package/esm2022/src/lib/forms/sole/sole-invoice.form.mjs +3 -2
  91. package/esm2022/src/lib/forms/tax-review/index.mjs +3 -0
  92. package/esm2022/src/lib/forms/tax-review/tax-review-filter-status.enum.mjs +6 -0
  93. package/esm2022/src/lib/forms/tax-review/tax-review-filter.form.mjs +49 -0
  94. package/esm2022/src/lib/forms/transaction/holding/holding-income.form.mjs +19 -9
  95. package/esm2022/src/lib/forms/transaction/index.mjs +2 -1
  96. package/esm2022/src/lib/forms/transaction/sole/sole-income.form.mjs +1 -1
  97. package/esm2022/src/lib/forms/transaction/transaction-base-filter.form.mjs +35 -0
  98. package/esm2022/src/lib/forms/transaction/transaction.form.mjs +1 -1
  99. package/esm2022/src/lib/forms/transaction/work/work-transaction.form.mjs +2 -4
  100. package/esm2022/src/lib/forms/user/client-details.form.mjs +2 -2
  101. package/esm2022/src/lib/forms/user/user-invite.form.mjs +3 -2
  102. package/esm2022/src/lib/forms/user/user.form.mjs +11 -8
  103. package/esm2022/src/lib/forms/vehicle/vehicle-claim-details.form.mjs +1 -1
  104. package/esm2022/src/lib/forms/vehicle/vehicle-claim.form.mjs +1 -3
  105. package/esm2022/src/lib/forms/vehicle/vehicle-logbook.form.mjs +3 -4
  106. package/esm2022/src/lib/interceptors/basiq-client-id.interceptor.mjs +5 -5
  107. package/esm2022/src/lib/interceptors/basiq-token.interceptor.mjs +5 -5
  108. package/esm2022/src/lib/interceptors/corelogic-interceptor.mjs +6 -6
  109. package/esm2022/src/lib/interceptors/financial-year-interceptor.mjs +6 -6
  110. package/esm2022/src/lib/interceptors/interceptors.module.mjs +5 -5
  111. package/esm2022/src/lib/interceptors/preloader.interceptor.mjs +5 -5
  112. package/esm2022/src/lib/interceptors/rewardful.interceptor.mjs +7 -6
  113. package/esm2022/src/lib/interceptors/user-switcher-interceptor.mjs +6 -6
  114. package/esm2022/src/lib/models/bank/bank-connection.mjs +22 -1
  115. package/esm2022/src/lib/models/chat/chat.mjs +6 -2
  116. package/esm2022/src/lib/models/chat/message-document.mjs +4 -4
  117. package/esm2022/src/lib/models/client/annual-client-details.mjs +1 -1
  118. package/esm2022/src/lib/models/client/capital-loss.interface.mjs +2 -0
  119. package/esm2022/src/lib/models/client/capital-loss.mjs +15 -0
  120. package/esm2022/src/lib/models/client/client-details.mjs +27 -1
  121. package/esm2022/src/lib/models/client/client-invite.mjs +8 -5
  122. package/esm2022/src/lib/models/client/client-movement.mjs +8 -5
  123. package/esm2022/src/lib/models/client/index.mjs +3 -1
  124. package/esm2022/src/lib/models/depreciation/depreciation.mjs +4 -2
  125. package/esm2022/src/lib/models/employee/employee-details.mjs +8 -2
  126. package/esm2022/src/lib/models/employee/employee-invite.mjs +18 -2
  127. package/esm2022/src/lib/models/endpoint/endpoints.const.mjs +22 -13
  128. package/esm2022/src/lib/models/event/app-event-type.enum.mjs +20 -21
  129. package/esm2022/src/lib/models/file/file.mjs +4 -1
  130. package/esm2022/src/lib/models/financial-year/financial-year.mjs +3 -3
  131. package/esm2022/src/lib/models/firm/firm-branch.interface.mjs +2 -0
  132. package/esm2022/src/lib/models/firm/firm-branch.mjs +22 -0
  133. package/esm2022/src/lib/models/firm/firm.mjs +2 -2
  134. package/esm2022/src/lib/models/firm/index.mjs +3 -0
  135. package/esm2022/src/lib/models/holding/holding.mjs +4 -4
  136. package/esm2022/src/lib/models/income-source/salary-forecast.mjs +1 -1
  137. package/esm2022/src/lib/models/income-source/sole-forecast.mjs +1 -1
  138. package/esm2022/src/lib/models/index.mjs +2 -1
  139. package/esm2022/src/lib/models/property/property-equity-chart-data.mjs +11 -7
  140. package/esm2022/src/lib/models/property/property-forecast.mjs +1 -7
  141. package/esm2022/src/lib/models/property/property.mjs +6 -2
  142. package/esm2022/src/lib/models/registration-invite/registration-invite.mjs +5 -1
  143. package/esm2022/src/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.mjs +4 -4
  144. package/esm2022/src/lib/models/report/my-tax/my-tax-income-statements/my-tax-income-statements.mjs +2 -1
  145. package/esm2022/src/lib/models/report/my-tax/my-tax-rent/my-tax-rent.mjs +4 -9
  146. package/esm2022/src/lib/models/report/property/property-report-item-transaction.mjs +1 -1
  147. package/esm2022/src/lib/models/sole/bas-report.mjs +4 -1
  148. package/esm2022/src/lib/models/sole/sole-business-loss.mjs +1 -1
  149. package/esm2022/src/lib/models/sole/sole-invoice.mjs +7 -6
  150. package/esm2022/src/lib/models/tax-review/tax-review.mjs +12 -2
  151. package/esm2022/src/lib/models/tax-summary/tax-summary.mjs +3 -2
  152. package/esm2022/src/lib/models/transaction/transaction.mjs +1 -1
  153. package/esm2022/src/lib/models/user/user.mjs +8 -5
  154. package/esm2022/src/lib/models/vehicle/vehicle-claim-details.mjs +3 -3
  155. package/esm2022/src/lib/models/vehicle/vehicle-claim.mjs +1 -1
  156. package/esm2022/src/lib/pipes/app-currency.pipe.mjs +4 -4
  157. package/esm2022/src/lib/pipes/safe-url.pipe.mjs +5 -5
  158. package/esm2022/src/lib/services/account-setup/account-setup.service.mjs +9 -9
  159. package/esm2022/src/lib/services/asset/assets.service.mjs +6 -6
  160. package/esm2022/src/lib/services/bank/bank-account-calculation.service.mjs +4 -4
  161. package/esm2022/src/lib/services/data.service.mjs +4 -4
  162. package/esm2022/src/lib/services/event/event-dispatcher.service.mjs +4 -4
  163. package/esm2022/src/lib/services/event/sse.service.mjs +6 -6
  164. package/esm2022/src/lib/services/export/export-formatter.service.mjs +5 -5
  165. package/esm2022/src/lib/services/firm/current-firm-branch.service.mjs +26 -0
  166. package/esm2022/src/lib/services/firm/index.mjs +2 -0
  167. package/esm2022/src/lib/services/header-title/header-title.service.mjs +5 -5
  168. package/esm2022/src/lib/services/http/address/address.service.mjs +6 -6
  169. package/esm2022/src/lib/services/http/bank/bank-account/bank-account.service.mjs +6 -6
  170. package/esm2022/src/lib/services/http/bank/bank-connection/bank-connection-messages.enum.mjs +5 -2
  171. package/esm2022/src/lib/services/http/bank/bank-connection/bank-connection.service.mjs +11 -7
  172. package/esm2022/src/lib/services/http/bank/bank-transaction/bank-transaction.service.mjs +6 -6
  173. package/esm2022/src/lib/services/http/bank/bank.service.mjs +4 -4
  174. package/esm2022/src/lib/services/http/bank/basiq/basiq-token.service.mjs +4 -4
  175. package/esm2022/src/lib/services/http/bank/basiq/basiq.service.mjs +22 -6
  176. package/esm2022/src/lib/services/http/budget/budget.service.mjs +4 -4
  177. package/esm2022/src/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.mjs +4 -4
  178. package/esm2022/src/lib/services/http/chart-accounts/chart-accounts.service.mjs +4 -4
  179. package/esm2022/src/lib/services/http/chat/chat.service.mjs +10 -10
  180. package/esm2022/src/lib/services/http/chat/message-document.service.mjs +6 -6
  181. package/esm2022/src/lib/services/http/chat/message.service.mjs +10 -6
  182. package/esm2022/src/lib/services/http/client/annual-client-details.service.mjs +23 -0
  183. package/esm2022/src/lib/services/http/client/capital-loss/capital-loss-messages.enum.mjs +7 -0
  184. package/esm2022/src/lib/services/http/client/capital-loss/capital-loss.service.mjs +23 -0
  185. package/esm2022/src/lib/services/http/client/capital-loss/index.mjs +3 -0
  186. package/esm2022/src/lib/services/http/client/client-coupon.service.mjs +4 -4
  187. package/esm2022/src/lib/services/http/client/index.mjs +3 -2
  188. package/esm2022/src/lib/services/http/client/occupation/occupation.service.mjs +6 -6
  189. package/esm2022/src/lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service.mjs +4 -4
  190. package/esm2022/src/lib/services/http/depreciation/depreciation.service.mjs +6 -6
  191. package/esm2022/src/lib/services/http/document/document-folder/document-folder.service.mjs +4 -4
  192. package/esm2022/src/lib/services/http/document/document.service.mjs +4 -4
  193. package/esm2022/src/lib/services/http/facebook/facebook.service.mjs +6 -6
  194. package/esm2022/src/lib/services/http/file/file.service.mjs +4 -4
  195. package/esm2022/src/lib/services/http/firm/client-invite/client-invite-messages.enum.mjs +2 -2
  196. package/esm2022/src/lib/services/http/firm/client-invite/client-invite.service.mjs +9 -12
  197. package/esm2022/src/lib/services/http/firm/client-movement/client-movement-messages.enum.mjs +8 -0
  198. package/esm2022/src/lib/services/http/firm/client-movement/client-movement.service.mjs +8 -7
  199. package/esm2022/src/lib/services/http/firm/client-movement/index.mjs +2 -1
  200. package/esm2022/src/lib/services/http/firm/employee/employee-messages.enum.mjs +2 -1
  201. package/esm2022/src/lib/services/http/firm/employee/employee.service.mjs +14 -8
  202. package/esm2022/src/lib/services/http/firm/employee-invite/employee-invite.service.mjs +9 -9
  203. package/esm2022/src/lib/services/http/firm/firm-branch/firm-branch-messages.enum.mjs +9 -0
  204. package/esm2022/src/lib/services/http/firm/firm-branch/firm-branch.service.mjs +23 -0
  205. package/esm2022/src/lib/services/http/firm/firm-branch/index.mjs +3 -0
  206. package/esm2022/src/lib/services/http/firm/firm.service.mjs +7 -7
  207. package/esm2022/src/lib/services/http/firm/index.mjs +2 -1
  208. package/esm2022/src/lib/services/http/firm/portfolio-report/client-portfolio-report.service.mjs +6 -6
  209. package/esm2022/src/lib/services/http/google/google.service.mjs +6 -6
  210. package/esm2022/src/lib/services/http/holding/holding-import/holding-import.service.mjs +4 -4
  211. package/esm2022/src/lib/services/http/holding/holding-sale.service.mjs +4 -4
  212. package/esm2022/src/lib/services/http/holding/holding-type.service.mjs +4 -4
  213. package/esm2022/src/lib/services/http/holding/holding.service.mjs +7 -7
  214. package/esm2022/src/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.mjs +6 -6
  215. package/esm2022/src/lib/services/http/income-source/income-source.service.mjs +8 -8
  216. package/esm2022/src/lib/services/http/income-source/salary-forecast/salary-forecast.service.mjs +6 -6
  217. package/esm2022/src/lib/services/http/income-source/sole-forecast/sole-forecast.service.mjs +9 -8
  218. package/esm2022/src/lib/services/http/loan/borrowing-expense/borrowing-expense.service.mjs +6 -6
  219. package/esm2022/src/lib/services/http/loan/loan.service.mjs +6 -6
  220. package/esm2022/src/lib/services/http/pdf/pdf.service.mjs +6 -6
  221. package/esm2022/src/lib/services/http/property/borrowing-report/borrowing-report.service.mjs +4 -4
  222. package/esm2022/src/lib/services/http/property/property-category/property-category.service.mjs +4 -4
  223. package/esm2022/src/lib/services/http/property/property-category-movement/property-category-movement.service.mjs +4 -4
  224. package/esm2022/src/lib/services/http/property/property-document/property-document.service.mjs +4 -4
  225. package/esm2022/src/lib/services/http/property/property-sale/property-sale.service.mjs +4 -4
  226. package/esm2022/src/lib/services/http/property/property-share/property-share.service.mjs +6 -6
  227. package/esm2022/src/lib/services/http/property/property-valuation/property-valuation.service.mjs +6 -6
  228. package/esm2022/src/lib/services/http/property/property.service.mjs +7 -6
  229. package/esm2022/src/lib/services/http/rest/rest-old.service.mjs +6 -6
  230. package/esm2022/src/lib/services/http/rest/rest.service.mjs +12 -7
  231. package/esm2022/src/lib/services/http/service-notification/service-notification.service.mjs +6 -6
  232. package/esm2022/src/lib/services/http/setup-item/setup-item.service.mjs +4 -4
  233. package/esm2022/src/lib/services/http/sole/bas-report/bas-report-messages.enum.mjs +8 -0
  234. package/esm2022/src/lib/services/http/sole/bas-report/bas-report.service.mjs +4 -4
  235. package/esm2022/src/lib/services/http/sole/bas-report/index.mjs +3 -0
  236. package/esm2022/src/lib/services/http/sole/index.mjs +2 -2
  237. package/esm2022/src/lib/services/http/sole/sole-business/sole-business.service.mjs +10 -14
  238. package/esm2022/src/lib/services/http/sole/sole-business-activity/sole-business-activity.service.mjs +4 -4
  239. package/esm2022/src/lib/services/http/sole/sole-business-loss/sole-business-loss-rules/sole-business-loss-offset-rule.service.mjs +4 -4
  240. package/esm2022/src/lib/services/http/sole/sole-business-loss/sole-business-loss.service.mjs +8 -9
  241. package/esm2022/src/lib/services/http/sole/sole-contact/sole-contact.service.mjs +4 -4
  242. package/esm2022/src/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.mjs +6 -6
  243. package/esm2022/src/lib/services/http/sole/sole-details/sole-details.service.mjs +6 -6
  244. package/esm2022/src/lib/services/http/sole/sole-invoice/sole-invoice.service.mjs +6 -6
  245. package/esm2022/src/lib/services/http/sole/sole-invoice-template/sole-invoice-template.service.mjs +4 -4
  246. package/esm2022/src/lib/services/http/subscription/service-payment/service-payment.service.mjs +4 -4
  247. package/esm2022/src/lib/services/http/subscription/service-payment-method/service-payment-method.service.mjs +6 -6
  248. package/esm2022/src/lib/services/http/subscription/service-price/service-price.service.mjs +4 -4
  249. package/esm2022/src/lib/services/http/subscription/service-product/service-product.service.mjs +4 -4
  250. package/esm2022/src/lib/services/http/subscription/service-subscription/subscription.service.mjs +6 -6
  251. package/esm2022/src/lib/services/http/tax-review/tax-review-history/tax-review-history.service.mjs +6 -6
  252. package/esm2022/src/lib/services/http/tax-review/tax-review.service.mjs +6 -6
  253. package/esm2022/src/lib/services/http/tax-summary/tax-summary.service.mjs +6 -6
  254. package/esm2022/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.mjs +4 -4
  255. package/esm2022/src/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.mjs +6 -6
  256. package/esm2022/src/lib/services/http/transaction/transaction.service.mjs +6 -6
  257. package/esm2022/src/lib/services/http/user/financial-year/financial-year.service.mjs +6 -6
  258. package/esm2022/src/lib/services/http/user/user-event-setting/user-event-setting.service.mjs +4 -4
  259. package/esm2022/src/lib/services/http/user/user-event-type/user-event-type.service.mjs +4 -4
  260. package/esm2022/src/lib/services/http/user/user.service.mjs +6 -6
  261. package/esm2022/src/lib/services/http/user/users-invite/users-invite.service.mjs +4 -4
  262. package/esm2022/src/lib/services/http/vehicle/vehicle-claim-details.service.mjs +6 -6
  263. package/esm2022/src/lib/services/http/vehicle/vehicle-claim.service.mjs +19 -8
  264. package/esm2022/src/lib/services/http/vehicle/vehicle-logbook/vehicle-logbook.service.mjs +6 -5
  265. package/esm2022/src/lib/services/http/vehicle/vehicle.service.mjs +4 -4
  266. package/esm2022/src/lib/services/http/youtube/youtube.service.mjs +6 -6
  267. package/esm2022/src/lib/services/index.mjs +2 -1
  268. package/esm2022/src/lib/services/intercom/intercom.service.mjs +6 -6
  269. package/esm2022/src/lib/services/json/chart-accounts/chart-accounts-value.service.mjs +5 -5
  270. package/esm2022/src/lib/services/json/holding/holding-type-exchange.service.mjs +5 -5
  271. package/esm2022/src/lib/services/json/income-source/income-source-type.service.mjs +5 -5
  272. package/esm2022/src/lib/services/json/tax-exemption/tax-exemption.service.mjs +5 -5
  273. package/esm2022/src/lib/services/json/tax-return/tax-return-item.service.mjs +5 -5
  274. package/esm2022/src/lib/services/pdf/pdf-from-dom-element/pdf-from-dom-element.service.mjs +4 -4
  275. package/esm2022/src/lib/services/pdf/pdf-from-table/pdf-from-data-table/pdf-from-data-table.service.mjs +5 -5
  276. package/esm2022/src/lib/services/pdf/pdf-from-table/pdf-from-html-table/pdf-from-html-table.service.mjs +4 -4
  277. package/esm2022/src/lib/services/pdf/pdf-from-table/pdf-from-table.service.mjs +4 -4
  278. package/esm2022/src/lib/services/preloader/preloader.service.mjs +5 -5
  279. package/esm2022/src/lib/services/property/corelogic/corelogic.service.mjs +6 -6
  280. package/esm2022/src/lib/services/property/equity-position-chart/equity-position-chart.service.mjs +6 -6
  281. package/esm2022/src/lib/services/property/property-calculation/property-calculation.service.mjs +4 -4
  282. package/esm2022/src/lib/services/report/property/property-transaction-report.service.mjs +17 -12
  283. package/esm2022/src/lib/services/toast/toast.service.mjs +4 -4
  284. package/esm2022/src/lib/services/user/user-switcher.service.mjs +4 -4
  285. package/esm2022/src/lib/services/xlsx/xlsx.service.mjs +4 -4
  286. package/esm2022/src/lib/validators/date-range.validator.mjs +1 -1
  287. package/esm2022/src/lib/validators/fields-sum.validator.mjs +1 -1
  288. package/esm2022/src/lib/validators/greater-than.validator.mjs +1 -1
  289. package/esm2022/src/lib/validators/index.mjs +3 -1
  290. package/esm2022/src/lib/validators/match-sum.validator.mjs +16 -0
  291. package/esm2022/src/lib/validators/string/alpha-space.validator.mjs +10 -0
  292. package/esm2022/src/lib/validators/unique-email.validator.mjs +5 -5
  293. package/fesm2022/taxtank-core-common.mjs +36 -27
  294. package/fesm2022/taxtank-core-common.mjs.map +1 -1
  295. package/fesm2022/taxtank-core.mjs +1544 -869
  296. package/fesm2022/taxtank-core.mjs.map +1 -1
  297. package/package.json +1 -1
  298. package/public-api.d.ts +1 -2
  299. package/src/lib/collections/bank-transaction.collection.d.ts +3 -2
  300. package/src/lib/collections/chat/chat.collection.d.ts +1 -5
  301. package/src/lib/collections/client-movement.collection.d.ts +2 -2
  302. package/src/lib/collections/client.collection.d.ts +1 -1
  303. package/src/lib/collections/collection-dictionary.d.ts +1 -0
  304. package/src/lib/collections/collection.d.ts +5 -1
  305. package/src/lib/collections/firm/employee-invite.collection.d.ts +5 -0
  306. package/src/lib/collections/firm/employee.collection.d.ts +6 -0
  307. package/src/lib/collections/firm/index.d.ts +2 -0
  308. package/src/lib/collections/income-source/income-source.collection.d.ts +1 -1
  309. package/src/lib/collections/index.d.ts +2 -1
  310. package/src/lib/collections/property/property-valuation.collection.d.ts +4 -0
  311. package/src/lib/collections/report/property/property-report-item-depreciation.collection.d.ts +2 -2
  312. package/src/lib/collections/report/property/property-report-item-transaction.collection.d.ts +3 -3
  313. package/src/lib/collections/report/property/property-report-item.collection.d.ts +1 -1
  314. package/src/lib/collections/tax-review.collection.d.ts +0 -4
  315. package/src/lib/collections/transaction/transaction.collection.d.ts +1 -0
  316. package/src/lib/collections/user/user.collection.d.ts +4 -0
  317. package/src/lib/collections/vehicle/vehicle-logbook.collection.d.ts +6 -0
  318. package/src/lib/core.module.d.ts +2 -1
  319. package/src/lib/db/Enums/bank/bank-connection-status.enum.d.ts +1 -0
  320. package/src/lib/db/Enums/chart-accounts/chart-accounts-property-adjustments-list.enum.d.ts +1 -1
  321. package/src/lib/db/Enums/firm/employee-invite-role.enum.d.ts +4 -0
  322. package/src/lib/db/Enums/firm/index.d.ts +2 -0
  323. package/src/lib/db/Enums/holding/holding-type-exchange-list.enum.d.ts +5 -4
  324. package/src/lib/db/Enums/index.d.ts +2 -0
  325. package/src/lib/db/Enums/user/gender.enum.d.ts +12 -0
  326. package/src/lib/db/Enums/user/index.d.ts +1 -0
  327. package/src/lib/db/Models/bank/bank-connection.d.ts +1 -0
  328. package/src/lib/db/Models/client/annual-client-details.d.ts +0 -1
  329. package/src/lib/db/Models/client/client-details.d.ts +1 -0
  330. package/src/lib/db/Models/firm/accountant/tax-review.d.ts +2 -0
  331. package/src/lib/db/Models/firm/chat.d.ts +2 -0
  332. package/src/lib/db/Models/firm/client-invite.d.ts +5 -2
  333. package/src/lib/db/Models/firm/client-movement.d.ts +2 -2
  334. package/src/lib/db/Models/firm/employee-invite.d.ts +4 -2
  335. package/src/lib/db/Models/firm/firm.d.ts +1 -1
  336. package/src/lib/db/Models/firm/message-document.d.ts +2 -6
  337. package/src/lib/db/Models/incomeSource/income-source-forecast.d.ts +2 -1
  338. package/src/lib/db/Models/incomeSource/income-source.d.ts +1 -1
  339. package/src/lib/db/Models/incomeSource/salary-forecast.d.ts +1 -0
  340. package/src/lib/db/Models/property/property-forecast.d.ts +1 -0
  341. package/src/lib/db/Models/sole/sole-business-loss.d.ts +1 -0
  342. package/src/lib/db/Models/sole/sole-business.d.ts +2 -2
  343. package/src/lib/db/Models/sole/sole-forecast.d.ts +1 -0
  344. package/src/lib/db/Models/user/employee-details.d.ts +2 -0
  345. package/src/lib/db/Models/user/user.d.ts +2 -0
  346. package/src/lib/db/Models/vehicle/vehicle-claim-details.d.ts +1 -1
  347. package/src/lib/forms/abstract.form.d.ts +14 -7
  348. package/src/lib/forms/bank/bank-account/bank-accounts-import.form.d.ts +1 -1
  349. package/src/lib/forms/chat/chat-filter.form.d.ts +18 -0
  350. package/src/lib/forms/chat/index.d.ts +1 -0
  351. package/src/lib/forms/client/capital-loss.form.d.ts +6 -0
  352. package/src/lib/forms/client/index.d.ts +1 -0
  353. package/src/lib/forms/collection.form.d.ts +14 -0
  354. package/src/lib/forms/firm/client-invite-put.form.d.ts +11 -0
  355. package/src/lib/forms/firm/client-invite.form.d.ts +15 -0
  356. package/src/lib/forms/firm/client-movement.form.d.ts +14 -0
  357. package/src/lib/forms/firm/employee-details.form.d.ts +14 -0
  358. package/src/lib/forms/firm/employee-invite.form.d.ts +17 -0
  359. package/src/lib/forms/firm/firm-branch.form.d.ts +5 -0
  360. package/src/lib/forms/firm/firm-invite.form.d.ts +15 -0
  361. package/src/lib/forms/firm/index.d.ts +7 -0
  362. package/src/lib/forms/holding/holding-reinvest.form.d.ts +7 -0
  363. package/src/lib/forms/index.d.ts +3 -0
  364. package/src/lib/forms/loan/loan.form.d.ts +2 -2
  365. package/src/lib/forms/register/register-client.form.d.ts +1 -1
  366. package/src/lib/forms/register/register-firm.form.d.ts +2 -2
  367. package/src/lib/forms/report/my-tax/my-tax-deductions.form.d.ts +1 -1
  368. package/src/lib/forms/report/my-tax/my-tax-rent.form.d.ts +1 -1
  369. package/src/lib/forms/tax-review/index.d.ts +2 -0
  370. package/src/lib/forms/tax-review/tax-review-filter-status.enum.d.ts +4 -0
  371. package/src/lib/forms/tax-review/tax-review-filter.form.d.ts +21 -0
  372. package/src/lib/forms/transaction/holding/holding-income.form.d.ts +8 -1
  373. package/src/lib/forms/transaction/index.d.ts +1 -0
  374. package/src/lib/forms/transaction/transaction-base-filter.form.d.ts +19 -0
  375. package/src/lib/forms/transaction/work/work-transaction.form.d.ts +1 -1
  376. package/src/lib/forms/user/user.form.d.ts +15 -3
  377. package/src/lib/forms/vehicle/vehicle-claim.form.d.ts +0 -2
  378. package/src/lib/models/bank/bank-connection.d.ts +8 -0
  379. package/src/lib/models/chat/chat.d.ts +3 -1
  380. package/src/lib/models/chat/message-document.d.ts +4 -4
  381. package/src/lib/models/client/annual-client-details.d.ts +0 -1
  382. package/src/lib/models/client/capital-loss.d.ts +9 -0
  383. package/src/lib/models/client/capital-loss.interface.d.ts +6 -0
  384. package/src/lib/models/client/client-details.d.ts +8 -0
  385. package/src/lib/models/client/client-invite.d.ts +3 -2
  386. package/src/lib/models/client/client-movement.d.ts +3 -2
  387. package/src/lib/models/client/index.d.ts +2 -0
  388. package/src/lib/models/employee/employee-details.d.ts +3 -1
  389. package/src/lib/models/employee/employee-invite.d.ts +7 -1
  390. package/src/lib/models/event/app-event-type.enum.d.ts +19 -20
  391. package/src/lib/models/file/file.d.ts +1 -0
  392. package/src/lib/models/firm/firm-branch.d.ts +12 -0
  393. package/src/lib/models/firm/firm-branch.interface.d.ts +7 -0
  394. package/src/lib/models/firm/index.d.ts +2 -0
  395. package/src/lib/models/holding/holding.d.ts +0 -1
  396. package/src/lib/models/index.d.ts +1 -0
  397. package/src/lib/models/property/property-equity-chart-data.d.ts +7 -7
  398. package/src/lib/models/property/property-forecast.d.ts +0 -4
  399. package/src/lib/models/registration-invite/registration-invite.d.ts +2 -0
  400. package/src/lib/models/report/my-tax/my-tax-deductions/my-tax-deductions.d.ts +1 -1
  401. package/src/lib/models/report/property/property-report-item-transaction.d.ts +3 -3
  402. package/src/lib/models/tax-review/tax-review.d.ts +5 -1
  403. package/src/lib/models/user/user.d.ts +2 -3
  404. package/src/lib/models/vehicle/vehicle-claim-details.d.ts +1 -1
  405. package/src/lib/services/firm/current-firm-branch.service.d.ts +11 -0
  406. package/src/lib/services/firm/index.d.ts +1 -0
  407. package/src/lib/services/http/bank/bank-connection/bank-connection-messages.enum.d.ts +5 -2
  408. package/src/lib/services/http/bank/basiq/basiq.service.d.ts +8 -0
  409. package/src/lib/services/http/chat/message.service.d.ts +2 -0
  410. package/src/lib/services/http/client/{capital-gain/annual-client-details.service.d.ts → annual-client-details.service.d.ts} +4 -4
  411. package/src/lib/services/http/client/capital-loss/capital-loss-messages.enum.d.ts +5 -0
  412. package/src/lib/services/http/client/capital-loss/capital-loss.service.d.ts +12 -0
  413. package/src/lib/services/http/client/capital-loss/index.d.ts +2 -0
  414. package/src/lib/services/http/client/index.d.ts +2 -1
  415. package/src/lib/services/http/firm/client-invite/client-invite-messages.enum.d.ts +1 -1
  416. package/src/lib/services/http/firm/client-invite/client-invite.service.d.ts +0 -1
  417. package/src/lib/services/http/firm/client-movement/client-movement-messages.enum.d.ts +6 -0
  418. package/src/lib/services/http/firm/client-movement/client-movement.service.d.ts +2 -1
  419. package/src/lib/services/http/firm/client-movement/index.d.ts +1 -0
  420. package/src/lib/services/http/firm/employee/employee-messages.enum.d.ts +2 -1
  421. package/src/lib/services/http/firm/employee/employee.service.d.ts +4 -3
  422. package/src/lib/services/http/firm/employee-invite/employee-invite.service.d.ts +3 -3
  423. package/src/lib/services/http/firm/firm-branch/firm-branch-messages.enum.d.ts +7 -0
  424. package/src/lib/services/http/firm/firm-branch/firm-branch.service.d.ts +13 -0
  425. package/src/lib/services/http/firm/firm-branch/index.d.ts +2 -0
  426. package/src/lib/services/http/firm/firm.service.d.ts +2 -2
  427. package/src/lib/services/http/firm/index.d.ts +1 -0
  428. package/src/lib/services/http/holding/holding-sale.service.d.ts +1 -2
  429. package/src/lib/services/http/property/property-valuation/property-valuation.service.d.ts +1 -2
  430. package/src/lib/services/http/rest/rest.service.d.ts +5 -0
  431. package/src/lib/services/http/sole/bas-report/bas-report-messages.enum.d.ts +6 -0
  432. package/src/lib/services/http/sole/bas-report/index.d.ts +2 -0
  433. package/src/lib/services/http/sole/index.d.ts +1 -1
  434. package/src/lib/services/http/sole/sole-business/sole-business.service.d.ts +7 -5
  435. package/src/lib/services/http/vehicle/vehicle-claim.service.d.ts +5 -1
  436. package/src/lib/services/http/vehicle/vehicle-logbook/vehicle-logbook.service.d.ts +2 -1
  437. package/src/lib/services/index.d.ts +1 -0
  438. package/src/lib/services/report/property/property-transaction-report.service.d.ts +4 -7
  439. package/src/lib/validators/index.d.ts +2 -0
  440. package/src/lib/validators/match-sum.validator.d.ts +6 -0
  441. package/src/lib/validators/string/alpha-space.validator.d.ts +5 -0
  442. package/esm2022/src/lib/collections/employee.collection.mjs +0 -11
  443. package/esm2022/src/lib/db/Enums/firm-type.enum.mjs +0 -6
  444. package/esm2022/src/lib/functions/tax-review-filter-predicate.mjs +0 -10
  445. package/esm2022/src/lib/services/http/client/capital-gain/annual-client-details.service.mjs +0 -23
  446. package/esm2022/src/lib/validators/transactions-meta-fields.validator.mjs +0 -33
  447. package/src/lib/collections/employee.collection.d.ts +0 -6
  448. package/src/lib/functions/tax-review-filter-predicate.d.ts +0 -7
  449. package/src/lib/validators/transactions-meta-fields.validator.d.ts +0 -5
  450. /package/src/lib/db/Enums/{firm-type.enum.d.ts → firm/firm-type.enum.d.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * should include alpha+space only, but currently allow all chars except @ for tests
3
+ */
4
+ export function alphaSpaceValidator() {
5
+ return (control) => {
6
+ const valid = !/@/.test(control.value);
7
+ return valid ? null : { 'alphaSpace': true };
8
+ };
9
+ }
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxwaGEtc3BhY2UudmFsaWRhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL3ZhbGlkYXRvcnMvc3RyaW5nL2FscGhhLXNwYWNlLnZhbGlkYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQTs7R0FFRztBQUNILE1BQU0sVUFBVSxtQkFBbUI7SUFDakMsT0FBTyxDQUFDLE9BQXdCLEVBQTJCLEVBQUU7UUFDM0QsTUFBTSxLQUFLLEdBQUcsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUN2QyxPQUFPLEtBQUssQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLFlBQVksRUFBRSxJQUFJLEVBQUUsQ0FBQztJQUMvQyxDQUFDLENBQUM7QUFDSixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQWJzdHJhY3RDb250cm9sLCBWYWxpZGF0aW9uRXJyb3JzLCBWYWxpZGF0b3JGbiB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcblxuLyoqXG4gKiBzaG91bGQgaW5jbHVkZSBhbHBoYStzcGFjZSBvbmx5LCBidXQgY3VycmVudGx5IGFsbG93IGFsbCBjaGFycyBleGNlcHQgQCBmb3IgdGVzdHNcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGFscGhhU3BhY2VWYWxpZGF0b3IoKTogVmFsaWRhdG9yRm4ge1xuICByZXR1cm4gKGNvbnRyb2w6IEFic3RyYWN0Q29udHJvbCk6IFZhbGlkYXRpb25FcnJvcnMgfCBudWxsID0+IHtcbiAgICBjb25zdCB2YWxpZCA9ICEvQC8udGVzdChjb250cm9sLnZhbHVlKTtcbiAgICByZXR1cm4gdmFsaWQgPyBudWxsIDogeyAnYWxwaGFTcGFjZSc6IHRydWUgfTtcbiAgfTtcbn1cbiJdfQ==
@@ -9,11 +9,11 @@ export class UniqueEmailValidator {
9
9
  validate(control) {
10
10
  return this.userService.search(control.value).pipe(map(user => user ? { emailIsUsed: true } : null));
11
11
  }
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UniqueEmailValidator, deps: [{ token: i1.UserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
13
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UniqueEmailValidator, providedIn: 'root' }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, deps: [{ token: i1.UserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
13
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, providedIn: 'root' }); }
14
14
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: UniqueEmailValidator, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UniqueEmailValidator, decorators: [{
16
16
  type: Injectable,
17
17
  args: [{ providedIn: 'root' }]
18
- }], ctorParameters: () => [{ type: i1.UserService }] });
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pcXVlLWVtYWlsLnZhbGlkYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi92YWxpZGF0b3JzL3VuaXF1ZS1lbWFpbC52YWxpZGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0EsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7OztBQUczQyxNQUFNLE9BQU8sb0JBQW9CO0lBQy9CLFlBQW9CLFdBQXdCO1FBQXhCLGdCQUFXLEdBQVgsV0FBVyxDQUFhO0lBQUcsQ0FBQztJQUVoRCxRQUFRLENBQUMsT0FBd0I7UUFDL0IsT0FBTyxJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMsSUFBSSxDQUNoRCxHQUFHLENBQUMsSUFB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VXNlZDogdHJ1ZSB9IDogbnVsbClcbiAgICApO1xuICB9XG59XG4iXX0=
18
+ }], ctorParameters: function () { return [{ type: i1.UserService }]; } });
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pcXVlLWVtYWlsLnZhbGlkYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi92YWxpZGF0b3JzL3VuaXF1ZS1lbWFpbC52YWxpZGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS0EsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7OztBQUczQyxNQUFNLE9BQU8sb0JBQW9CO0lBQy9CLFlBQW9CLFdBQXdCO1FBQXhCLGdCQUFXLEdBQVgsV0FBVyxDQUFhO0lBQUcsQ0FBQztJQUVoRCxRQUFRLENBQUMsT0FBd0I7UUFDL0IsT0FBTyxJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMsSUFBSSxDQUNoRCxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsV0FBVyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FDakQsQ0FBQztJQUNKLENBQUM7K0dBUFUsb0JBQW9CO21IQUFwQixvQkFBb0IsY0FEUCxNQUFNOzs0RkFDbkIsb0JBQW9CO2tCQURoQyxVQUFVO21CQUFDLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIEFic3RyYWN0Q29udHJvbCwgQXN5bmNWYWxpZGF0b3IsXG4gIFZhbGlkYXRpb25FcnJvcnMsXG59IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IE9ic2VydmFibGUgfSBmcm9tICdyeGpzJztcbmltcG9ydCB7IG1hcCB9IGZyb20gJ3J4anMvb3BlcmF0b3JzJztcbmltcG9ydCB7IFVzZXJTZXJ2aWNlIH0gZnJvbSAnLi4vc2VydmljZXMnO1xuaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5ASW5qZWN0YWJsZSh7IHByb3ZpZGVkSW46ICdyb290JyB9KVxuZXhwb3J0IGNsYXNzIFVuaXF1ZUVtYWlsVmFsaWRhdG9yIGltcGxlbWVudHMgQXN5bmNWYWxpZGF0b3Ige1xuICBjb25zdHJ1Y3Rvcihwcml2YXRlIHVzZXJTZXJ2aWNlOiBVc2VyU2VydmljZSkge31cblxuICB2YWxpZGF0ZShjb250cm9sOiBBYnN0cmFjdENvbnRyb2wpOiBPYnNlcnZhYmxlPFZhbGlkYXRpb25FcnJvcnMgfCBudWxsPiB7XG4gICAgcmV0dXJuIHRoaXMudXNlclNlcnZpY2Uuc2VhcmNoKGNvbnRyb2wudmFsdWUpLnBpcGUoXG4gICAgICBtYXAodXNlciA9PiB1c2VyID8geyBlbWFpbElzVXNlZDogdHJ1ZSB9IDogbnVsbClcbiAgICApO1xuICB9XG59XG4iXX0=
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Inject, inject, NgModule } from '@angular/core';
3
- import * as mixpanel from 'mixpanel-browser';
3
+ import mixpanel from 'mixpanel-browser';
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { HttpErrorResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
6
6
  import { map, catchError, filter, take, switchMap, finalize } from 'rxjs/operators';
@@ -40,29 +40,36 @@ class MixpanelService {
40
40
  }
41
41
  mixpanel.track(event, properties);
42
42
  }
43
+ trackLink(id, event) {
44
+ if (!this.environment.enableMixpanel) {
45
+ return;
46
+ }
47
+ mixpanel['track_links'](`#${id}`, event);
48
+ }
43
49
  trackPageView() {
44
50
  if (!this.environment.enableMixpanel) {
45
51
  return;
46
52
  }
47
53
  mixpanel['track_pageview']();
48
54
  }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: MixpanelService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
50
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: MixpanelService, providedIn: 'root' }); }
55
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MixpanelService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
56
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MixpanelService, providedIn: 'root' }); }
51
57
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: MixpanelService, decorators: [{
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MixpanelService, decorators: [{
53
59
  type: Injectable,
54
60
  args: [{
55
61
  providedIn: 'root'
56
62
  }]
57
- }], ctorParameters: () => [{ type: undefined, decorators: [{
63
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
58
64
  type: Inject,
59
65
  args: ['environment']
60
- }] }] });
66
+ }] }]; } });
61
67
 
62
68
  var UserRolesEnum;
63
69
  (function (UserRolesEnum) {
64
70
  UserRolesEnum["FIRM_OWNER"] = "ROLE_FIRM_OWNER";
65
71
  UserRolesEnum["FIRM_MANAGER"] = "ROLE_FIRM_MANAGER";
72
+ UserRolesEnum["FIRM_TOP_MANAGER"] = "ROLE_FIRM_TOP_MANAGER";
66
73
  UserRolesEnum["CLIENT"] = "ROLE_CLIENT";
67
74
  UserRolesEnum["EMPLOYEE"] = "ROLE_EMPLOYEE";
68
75
  UserRolesEnum["ACCOUNTANT"] = "ROLE_ACCOUNTANT";
@@ -112,10 +119,10 @@ class JwtService extends JwtHelperService {
112
119
  isMe(userId) {
113
120
  return this.decode().id === userId;
114
121
  }
115
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: JwtService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
116
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: JwtService, providedIn: 'root' }); }
122
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JwtService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
123
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JwtService, providedIn: 'root' }); }
117
124
  }
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: JwtService, decorators: [{
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JwtService, decorators: [{
119
126
  type: Injectable,
120
127
  args: [{
121
128
  providedIn: 'root'
@@ -158,18 +165,18 @@ class AuthService {
158
165
  localStorage.clear();
159
166
  location.replace(url);
160
167
  }
161
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthService, deps: [{ token: i1.HttpClient }, { token: JwtService }, { token: MixpanelService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
162
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthService, providedIn: 'root' }); }
168
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthService, deps: [{ token: i1.HttpClient }, { token: JwtService }, { token: MixpanelService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
169
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthService, providedIn: 'root' }); }
163
170
  }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: AuthService, decorators: [{
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AuthService, decorators: [{
165
172
  type: Injectable,
166
173
  args: [{
167
174
  providedIn: 'root'
168
175
  }]
169
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: JwtService }, { type: MixpanelService }, { type: undefined, decorators: [{
176
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: JwtService }, { type: MixpanelService }, { type: undefined, decorators: [{
170
177
  type: Inject,
171
178
  args: ['environment']
172
- }] }] });
179
+ }] }]; } });
173
180
 
174
181
  var AuthMessagesEnum;
175
182
  (function (AuthMessagesEnum) {
@@ -298,20 +305,20 @@ class JwtInterceptor {
298
305
  // });
299
306
  });
300
307
  }
301
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: JwtInterceptor, deps: [{ token: JwtService }, { token: AuthService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
302
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: JwtInterceptor }); }
308
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JwtInterceptor, deps: [{ token: JwtService }, { token: AuthService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
309
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JwtInterceptor }); }
303
310
  }
304
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: JwtInterceptor, decorators: [{
311
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JwtInterceptor, decorators: [{
305
312
  type: Injectable
306
- }], ctorParameters: () => [{ type: JwtService }, { type: AuthService }, { type: undefined, decorators: [{
313
+ }], ctorParameters: function () { return [{ type: JwtService }, { type: AuthService }, { type: undefined, decorators: [{
307
314
  type: Inject,
308
315
  args: ['environment']
309
- }] }] });
316
+ }] }]; } });
310
317
 
311
318
  class InterceptorsModule {
312
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: InterceptorsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
313
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: InterceptorsModule }); }
314
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: InterceptorsModule, providers: [
319
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InterceptorsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
320
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: InterceptorsModule }); }
321
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InterceptorsModule, providers: [
315
322
  {
316
323
  provide: HTTP_INTERCEPTORS,
317
324
  useClass: JwtInterceptor,
@@ -319,7 +326,7 @@ class InterceptorsModule {
319
326
  }
320
327
  ] }); }
321
328
  }
322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: InterceptorsModule, decorators: [{
329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InterceptorsModule, decorators: [{
323
330
  type: NgModule,
324
331
  args: [{
325
332
  providers: [
@@ -337,6 +344,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
337
344
  */
338
345
  class CommonModule {
339
346
  static forRoot(environment) {
347
+ // @TODO remove when bank model refactored (the only use case)
348
+ localStorage.setItem('api_uri', environment['api_uri']);
340
349
  return {
341
350
  ngModule: CommonModule,
342
351
  providers: [
@@ -347,13 +356,13 @@ class CommonModule {
347
356
  ]
348
357
  };
349
358
  }
350
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: CommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
351
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.8", ngImport: i0, type: CommonModule, imports: [CommonModule$1,
359
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
360
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: CommonModule, imports: [CommonModule$1,
352
361
  InterceptorsModule] }); }
353
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: CommonModule, imports: [CommonModule$1,
362
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommonModule, imports: [CommonModule$1,
354
363
  InterceptorsModule] }); }
355
364
  }
356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: CommonModule, decorators: [{
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommonModule, decorators: [{
357
366
  type: NgModule,
358
367
  args: [{
359
368
  declarations: [],
@@ -1 +1 @@
1
- {"version":3,"file":"taxtank-core-common.mjs","sources":["../../../projects/tt-core/common/src/services/mixpanel.service.ts","../../../projects/tt-core/common/src/db/enums/user/user-roles.enum.ts","../../../projects/tt-core/common/src/services/auth/jwt.service.ts","../../../projects/tt-core/common/src/services/auth/auth.service.ts","../../../projects/tt-core/common/src/services/auth/auth-messages.enum.ts","../../../projects/tt-core/common/src/interceptors/jwt-interceptor.ts","../../../projects/tt-core/common/src/interceptors/interceptors.module.ts","../../../projects/tt-core/common/src/common.module.ts","../../../projects/tt-core/common/taxtank-core-common.ts"],"sourcesContent":["import { Inject, Injectable } from '@angular/core';\nimport * as mixpanel from 'mixpanel-browser';\n\n/**\n * Service to work with mixpanel https://docs.mixpanel.com/docs/tracking/reference/javascript\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class MixpanelService {\n constructor(@Inject('environment') private environment: any) {}\n\n init(): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.init(this.environment.mixpanelToken);\n }\n\n identify(id: string): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.identify(id);\n mixpanel.people.set({ 'last seen': new Date(Date.now()).toLocaleString() })\n }\n\n reset(): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.reset();\n }\n\n track(event: string, properties: { [key: string]: any } = {}): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.track(event, properties);\n }\n\n trackPageView(): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel['track_pageview']();\n }\n}\n","export enum UserRolesEnum {\n FIRM_OWNER = 'ROLE_FIRM_OWNER',\n FIRM_MANAGER = 'ROLE_FIRM_MANAGER',\n CLIENT = 'ROLE_CLIENT',\n EMPLOYEE = 'ROLE_EMPLOYEE',\n ACCOUNTANT = 'ROLE_ACCOUNTANT',\n ADVISOR = 'ROLE_ADVISOR',\n USER = 'ROLE_USER',\n SUBSCRIPTION = 'ROLE_USER_SUBSCRIPTION',\n WORK_TANK = 'ROLE_USER_WORK',\n PROPERTY_TANK = 'ROLE_USER_PROPERTY',\n SOLE_TANK = 'ROLE_USER_SOLE',\n HOLDING_TANK = 'ROLE_USER_HOLDING',\n SWITCH_USER = 'IS_IMPERSONATOR',\n}\n","import { Injectable, inject } from '@angular/core';\nimport { JwtHelperService } from '@auth0/angular-jwt';\nimport { MixpanelService } from '../mixpanel.service';\nimport { JwtDecodedInterface } from './jwt-decoded.interface';\nimport { BehaviorSubject } from 'rxjs';\nimport { AuthTokenInterface } from './auth-tokens.interface';\nimport { UserRolesEnum } from '../../db';\n\nconst NAME_TOKEN = 'token';\nconst NAME_REFRESH_TOKEN = 'refreshToken';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class JwtService extends JwtHelperService {\n private mpService: MixpanelService = inject(MixpanelService);\n isLoggedInSubject = new BehaviorSubject(!this.isTokenExpired());\n\n getToken(): string {\n return localStorage[NAME_TOKEN];\n }\n\n getRefreshToken(): string {\n return localStorage[NAME_REFRESH_TOKEN];\n }\n\n saveTokens(tokens: AuthTokenInterface): void {\n localStorage[NAME_TOKEN] = tokens.token;\n localStorage[NAME_REFRESH_TOKEN] = tokens.refreshToken;\n\n this.mpService.identify(this.decode(tokens.token).id.toString());\n this.isLoggedInSubject.next(true);\n }\n\n destroyTokens(): void {\n localStorage.removeItem(NAME_TOKEN);\n localStorage.removeItem(NAME_REFRESH_TOKEN);\n\n this.mpService.track('logout');\n this.mpService.reset();\n this.isLoggedInSubject.next(false);\n\n }\n\n decode(token?: string): JwtDecodedInterface {\n return super.decodeToken(token) as JwtDecodedInterface;\n }\n\n isClient(): boolean {\n return this.decode().roles.includes(UserRolesEnum.CLIENT);\n }\n\n isMe(userId: number): boolean {\n return this.decode().id === userId;\n }\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { JwtService } from './jwt.service';\nimport { map } from 'rxjs/operators';\nimport { AuthTokenInterface } from './auth-tokens.interface';\nimport { MixpanelService } from '../mixpanel.service';\nimport { UserRolesEnum } from '../../db';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService {\n constructor(\n private http: HttpClient,\n private jwtService: JwtService,\n private mpService: MixpanelService,\n @Inject('environment') private environment: any\n ) {\n\n }\n\n setAuth(response: AuthTokenInterface) {\n this.jwtService.saveTokens(response);\n }\n\n login(username: string, password: string, role: UserRolesEnum = null) {\n return this.http.post(`${this.environment.apiV2}/login`, { username, password }).pipe(\n map((response: any) => {\n if (!role || this.jwtService.decodeToken(response.token).roles.includes(role)) {\n this.setAuth(response);\n } else {\n throw new HttpErrorResponse({\n error: { code: 401, message: 'Your TaxTank subscription is expired. Please reactivate your account to link the widget.' },\n status: 401,\n statusText: 'Unauthorized',\n })\n }\n\n return response;\n })\n );\n }\n\n refresh(refreshToken: string) {\n return this.http.post(`${this.environment.apiV2}/token/refresh`, { refreshToken }).pipe(\n map((response: any) => {\n this.setAuth(response);\n\n return response;\n })\n );\n }\n\n logoutFront(url = '/login'): void {\n this.jwtService.destroyTokens();\n localStorage.clear();\n location.replace(url);\n }\n}\n","export enum AuthMessagesEnum {\n ERROR_401 = 'Email or password is incorrect'\n}\n","import { BehaviorSubject, Observable, throwError as observableThrowError } from 'rxjs';\nimport { catchError, filter, finalize, switchMap, take } from 'rxjs/operators';\nimport { Inject, Injectable } from '@angular/core';\nimport { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { AuthService, JwtService } from '../services';\n\nconst MESSAGE_DEFAULT_500_ERROR = 'Unexpected error! Please try again later. You can send us via chat your questions.';\n\n/**\n * JWT Interceptor add jwt token to each request related with TaxTank API\n */\n@Injectable()\nexport class JwtInterceptor implements HttpInterceptor {\n isRefreshingToken = false;\n tokenSubject: BehaviorSubject<string> = new BehaviorSubject<string>(null);\n\n constructor(\n public jwtService: JwtService,\n private authService: AuthService,\n @Inject('environment') private environment: any\n ) {}\n\n addToken(req: HttpRequest<any>): HttpRequest<any> {\n return req.clone({\n setHeaders: { Authorization: 'Bearer ' + this.jwtService.getToken() },\n withCredentials: true\n });\n }\n\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n // skip third party requests\n if (!request.url.includes(this.environment.apiV2)) {\n return next.handle(request);\n }\n\n // add token to every api request\n return next.handle(this.addToken(request)).pipe(\n // handle errors\n catchError((err: HttpErrorResponse) => {\n if (err instanceof HttpErrorResponse) {\n switch ((err as HttpErrorResponse).status) {\n // unexpected errors\n case 405:\n case 500:\n this.handle500Error();\n break;\n // expected errors\n case 401:\n return this.handle401Error(request, next, err);\n case 400:\n case 403:\n // @TODO in most cases 404 is not an error, handle in components\n // case 404:\n this.showErrorMessages(err);\n break;\n }\n }\n\n return observableThrowError(err);\n })\n );\n }\n\n /**\n * @TODO log\n * @TODO waiting for backend to handle errors in a better way\n */\n handle400Error(err: HttpErrorResponse): void {\n // this.snackBar.open(err.error['hydra:description'], '', {\n // panelClass: 'error'\n // });\n }\n\n /**\n * @TODO log\n * @TODO waiting for backend to handle errors in a better way\n */\n handle403Error(err: HttpErrorResponse): void {\n // this.snackBar.open(err.error['hydra:description'], '', {\n // panelClass: 'error'\n // });\n }\n\n /**\n * @TODO log\n */\n handle500Error(): void {\n // this.snackBar.open(MESSAGE_DEFAULT_500_ERROR, '', {\n // panelClass: 'error'\n // });\n }\n\n handle401Error(req: HttpRequest<any>, next: HttpHandler, err: HttpErrorResponse) {\n // skip 401 errors not from JWT (basiq login case or other)\n if (!err.error.message?.includes('JWT Token')) {\n return observableThrowError(err);\n }\n\n if (req.url.includes('token/refresh') || req.url.includes('login')) {\n if (req.url.includes('token/refresh')) {\n this.authService.logoutFront();\n }\n\n return observableThrowError(err);\n }\n\n // refreshing token, wait until it's done and retry the request\n if (this.isRefreshingToken) {\n return this.tokenSubject.pipe(\n filter(token => token != null),\n take(1),\n switchMap(token => next.handle(this.addToken(req)))\n );\n // refresh token\n }\n // subsequent requests should wait until refresh token is ready\n this.isRefreshingToken = true;\n this.tokenSubject.next(null);\n\n return this.authService.refresh(this.jwtService.getRefreshToken()).pipe(\n switchMap((tokens: { token: string, refreshToken: string }) => {\n this.tokenSubject.next(tokens.token);\n return next.handle(this.addToken(req));\n }),\n catchError(() => {\n this.authService.logoutFront();\n return observableThrowError(err);\n }),\n finalize(() => {\n this.isRefreshingToken = false;\n })\n );\n\n }\n\n /**\n * Handle error messages\n * @param errorResponse from which messages should be taken\n *\n * @TODO move to separated interceptor\n */\n private showErrorMessages(errorResponse: HttpErrorResponse): void {\n if (!errorResponse.error.violations) {\n // this.snackBar.open('Something went wrong', '', {\n // panelClass: 'error'\n // });\n\n return;\n }\n errorResponse.error.violations.forEach((violation: object): void => {\n // this.snackBar.open(violation['message'], '', {\n // panelClass: 'error'\n // });\n });\n }\n}\n","import { NgModule } from '@angular/core';\r\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\r\nimport { JwtInterceptor } from './jwt-interceptor';\r\n\r\n@NgModule({\r\n providers: [\r\n {\r\n provide: HTTP_INTERCEPTORS,\r\n useClass: JwtInterceptor,\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class InterceptorsModule {\r\n}\r\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule as AngularCommonModule } from '@angular/common';\nimport { InterceptorsModule } from './interceptors/interceptors.module';\n\n/**\n * https://angular.io/guide/creating-libraries\n */\n@NgModule({\n declarations: [],\n imports: [\n AngularCommonModule,\n InterceptorsModule\n ]\n})\nexport class CommonModule {\n public static forRoot(environment: object): ModuleWithProviders<CommonModule> {\n return {\n ngModule: CommonModule,\n providers: [\n {\n provide: 'environment',\n useValue: environment\n }\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"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AAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAJrBA,cAAmB;YACnB,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGT,YAAY,EAAA,UAAA,EAAA,CAAA;kBAPxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACPA,cAAmB;wBACnB,kBAAkB;AACnB,qBAAA;AACF,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"taxtank-core-common.mjs","sources":["../../../projects/tt-core/common/src/services/mixpanel.service.ts","../../../projects/tt-core/common/src/db/enums/user/user-roles.enum.ts","../../../projects/tt-core/common/src/services/auth/jwt.service.ts","../../../projects/tt-core/common/src/services/auth/auth.service.ts","../../../projects/tt-core/common/src/services/auth/auth-messages.enum.ts","../../../projects/tt-core/common/src/interceptors/jwt-interceptor.ts","../../../projects/tt-core/common/src/interceptors/interceptors.module.ts","../../../projects/tt-core/common/src/common.module.ts","../../../projects/tt-core/common/taxtank-core-common.ts"],"sourcesContent":["import { Inject, Injectable } from '@angular/core';\nimport mixpanel from 'mixpanel-browser';\n\n/**\n * Service to work with mixpanel https://docs.mixpanel.com/docs/tracking/reference/javascript\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class MixpanelService {\n constructor(@Inject('environment') private environment: any) {}\n\n init(): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.init(this.environment.mixpanelToken);\n }\n\n identify(id: string): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.identify(id);\n mixpanel.people.set({ 'last seen': new Date(Date.now()).toLocaleString() })\n }\n\n reset(): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.reset();\n }\n\n track(event: string, properties: { [key: string]: any } = {}): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel.track(event, properties);\n }\n\n trackLink(id: string, event: string): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel['track_links'](`#${id}`, event);\n }\n\n trackPageView(): void {\n if (!this.environment.enableMixpanel) {\n return;\n }\n\n mixpanel['track_pageview']();\n }\n}\n","export enum UserRolesEnum {\n FIRM_OWNER = 'ROLE_FIRM_OWNER',\n FIRM_MANAGER = 'ROLE_FIRM_MANAGER',\n FIRM_TOP_MANAGER = 'ROLE_FIRM_TOP_MANAGER',\n CLIENT = 'ROLE_CLIENT',\n EMPLOYEE = 'ROLE_EMPLOYEE',\n ACCOUNTANT = 'ROLE_ACCOUNTANT',\n ADVISOR = 'ROLE_ADVISOR',\n USER = 'ROLE_USER',\n SUBSCRIPTION = 'ROLE_USER_SUBSCRIPTION',\n WORK_TANK = 'ROLE_USER_WORK',\n PROPERTY_TANK = 'ROLE_USER_PROPERTY',\n SOLE_TANK = 'ROLE_USER_SOLE',\n HOLDING_TANK = 'ROLE_USER_HOLDING',\n SWITCH_USER = 'IS_IMPERSONATOR',\n}\n","import { Injectable, inject } from '@angular/core';\nimport { JwtHelperService } from '@auth0/angular-jwt';\nimport { MixpanelService } from '../mixpanel.service';\nimport { JwtDecodedInterface } from './jwt-decoded.interface';\nimport { BehaviorSubject } from 'rxjs';\nimport { AuthTokenInterface } from './auth-tokens.interface';\nimport { UserRolesEnum } from '../../db';\n\nconst NAME_TOKEN = 'token';\nconst NAME_REFRESH_TOKEN = 'refreshToken';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class JwtService extends JwtHelperService {\n private mpService: MixpanelService = inject(MixpanelService);\n isLoggedInSubject = new BehaviorSubject(!this.isTokenExpired());\n\n getToken(): string {\n return localStorage[NAME_TOKEN];\n }\n\n getRefreshToken(): string {\n return localStorage[NAME_REFRESH_TOKEN];\n }\n\n saveTokens(tokens: AuthTokenInterface): void {\n localStorage[NAME_TOKEN] = tokens.token;\n localStorage[NAME_REFRESH_TOKEN] = tokens.refreshToken;\n\n this.mpService.identify(this.decode(tokens.token).id.toString());\n this.isLoggedInSubject.next(true);\n }\n\n destroyTokens(): void {\n localStorage.removeItem(NAME_TOKEN);\n localStorage.removeItem(NAME_REFRESH_TOKEN);\n\n this.mpService.track('logout');\n this.mpService.reset();\n this.isLoggedInSubject.next(false);\n\n }\n\n decode(token?: string): JwtDecodedInterface {\n return super.decodeToken(token) as JwtDecodedInterface;\n }\n\n isClient(): boolean {\n return this.decode().roles.includes(UserRolesEnum.CLIENT);\n }\n\n isMe(userId: number): boolean {\n return this.decode().id === userId;\n }\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { JwtService } from './jwt.service';\nimport { map } from 'rxjs/operators';\nimport { AuthTokenInterface } from './auth-tokens.interface';\nimport { MixpanelService } from '../mixpanel.service';\nimport { UserRolesEnum } from '../../db';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService {\n constructor(\n private http: HttpClient,\n private jwtService: JwtService,\n private mpService: MixpanelService,\n @Inject('environment') private environment: any\n ) {\n\n }\n\n setAuth(response: AuthTokenInterface) {\n this.jwtService.saveTokens(response);\n }\n\n login(username: string, password: string, role: UserRolesEnum = null) {\n return this.http.post(`${this.environment.apiV2}/login`, { username, password }).pipe(\n map((response: any) => {\n if (!role || this.jwtService.decodeToken(response.token).roles.includes(role)) {\n this.setAuth(response);\n } else {\n throw new HttpErrorResponse({\n error: { code: 401, message: 'Your TaxTank subscription is expired. Please reactivate your account to link the widget.' },\n status: 401,\n statusText: 'Unauthorized',\n })\n }\n\n return response;\n })\n );\n }\n\n refresh(refreshToken: string) {\n return this.http.post(`${this.environment.apiV2}/token/refresh`, { refreshToken }).pipe(\n map((response: any) => {\n this.setAuth(response);\n\n return response;\n })\n );\n }\n\n logoutFront(url = '/login'): void {\n this.jwtService.destroyTokens();\n localStorage.clear();\n location.replace(url);\n }\n}\n","export enum AuthMessagesEnum {\n ERROR_401 = 'Email or password is incorrect'\n}\n","import { BehaviorSubject, Observable, throwError as observableThrowError } from 'rxjs';\nimport { catchError, filter, finalize, switchMap, take } from 'rxjs/operators';\nimport { Inject, Injectable } from '@angular/core';\nimport { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { AuthService, JwtService } from '../services';\n\nconst MESSAGE_DEFAULT_500_ERROR = 'Unexpected error! Please try again later. You can send us via chat your questions.';\n\n/**\n * JWT Interceptor add jwt token to each request related with TaxTank API\n */\n@Injectable()\nexport class JwtInterceptor implements HttpInterceptor {\n isRefreshingToken = false;\n tokenSubject: BehaviorSubject<string> = new BehaviorSubject<string>(null);\n\n constructor(\n public jwtService: JwtService,\n private authService: AuthService,\n @Inject('environment') private environment: any\n ) {}\n\n addToken(req: HttpRequest<any>): HttpRequest<any> {\n return req.clone({\n setHeaders: { Authorization: 'Bearer ' + this.jwtService.getToken() },\n withCredentials: true\n });\n }\n\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n // skip third party requests\n if (!request.url.includes(this.environment.apiV2)) {\n return next.handle(request);\n }\n\n // add token to every api request\n return next.handle(this.addToken(request)).pipe(\n // handle errors\n catchError((err: HttpErrorResponse) => {\n if (err instanceof HttpErrorResponse) {\n switch ((err as HttpErrorResponse).status) {\n // unexpected errors\n case 405:\n case 500:\n this.handle500Error();\n break;\n // expected errors\n case 401:\n return this.handle401Error(request, next, err);\n case 400:\n case 403:\n // @TODO in most cases 404 is not an error, handle in components\n // case 404:\n this.showErrorMessages(err);\n break;\n }\n }\n\n return observableThrowError(err);\n })\n );\n }\n\n /**\n * @TODO log\n * @TODO waiting for backend to handle errors in a better way\n */\n handle400Error(err: HttpErrorResponse): void {\n // this.snackBar.open(err.error['hydra:description'], '', {\n // panelClass: 'error'\n // });\n }\n\n /**\n * @TODO log\n * @TODO waiting for backend to handle errors in a better way\n */\n handle403Error(err: HttpErrorResponse): void {\n // this.snackBar.open(err.error['hydra:description'], '', {\n // panelClass: 'error'\n // });\n }\n\n /**\n * @TODO log\n */\n handle500Error(): void {\n // this.snackBar.open(MESSAGE_DEFAULT_500_ERROR, '', {\n // panelClass: 'error'\n // });\n }\n\n handle401Error(req: HttpRequest<any>, next: HttpHandler, err: HttpErrorResponse) {\n // skip 401 errors not from JWT (basiq login case or other)\n if (!err.error.message?.includes('JWT Token')) {\n return observableThrowError(err);\n }\n\n if (req.url.includes('token/refresh') || req.url.includes('login')) {\n if (req.url.includes('token/refresh')) {\n this.authService.logoutFront();\n }\n\n return observableThrowError(err);\n }\n\n // refreshing token, wait until it's done and retry the request\n if (this.isRefreshingToken) {\n return this.tokenSubject.pipe(\n filter(token => token != null),\n take(1),\n switchMap(token => next.handle(this.addToken(req)))\n );\n // refresh token\n }\n // subsequent requests should wait until refresh token is ready\n this.isRefreshingToken = true;\n this.tokenSubject.next(null);\n\n return this.authService.refresh(this.jwtService.getRefreshToken()).pipe(\n switchMap((tokens: { token: string, refreshToken: string }) => {\n this.tokenSubject.next(tokens.token);\n return next.handle(this.addToken(req));\n }),\n catchError(() => {\n this.authService.logoutFront();\n return observableThrowError(err);\n }),\n finalize(() => {\n this.isRefreshingToken = false;\n })\n );\n\n }\n\n /**\n * Handle error messages\n * @param errorResponse from which messages should be taken\n *\n * @TODO move to separated interceptor\n */\n private showErrorMessages(errorResponse: HttpErrorResponse): void {\n if (!errorResponse.error.violations) {\n // this.snackBar.open('Something went wrong', '', {\n // panelClass: 'error'\n // });\n\n return;\n }\n errorResponse.error.violations.forEach((violation: object): void => {\n // this.snackBar.open(violation['message'], '', {\n // panelClass: 'error'\n // });\n });\n }\n}\n","import { NgModule } from '@angular/core';\r\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\r\nimport { JwtInterceptor } from './jwt-interceptor';\r\n\r\n@NgModule({\r\n providers: [\r\n {\r\n provide: HTTP_INTERCEPTORS,\r\n useClass: JwtInterceptor,\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class InterceptorsModule {\r\n}\r\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule as AngularCommonModule } from '@angular/common';\nimport { InterceptorsModule } from './interceptors/interceptors.module';\n\n/**\n * https://angular.io/guide/creating-libraries\n */\n@NgModule({\n declarations: [],\n imports: [\n AngularCommonModule,\n InterceptorsModule\n ]\n})\nexport class CommonModule {\n public static forRoot(environment: object): ModuleWithProviders<CommonModule> {\n // @TODO remove when bank model refactored (the only use case)\n localStorage.setItem('api_uri', environment['api_uri']);\n\n return {\n ngModule: CommonModule,\n providers: [\n {\n provide: 'environment',\n useValue: environment\n }\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableThrowError","AngularCommonModule"],"mappings":";;;;;;;;;;AAGA;;AAEG;MAIU,eAAe,CAAA;AAC1B,IAAA,WAAA,CAA2C,WAAgB,EAAA;QAAhB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAK;KAAI;IAE/D,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE;YACpC,OAAO;AACR,SAAA;QAED,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;KAC/C;AAED,IAAA,QAAQ,CAAC,EAAU,EAAA;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE;YACpC,OAAO;AACR,SAAA;AAED,QAAA,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;KAC5E;IAED,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE;YACpC,OAAO;AACR,SAAA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