@justifi/webcomponents 4.10.0 → 4.11.0

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 (299) hide show
  1. package/dist/cjs/{Business-663db337.js → Business-7ae04d4f.js} +46 -1
  2. package/dist/cjs/business-additional-questions-schema-18a82d19.js +47 -0
  3. package/dist/cjs/business-details-core.cjs.entry.js +7 -2
  4. package/dist/cjs/{business-form-types-3cdd5447.js → business-form-types-29b2bad9.js} +7 -0
  5. package/dist/cjs/{form-control-datepart_3.cjs.entry.js → form-control-datepart_4.cjs.entry.js} +59 -12
  6. package/dist/cjs/{form-control-number_3.cjs.entry.js → form-control-select_2.cjs.entry.js} +3 -45
  7. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +7 -1
  8. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +24 -20
  9. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +6 -8
  10. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +1 -1
  11. package/dist/cjs/justifi-business-details.cjs.entry.js +21 -4
  12. package/dist/cjs/justifi-business-form.cjs.entry.js +60 -51
  13. package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
  14. package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
  15. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +29 -5
  16. package/dist/cjs/justifi-owner-form.cjs.entry.js +20 -12
  17. package/dist/cjs/justifi-payment-details.cjs.entry.js +25 -4
  18. package/dist/cjs/justifi-payment-form.cjs.entry.js +16 -3
  19. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +16 -16
  20. package/dist/cjs/justifi-payments-list.cjs.entry.js +25 -5
  21. package/dist/cjs/justifi-payout-details.cjs.entry.js +27 -7
  22. package/dist/cjs/justifi-payouts-list.cjs.entry.js +26 -6
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/cjs/payload-parsers-f437272e.js +132 -0
  25. package/dist/cjs/payment-details-core.cjs.entry.js +7 -1
  26. package/dist/cjs/payments-list-core.cjs.entry.js +8 -2
  27. package/dist/cjs/payout-details-core.cjs.entry.js +8 -3
  28. package/dist/cjs/payouts-list-core.cjs.entry.js +8 -2
  29. package/dist/cjs/{utils-df5167a8.js → utils-87435719.js} +7 -0
  30. package/dist/cjs/utils-f8079741.js +41 -0
  31. package/dist/cjs/webcomponents.cjs.js +1 -1
  32. package/dist/collection/api/Business.js +2 -1
  33. package/dist/collection/api/ComponentError.js +14 -0
  34. package/dist/collection/api/services/utils.js +11 -0
  35. package/dist/collection/api/shared.js +11 -1
  36. package/dist/collection/collection-manifest.json +1 -2
  37. package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +1 -1
  38. package/dist/collection/components/business-details/business-details-core.js +30 -2
  39. package/dist/collection/components/business-details/business-details.js +30 -0
  40. package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +1 -1
  41. package/dist/collection/components/business-details/get-business.js +15 -3
  42. package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +1 -1
  43. package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +1 -1
  44. package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +1 -1
  45. package/dist/collection/components/business-details/test/busines-details-core.spec.js +56 -16
  46. package/dist/collection/components/business-details/test/business-details.spec.js +20 -4
  47. package/dist/collection/components/business-details/test/get-business.spec.js +13 -6
  48. package/dist/collection/components/business-forms/business-form/business-form.js +79 -50
  49. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -4
  50. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -2
  51. package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.js → owner-form/identity-address/identity-address-form.js} +13 -10
  52. package/dist/collection/components/business-forms/owner-form/identity-address/test/identity-address.e2e.js +9 -0
  53. package/dist/collection/components/business-forms/{business-form/business-address/test/business-address.spec.js → owner-form/identity-address/test/identity-address.spec.js} +21 -14
  54. package/dist/collection/components/business-forms/owner-form/owner-form.js +54 -8
  55. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +20 -2
  56. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +19 -1
  57. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +44 -4
  58. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +21 -6
  59. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +23 -4
  60. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +32 -14
  61. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +15 -6
  62. package/dist/collection/components/business-forms/schemas/business-address-schema.js +47 -12
  63. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +24 -12
  64. package/dist/collection/components/business-forms/schemas/business-form-schema.js +4 -4
  65. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +29 -34
  66. package/dist/collection/components/business-forms/utils/business-form-types.js +7 -0
  67. package/dist/collection/components/business-forms/utils/helpers.js +2 -0
  68. package/dist/collection/components/form/form-control-text.js +35 -1
  69. package/dist/collection/components/form/utils.js +6 -0
  70. package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +17 -2
  71. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +30 -1
  72. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +35 -1
  73. package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +26 -8
  74. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +51 -11
  75. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +55 -3
  76. package/dist/collection/components/payment-details/get-payment-details.js +15 -3
  77. package/dist/collection/components/payment-details/payment-details-core.js +30 -1
  78. package/dist/collection/components/payment-details/payment-details.js +35 -1
  79. package/dist/collection/components/payment-details/test/get-payment-details.spec.js +11 -3
  80. package/dist/collection/components/payment-details/test/payment-details-core.spec.js +55 -12
  81. package/dist/collection/components/payment-details/test/payment-details.spec.js +69 -3
  82. package/dist/collection/components/payment-form/payment-form.js +54 -3
  83. package/dist/collection/components/payment-form/test/payment-form.spec.js +60 -1
  84. package/dist/collection/components/payments-list/get-payments.js +15 -4
  85. package/dist/collection/components/payments-list/payments-list-core.js +28 -2
  86. package/dist/collection/components/payments-list/payments-list.js +35 -1
  87. package/dist/collection/components/payments-list/test/get-payments.spec.js +11 -3
  88. package/dist/collection/components/payments-list/test/payments-list-core.spec.js +43 -28
  89. package/dist/collection/components/payments-list/test/payments-list.spec.js +31 -3
  90. package/dist/collection/components/payout-details/get-payout-details.js +17 -6
  91. package/dist/collection/components/payout-details/payout-details-core.js +31 -3
  92. package/dist/collection/components/payout-details/payout-details.js +35 -1
  93. package/dist/collection/components/payout-details/test/get-payout-details.spec.js +15 -5
  94. package/dist/collection/components/payout-details/test/payout-details-core.spec.js +54 -16
  95. package/dist/collection/components/payout-details/test/payout-details.spec.js +50 -1
  96. package/dist/collection/components/payouts-list/get-payouts.js +17 -5
  97. package/dist/collection/components/payouts-list/payouts-list-core.js +28 -2
  98. package/dist/collection/components/payouts-list/payouts-list.js +34 -1
  99. package/dist/collection/components/payouts-list/test/get-payouts.spec.js +11 -3
  100. package/dist/collection/components/payouts-list/test/payouts-list-core.spec.js +42 -29
  101. package/dist/collection/components/payouts-list/test/payouts-list.spec.js +33 -0
  102. package/dist/docs.json +753 -354
  103. package/dist/esm/{Business-6cc4e473.js → Business-91caaccb.js} +45 -2
  104. package/dist/esm/business-additional-questions-schema-b642a2b7.js +44 -0
  105. package/dist/esm/business-details-core.entry.js +8 -3
  106. package/dist/esm/{business-form-types-de9f38cd.js → business-form-types-0d76133c.js} +8 -1
  107. package/dist/esm/{form-control-datepart_3.entry.js → form-control-datepart_4.entry.js} +59 -13
  108. package/dist/esm/{form-control-number_3.entry.js → form-control-select_2.entry.js} +4 -45
  109. package/dist/esm/gross-payment-chart-core.entry.js +8 -2
  110. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +22 -18
  111. package/dist/esm/justifi-additional-questions_4.entry.js +6 -8
  112. package/dist/esm/justifi-billing-form_4.entry.js +1 -1
  113. package/dist/esm/justifi-business-details.entry.js +22 -5
  114. package/dist/esm/justifi-business-form.entry.js +60 -51
  115. package/dist/esm/justifi-business-list.entry.js +1 -1
  116. package/dist/esm/justifi-checkout.entry.js +1 -1
  117. package/dist/esm/justifi-gross-payment-chart.entry.js +28 -4
  118. package/dist/esm/justifi-owner-form.entry.js +19 -11
  119. package/dist/esm/justifi-payment-details.entry.js +26 -5
  120. package/dist/esm/justifi-payment-form.entry.js +16 -3
  121. package/dist/esm/justifi-payment-provisioning.entry.js +16 -16
  122. package/dist/esm/justifi-payments-list.entry.js +26 -6
  123. package/dist/esm/justifi-payout-details.entry.js +28 -8
  124. package/dist/esm/justifi-payouts-list.entry.js +27 -7
  125. package/dist/esm/loader.js +1 -1
  126. package/dist/esm/payload-parsers-920f49dd.js +123 -0
  127. package/dist/esm/payment-details-core.entry.js +8 -2
  128. package/dist/esm/payments-list-core.entry.js +8 -2
  129. package/dist/esm/payout-details-core.entry.js +9 -4
  130. package/dist/esm/payouts-list-core.entry.js +8 -2
  131. package/dist/esm/utils-4609f32c.js +38 -0
  132. package/dist/esm/{utils-2828201a.js → utils-684d2e47.js} +7 -1
  133. package/dist/esm/webcomponents.js +1 -1
  134. package/dist/module/Business.js +45 -2
  135. package/dist/module/business-additional-questions-form-step.js +4 -2
  136. package/dist/module/business-additional-questions-schema.js +16 -7
  137. package/dist/module/business-address-schema.js +49 -14
  138. package/dist/module/business-core-info-form-step.js +3 -1
  139. package/dist/module/business-core-info-schema.js +24 -12
  140. package/dist/module/business-details-core2.js +8 -3
  141. package/dist/module/business-form-types.js +8 -1
  142. package/dist/module/business-identity-schema.js +30 -35
  143. package/dist/module/business-owners-form-step.js +12 -8
  144. package/dist/module/business-representative-form-step.js +9 -10
  145. package/dist/module/business-representative.js +4 -7
  146. package/dist/module/form-control-text2.js +5 -1
  147. package/dist/module/gross-payment-chart-core2.js +8 -2
  148. package/dist/module/helpers.js +4 -0
  149. package/dist/module/{business-address-form.js → identity-address-form.js} +17 -20
  150. package/dist/module/justifi-business-details.js +21 -4
  151. package/dist/module/justifi-business-form.js +65 -56
  152. package/dist/module/justifi-gross-payment-chart.js +28 -4
  153. package/dist/module/justifi-identity-address-form.d.ts +11 -0
  154. package/dist/module/justifi-identity-address-form.js +6 -0
  155. package/dist/module/justifi-payment-details.js +26 -5
  156. package/dist/module/justifi-payment-form.js +18 -4
  157. package/dist/module/justifi-payment-provisioning.js +24 -23
  158. package/dist/module/justifi-payments-list.js +26 -6
  159. package/dist/module/justifi-payout-details.js +28 -8
  160. package/dist/module/justifi-payouts-list.js +27 -7
  161. package/dist/module/legal-address-form-step.js +8 -11
  162. package/dist/module/legal-address-form.js +5 -9
  163. package/dist/module/owner-form.js +22 -12
  164. package/dist/module/payment-details-core2.js +8 -2
  165. package/dist/module/payment-method-form.js +1 -1
  166. package/dist/module/payments-list-core2.js +8 -2
  167. package/dist/module/payout-details-core2.js +9 -4
  168. package/dist/module/payouts-list-core2.js +8 -2
  169. package/dist/module/utils3.js +31 -1
  170. package/dist/module/utils4.js +7 -1
  171. package/dist/types/api/ComponentError.d.ts +18 -0
  172. package/dist/types/api/services/utils.d.ts +2 -0
  173. package/dist/types/api/shared.d.ts +9 -0
  174. package/dist/types/components/business-details/business-details-core.d.ts +3 -0
  175. package/dist/types/components/business-details/business-details.d.ts +3 -0
  176. package/dist/types/components/business-forms/business-form/business-form.d.ts +4 -2
  177. package/dist/types/components/business-forms/owner-form/identity-address/identity-address-form.d.ts +10 -0
  178. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +5 -1
  179. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +1 -0
  180. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +1 -0
  181. package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +3 -1
  182. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +1 -0
  183. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +1 -0
  184. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning.d.ts +3 -2
  185. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +1 -1
  186. package/dist/types/components/business-forms/schemas/business-address-schema.d.ts +1 -12
  187. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +1 -1
  188. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +7 -3
  189. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +5 -31
  190. package/dist/types/components/business-forms/utils/business-form-types.d.ts +10 -0
  191. package/dist/types/components/business-forms/utils/helpers.d.ts +2 -0
  192. package/dist/types/components/form/form-control-text.d.ts +2 -0
  193. package/dist/types/components/form/utils.d.ts +1 -0
  194. package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +5 -8
  195. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +3 -0
  196. package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -0
  197. package/dist/types/components/payment-details/payment-details-core.d.ts +3 -0
  198. package/dist/types/components/payment-details/payment-details.d.ts +4 -0
  199. package/dist/types/components/payment-form/payment-form.d.ts +4 -1
  200. package/dist/types/components/payments-list/payments-list-core.d.ts +2 -0
  201. package/dist/types/components/payments-list/payments-list.d.ts +4 -0
  202. package/dist/types/components/payout-details/payout-details-core.d.ts +3 -0
  203. package/dist/types/components/payout-details/payout-details.d.ts +4 -0
  204. package/dist/types/components/payouts-list/payouts-list-core.d.ts +2 -0
  205. package/dist/types/components/payouts-list/payouts-list.d.ts +4 -0
  206. package/dist/types/components.d.ts +217 -43
  207. package/dist/webcomponents/p-091f9732.entry.js +1 -0
  208. package/dist/webcomponents/p-0b76c770.entry.js +1 -0
  209. package/dist/webcomponents/p-0d81883d.entry.js +1 -0
  210. package/dist/webcomponents/{p-cb8f9cb8.entry.js → p-102b593a.entry.js} +1 -1
  211. package/dist/webcomponents/p-28cd23c8.entry.js +1 -0
  212. package/dist/webcomponents/p-2b8368d2.js +1 -0
  213. package/dist/webcomponents/p-436d27b9.entry.js +1 -0
  214. package/dist/webcomponents/p-448063ba.entry.js +1 -0
  215. package/dist/webcomponents/p-5341321d.entry.js +1 -0
  216. package/dist/webcomponents/p-5b262705.entry.js +1 -0
  217. package/dist/webcomponents/p-5e503d7d.entry.js +1 -0
  218. package/dist/webcomponents/p-6047b960.entry.js +1 -0
  219. package/dist/webcomponents/p-6f294d5d.js +1 -0
  220. package/dist/webcomponents/p-7294eb89.entry.js +1 -0
  221. package/dist/webcomponents/p-746bfba6.entry.js +1 -0
  222. package/dist/webcomponents/p-7c6a355f.entry.js +1 -0
  223. package/dist/webcomponents/p-935d6f55.js +1 -0
  224. package/dist/webcomponents/{p-e924f2e1.entry.js → p-959250e3.entry.js} +1 -1
  225. package/dist/webcomponents/{p-b37d6888.entry.js → p-a130a884.entry.js} +1 -1
  226. package/dist/webcomponents/p-ac670a3e.js +1 -0
  227. package/dist/webcomponents/p-ae21ed6f.entry.js +19 -0
  228. package/dist/webcomponents/p-c071d8c1.entry.js +1 -0
  229. package/dist/webcomponents/p-c340b60f.js +1 -0
  230. package/dist/webcomponents/p-d5aab6b5.entry.js +1 -0
  231. package/dist/webcomponents/p-d5c80489.entry.js +1 -0
  232. package/dist/webcomponents/p-d776fe10.entry.js +1 -0
  233. package/dist/webcomponents/p-d8679fad.entry.js +1 -0
  234. package/dist/webcomponents/p-e84b3616.entry.js +1 -0
  235. package/dist/webcomponents/p-ea2cca2a.js +1 -0
  236. package/dist/webcomponents/webcomponents.esm.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/cjs/Identity-1c4528b8.js +0 -49
  239. package/dist/cjs/business-additional-questions-schema-cbac27f2.js +0 -26
  240. package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +0 -35
  241. package/dist/cjs/payload-parsers-9e72e80f.js +0 -99
  242. package/dist/cjs/utils-f5d82f21.js +0 -10
  243. package/dist/collection/api/mockData/MockOnboardingData.js +0 -117
  244. package/dist/collection/api/mockData/MockPayments.js +0 -243
  245. package/dist/collection/api/mockData/MockSubAccount.js +0 -102
  246. package/dist/collection/api/mockData/mockGrossVolumeReport.js +0 -125
  247. package/dist/collection/components/business-forms/business-form/business-address/test/business-address.e2e.js +0 -9
  248. package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.css +0 -2536
  249. package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.js +0 -97
  250. package/dist/collection/components/business-forms/payment-provisioning/business-address/test/business-address-form-step.spec.js +0 -97
  251. package/dist/collection/components/business-forms/schemas/business-owners-schema.js +0 -16
  252. package/dist/collection/components/card-form/test/card-form.e2e.js +0 -13
  253. package/dist/esm/Identity-5f8f916f.js +0 -46
  254. package/dist/esm/business-additional-questions-schema-2cb80f70.js +0 -23
  255. package/dist/esm/justifi-business-address-form-step.entry.js +0 -31
  256. package/dist/esm/payload-parsers-caea809d.js +0 -91
  257. package/dist/esm/utils-546ca6aa.js +0 -8
  258. package/dist/module/Identity.js +0 -46
  259. package/dist/module/justifi-business-address-form-step.d.ts +0 -11
  260. package/dist/module/justifi-business-address-form-step.js +0 -75
  261. package/dist/module/justifi-business-address-form.d.ts +0 -11
  262. package/dist/module/justifi-business-address-form.js +0 -6
  263. package/dist/types/api/mockData/MockOnboardingData.d.ts +0 -8
  264. package/dist/types/api/mockData/MockPayments.d.ts +0 -3
  265. package/dist/types/api/mockData/MockSubAccount.d.ts +0 -3
  266. package/dist/types/components/business-forms/business-form/business-address/business-address-form.d.ts +0 -9
  267. package/dist/types/components/business-forms/payment-provisioning/business-address/business-address-form-step.d.ts +0 -9
  268. package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +0 -33
  269. package/dist/webcomponents/p-03b1d0d5.entry.js +0 -1
  270. package/dist/webcomponents/p-0e189d6a.entry.js +0 -1
  271. package/dist/webcomponents/p-16dcf053.entry.js +0 -1
  272. package/dist/webcomponents/p-17d72f4a.js +0 -1
  273. package/dist/webcomponents/p-38ba2848.entry.js +0 -1
  274. package/dist/webcomponents/p-41870765.entry.js +0 -1
  275. package/dist/webcomponents/p-461f42b8.entry.js +0 -1
  276. package/dist/webcomponents/p-48c2400e.js +0 -1
  277. package/dist/webcomponents/p-491ca87f.js +0 -1
  278. package/dist/webcomponents/p-5be4e217.entry.js +0 -1
  279. package/dist/webcomponents/p-60714f2a.entry.js +0 -1
  280. package/dist/webcomponents/p-65500b31.entry.js +0 -19
  281. package/dist/webcomponents/p-6ed680e9.js +0 -1
  282. package/dist/webcomponents/p-7ec301b5.entry.js +0 -1
  283. package/dist/webcomponents/p-9207ccb2.entry.js +0 -1
  284. package/dist/webcomponents/p-9e4b81ad.entry.js +0 -1
  285. package/dist/webcomponents/p-a141c531.js +0 -1
  286. package/dist/webcomponents/p-a2dbe90f.entry.js +0 -1
  287. package/dist/webcomponents/p-a68519e5.entry.js +0 -1
  288. package/dist/webcomponents/p-af8363a1.entry.js +0 -1
  289. package/dist/webcomponents/p-b1bc23af.entry.js +0 -1
  290. package/dist/webcomponents/p-b5a3bf86.entry.js +0 -1
  291. package/dist/webcomponents/p-b8f22856.js +0 -1
  292. package/dist/webcomponents/p-d0761829.entry.js +0 -1
  293. package/dist/webcomponents/p-dbe32e75.entry.js +0 -1
  294. package/dist/webcomponents/p-e0c1cba8.js +0 -1
  295. package/dist/webcomponents/p-eed5f4ad.entry.js +0 -1
  296. package/dist/webcomponents/p-fe8a94c1.entry.js +0 -1
  297. /package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.css → owner-form/identity-address/identity-address-form.css} +0 -0
  298. /package/dist/types/{api → home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil}/mockData/mockGrossVolumeReport.d.ts +0 -0
  299. /package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/{config.d.ts → packages/webcomponents/config.d.ts} +0 -0
@@ -1,7 +1,9 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { PayoutDetailsCore } from "../payout-details-core";
3
- import mockPayoutDetailSuccess from "../../../api/mockData/mockPayoutDetailsSuccess.json";
4
+ import mockPayoutDetailSuccess from "../../../../../../mockData/mockPayoutDetailsSuccess.json";
4
5
  import { makeGetPayoutDetails } from "../get-payout-details";
6
+ import { API_NOT_AUTHENTICATED_ERROR } from "../../../api/shared";
5
7
  describe('payout-details-core', () => {
6
8
  it('renders loading state initially', async () => {
7
9
  // Define a mock getPayout function as part of the component initialization
@@ -12,10 +14,8 @@ describe('payout-details-core', () => {
12
14
  // Initialize the page with the mock getPayout function included in the component tag
13
15
  const page = await newSpecPage({
14
16
  components: [PayoutDetailsCore],
15
- html: `<payout-details-core></payout-details-core>`,
17
+ template: () => h("payout-details-core", { getPayout: mockGetPayout })
16
18
  });
17
- page.rootInstance.componentWillLoad = () => { };
18
- page.rootInstance.getPayout = mockGetPayout;
19
19
  // Wait for any state changes to complete
20
20
  await page.waitForChanges();
21
21
  // Assert the loading state is visible in the snapshot
@@ -32,11 +32,8 @@ describe('payout-details-core', () => {
32
32
  });
33
33
  const page = await newSpecPage({
34
34
  components: [PayoutDetailsCore],
35
- html: '<payout-details-core></payout-details-core>',
35
+ template: () => h("payout-details-core", { getPayout: getPayout })
36
36
  });
37
- page.rootInstance.componentWillLoad = () => { };
38
- page.rootInstance.getPayout = getPayout;
39
- page.rootInstance.fetchData();
40
37
  await page.waitForChanges();
41
38
  expect(mockService.fetchPayout).toHaveBeenCalled(); // Verify the mock service method was called
42
39
  expect(page.rootInstance.payout).toEqual(expect.objectContaining({
@@ -50,23 +47,64 @@ describe('payout-details-core', () => {
50
47
  fetchPayout: jest.fn().mockRejectedValue(new Error('Fetch error'))
51
48
  };
52
49
  // Real getPayout function but with mocked service
53
- const realGetPayoutWithMockedService = makeGetPayoutDetails({
50
+ const getPayout = makeGetPayoutDetails({
54
51
  id: 'some-id', // Use appropriate id
55
52
  authToken: 'some-auth-token', // Use appropriate auth token
56
53
  service: mockService // Injecting the mocked service
57
54
  });
58
55
  const page = await newSpecPage({
59
56
  components: [PayoutDetailsCore],
60
- html: '<payout-details-core></payout-details-core>',
57
+ template: () => h("payout-details-core", { getPayout: getPayout })
61
58
  });
62
- page.rootInstance.componentWillLoad = () => { };
63
- // Inject the getPayout function with mocked service into the component
64
- page.rootInstance.getPayout = realGetPayoutWithMockedService;
65
- // Manually call fetchData if necessary, depending on how your component is set up
66
- await page.rootInstance.fetchData();
67
59
  await page.waitForChanges();
68
60
  // Assertions to verify the error handling
69
- expect(page.rootInstance.errorMessage).toBe('Error fetching payout details: Error: Fetch error');
61
+ expect(page.rootInstance.errorMessage).toBe('Fetch error');
70
62
  expect(page.root).toMatchSnapshot();
71
63
  });
64
+ it('emits error event on fetch error', async () => {
65
+ const mockService = {
66
+ fetchPayout: jest.fn().mockRejectedValue(new Error('Fetch error'))
67
+ };
68
+ const getPayout = makeGetPayoutDetails({
69
+ id: 'some-id',
70
+ authToken: 'some-auth',
71
+ service: mockService
72
+ });
73
+ const onErrorEvent = jest.fn();
74
+ const page = await newSpecPage({
75
+ components: [PayoutDetailsCore],
76
+ template: () => h("payout-details-core", { getPayout: getPayout, "onError-event": onErrorEvent })
77
+ });
78
+ await page.waitForChanges();
79
+ expect(onErrorEvent).toHaveBeenCalledWith(expect.objectContaining({
80
+ detail: {
81
+ message: 'Fetch error',
82
+ errorCode: 'fetch-error',
83
+ severity: 'error'
84
+ }
85
+ }));
86
+ });
87
+ it('emits error event when API returns error', async () => {
88
+ const mockService = {
89
+ fetchPayout: jest.fn().mockResolvedValue(API_NOT_AUTHENTICATED_ERROR)
90
+ };
91
+ const getPayout = makeGetPayoutDetails({
92
+ id: 'some-id',
93
+ authToken: 'some-auth',
94
+ service: mockService
95
+ });
96
+ const onErrorEvent = jest.fn();
97
+ const page = await newSpecPage({
98
+ components: [PayoutDetailsCore],
99
+ template: () => h("payout-details-core", { getPayout: getPayout, "onError-event": onErrorEvent })
100
+ });
101
+ await page.waitForChanges();
102
+ expect(onErrorEvent).toHaveBeenCalledWith(expect.objectContaining({
103
+ detail: {
104
+ message: 'Not Authenticated',
105
+ errorCode: 'not-authenticated',
106
+ severity: 'error'
107
+ }
108
+ }));
109
+ });
72
110
  });
@@ -1,13 +1,62 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { PayoutDetails } from "../payout-details";
3
4
  import { PayoutDetailsCore } from "../payout-details-core";
5
+ import { PayoutService } from "../../../api/services/payout.service";
6
+ jest.mock("../../../api/services/payout.service");
4
7
  describe('payout-details', () => {
5
8
  it('renders error state when no payoutId or authToken', async () => {
6
9
  const page = await newSpecPage({
7
10
  components: [PayoutDetails, PayoutDetailsCore],
8
- html: '<justifi-payout-details></justifi-payout-details>',
11
+ template: () => h("justifi-payout-details", null),
9
12
  });
10
13
  await page.waitForChanges();
11
14
  expect(page.root).toMatchSnapshot();
12
15
  });
16
+ it('emits error event when no payoutId', async () => {
17
+ const eventSpy = jest.fn();
18
+ const page = await newSpecPage({
19
+ components: [PayoutDetails, PayoutDetailsCore],
20
+ template: () => h("justifi-payout-details", { authToken: "token", "onError-event": eventSpy }),
21
+ });
22
+ await page.waitForChanges();
23
+ expect(eventSpy).toHaveBeenCalledWith(expect.objectContaining({
24
+ detail: {
25
+ message: 'Failed to load payout details. payoutId or authToken is not provided.',
26
+ errorCode: 'missing-props',
27
+ severity: 'error'
28
+ }
29
+ }));
30
+ });
31
+ it('emits error event when no authToken', async () => {
32
+ const eventSpy = jest.fn();
33
+ const page = await newSpecPage({
34
+ components: [PayoutDetails, PayoutDetailsCore],
35
+ template: () => h("justifi-payout-details", { payoutId: "payoutId", "onError-event": eventSpy }),
36
+ });
37
+ await page.waitForChanges();
38
+ expect(eventSpy).toHaveBeenCalledWith(expect.objectContaining({
39
+ detail: {
40
+ message: 'Failed to load payout details. payoutId or authToken is not provided.',
41
+ errorCode: 'missing-props',
42
+ severity: 'error'
43
+ }
44
+ }));
45
+ });
46
+ it('emits an error event when fetch fails', async () => {
47
+ PayoutService.prototype.fetchPayout = jest.fn().mockRejectedValueOnce(new Error('Failed to fetch'));
48
+ const onErrorSpy = jest.fn();
49
+ const page = await newSpecPage({
50
+ components: [PayoutDetails, PayoutDetailsCore],
51
+ template: () => h("justifi-payout-details", { payoutId: "payoutId", authToken: "authToken", "onError-event": onErrorSpy }),
52
+ });
53
+ await page.waitForChanges();
54
+ expect(onErrorSpy).toHaveBeenCalledWith(expect.objectContaining({
55
+ detail: {
56
+ message: 'Failed to fetch',
57
+ errorCode: 'fetch-error',
58
+ severity: 'error'
59
+ }
60
+ }));
61
+ });
13
62
  });
@@ -1,7 +1,8 @@
1
1
  import { Payout } from "../../api";
2
- import { getErrorMessage } from "../../api/services/utils";
2
+ import { ComponentErrorSeverity } from "../../api/ComponentError";
3
+ import { getErrorCode, getErrorMessage } from "../../api/services/utils";
3
4
  export const makeGetPayouts = ({ id, authToken, service }) => async ({ params, onSuccess, onError }) => {
4
- var _a;
5
+ var _a, _b;
5
6
  try {
6
7
  const response = await service.fetchPayouts(id, authToken, params);
7
8
  if (!response.error) {
@@ -10,11 +11,22 @@ export const makeGetPayouts = ({ id, authToken, service }) => async ({ params, o
10
11
  onSuccess({ payouts, pagingInfo });
11
12
  }
12
13
  else {
13
- const responseError = getErrorMessage(response.error);
14
- return onError(responseError);
14
+ const error = getErrorMessage(response.error);
15
+ const code = getErrorCode((_b = response.error) === null || _b === void 0 ? void 0 : _b.code);
16
+ return onError({
17
+ error,
18
+ code,
19
+ severity: ComponentErrorSeverity.ERROR,
20
+ });
15
21
  }
16
22
  }
17
23
  catch (error) {
18
- return onError(error.message || error);
24
+ const message = getErrorMessage(error);
25
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
26
+ return onError({
27
+ error: message,
28
+ code,
29
+ severity: ComponentErrorSeverity.ERROR,
30
+ });
19
31
  }
20
32
  };
@@ -54,8 +54,13 @@ export class PayoutsListCore {
54
54
  this.paging = pagingInfo;
55
55
  this.loading = false;
56
56
  },
57
- onError: (errorMessage) => {
58
- this.errorMessage = errorMessage;
57
+ onError: ({ error, code, severity }) => {
58
+ this.errorMessage = error;
59
+ this.errorEvent.emit({
60
+ errorCode: code,
61
+ message: error,
62
+ severity
63
+ });
59
64
  this.loading = false;
60
65
  },
61
66
  });
@@ -167,6 +172,27 @@ export class PayoutsListCore {
167
172
  }
168
173
  }
169
174
  }
175
+ }, {
176
+ "method": "errorEvent",
177
+ "name": "error-event",
178
+ "bubbles": true,
179
+ "cancelable": true,
180
+ "composed": true,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": ""
184
+ },
185
+ "complexType": {
186
+ "original": "ComponentError",
187
+ "resolved": "ComponentError",
188
+ "references": {
189
+ "ComponentError": {
190
+ "location": "import",
191
+ "path": "../../api/ComponentError",
192
+ "id": "src/api/ComponentError.ts::ComponentError"
193
+ }
194
+ }
195
+ }
170
196
  }];
171
197
  }
172
198
  static get watchers() {
@@ -3,6 +3,7 @@ import { tableExportedParts } from "../table/exported-parts";
3
3
  import { PayoutService } from "../../api/services/payout.service";
4
4
  import { makeGetPayouts } from "./get-payouts";
5
5
  import { ErrorState } from "../details/utils";
6
+ import { ComponentErrorCodes } from "../../api/ComponentError";
6
7
  /**
7
8
  * @exportedPart table-head: Table head
8
9
  * @exportedPart table-head-row: Head row
@@ -24,6 +25,10 @@ import { ErrorState } from "../details/utils";
24
25
  */
25
26
  export class PayoutsList {
26
27
  constructor() {
28
+ this.handleOnError = (event) => {
29
+ this.errorMessage = event.detail.message;
30
+ this.errorEvent.emit(event.detail);
31
+ };
27
32
  this.accountId = undefined;
28
33
  this.authToken = undefined;
29
34
  this.getPayouts = undefined;
@@ -45,13 +50,17 @@ export class PayoutsList {
45
50
  }
46
51
  else {
47
52
  this.errorMessage = 'Account ID and Auth Token are required';
53
+ this.errorEvent.emit({
54
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
55
+ message: 'Account ID and Auth Token are required',
56
+ });
48
57
  }
49
58
  }
50
59
  render() {
51
60
  if (this.errorMessage) {
52
61
  return ErrorState(this.errorMessage);
53
62
  }
54
- return (h(Host, { exportedparts: tableExportedParts }, h("payouts-list-core", { getPayouts: this.getPayouts })));
63
+ return (h(Host, { exportedparts: tableExportedParts }, h("payouts-list-core", { getPayouts: this.getPayouts, "onError-event": this.handleOnError })));
55
64
  }
56
65
  static get is() { return "justifi-payouts-list"; }
57
66
  static get encapsulation() { return "shadow"; }
@@ -99,6 +108,30 @@ export class PayoutsList {
99
108
  "errorMessage": {}
100
109
  };
101
110
  }
111
+ static get events() {
112
+ return [{
113
+ "method": "errorEvent",
114
+ "name": "error-event",
115
+ "bubbles": true,
116
+ "cancelable": true,
117
+ "composed": true,
118
+ "docs": {
119
+ "tags": [],
120
+ "text": ""
121
+ },
122
+ "complexType": {
123
+ "original": "ComponentError",
124
+ "resolved": "ComponentError",
125
+ "references": {
126
+ "ComponentError": {
127
+ "location": "import",
128
+ "path": "../../api/ComponentError",
129
+ "id": "src/api/ComponentError.ts::ComponentError"
130
+ }
131
+ }
132
+ }
133
+ }];
134
+ }
102
135
  static get watchers() {
103
136
  return [{
104
137
  "propName": "accountId",
@@ -1,7 +1,7 @@
1
1
  import { Payout } from "../../../api";
2
2
  import { PayoutService } from "../../../api/services/payout.service";
3
3
  import { makeGetPayouts } from "../get-payouts";
4
- import mockResponse from "../../../api/mockData/mockPayoutsSuccess.json";
4
+ import mockResponse from "../../../../../../mockData/mockPayoutsSuccess.json";
5
5
  describe('makeGetPayouts', () => {
6
6
  const mockId = '123';
7
7
  const mockAuthToken = 'token';
@@ -43,7 +43,11 @@ describe('makeGetPayouts', () => {
43
43
  service: mockServiceInstance,
44
44
  });
45
45
  await getPayouts({ params: mockParams, onSuccess, onError });
46
- expect(onError).toHaveBeenCalledWith('Error fetching payouts');
46
+ expect(onError).toHaveBeenCalledWith({
47
+ code: 'fetch-error',
48
+ error: 'Error fetching payouts',
49
+ severity: 'error',
50
+ });
47
51
  expect(onSuccess).not.toHaveBeenCalled();
48
52
  });
49
53
  it('should call onError with an error message on API failure', async () => {
@@ -58,7 +62,11 @@ describe('makeGetPayouts', () => {
58
62
  service: mockServiceInstance,
59
63
  });
60
64
  await getPayouts({ params: mockParams, onSuccess, onError });
61
- expect(onError).toHaveBeenCalledWith('Error fetching payouts');
65
+ expect(onError).toHaveBeenCalledWith({
66
+ code: 'fetch-error',
67
+ error: 'Error fetching payouts',
68
+ severity: 'error',
69
+ });
62
70
  expect(onSuccess).not.toHaveBeenCalled();
63
71
  });
64
72
  });
@@ -1,8 +1,9 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { Table } from "../../table/table";
3
4
  import { PaginationMenu } from "../../pagination-menu/pagination-menu";
4
5
  import { PayoutsListCore } from "../payouts-list-core";
5
- import mockSuccessResponse from "../../../api/mockData/mockPayoutsSuccess.json";
6
+ import mockSuccessResponse from "../../../../../../mockData/mockPayoutsSuccess.json";
6
7
  import { makeGetPayouts } from "../get-payouts";
7
8
  const mockPayoutsResponse = mockSuccessResponse;
8
9
  describe('payouts-list-core', () => {
@@ -10,19 +11,15 @@ describe('payouts-list-core', () => {
10
11
  const mockPayoutService = {
11
12
  fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
12
13
  };
13
- const page = await newSpecPage({
14
- components: [PayoutsListCore, Table, PaginationMenu],
15
- html: `
16
- <payouts-list-core></payouts-list-core>
17
- `,
18
- });
19
- page.rootInstance.componentWillLoad = () => { };
20
- page.rootInstance.getPayouts = makeGetPayouts({
14
+ const getPayouts = makeGetPayouts({
21
15
  id: '123',
22
16
  authToken: '123',
23
17
  service: mockPayoutService
24
18
  });
25
- page.rootInstance.fetchData();
19
+ const page = await newSpecPage({
20
+ components: [PayoutsListCore, Table, PaginationMenu],
21
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
22
+ });
26
23
  await page.waitForChanges();
27
24
  const justifiTable = page.root.querySelector('justifi-table');
28
25
  const shadowRoot = justifiTable.shadowRoot;
@@ -41,11 +38,8 @@ describe('payouts-list-core', () => {
41
38
  });
42
39
  const page = await newSpecPage({
43
40
  components: [PayoutsListCore, Table, PaginationMenu],
44
- html: '<payouts-list-core></payouts-list-core>',
41
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
45
42
  });
46
- page.rootInstance.componentWillLoad = () => { };
47
- page.rootInstance.getPayouts = getPayouts;
48
- page.rootInstance.fetchData();
49
43
  await page.waitForChanges();
50
44
  const justifiTable = page.root.querySelector('justifi-table');
51
45
  const shadowRoot = justifiTable.shadowRoot;
@@ -53,21 +47,42 @@ describe('payouts-list-core', () => {
53
47
  expect(error).toBeTruthy();
54
48
  expect(page.root).toMatchSnapshot();
55
49
  });
56
- it('emits payout-row-clicked event on row click', async () => {
50
+ it('emits an error event on failed data fetch', async () => {
57
51
  const mockPayoutService = {
58
- fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
52
+ fetchPayouts: jest.fn().mockRejectedValue(new Error('Fetch error'))
59
53
  };
54
+ const getPayouts = makeGetPayouts({
55
+ id: 'some-id',
56
+ authToken: 'some-auth-token',
57
+ service: mockPayoutService
58
+ });
59
+ const errorSpy = jest.fn();
60
60
  const page = await newSpecPage({
61
61
  components: [PayoutsListCore, Table, PaginationMenu],
62
- html: '<payouts-list-core></payouts-list-core>',
62
+ template: () => h("payouts-list-core", { getPayouts: getPayouts, "onError-event": errorSpy }),
63
63
  });
64
- page.rootInstance.componentWillLoad = () => { };
65
- page.rootInstance.getPayouts = makeGetPayouts({
64
+ await page.waitForChanges();
65
+ expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
66
+ detail: {
67
+ errorCode: 'fetch-error',
68
+ message: 'Fetch error',
69
+ severity: 'error',
70
+ }
71
+ }));
72
+ });
73
+ it('emits payout-row-clicked event on row click', async () => {
74
+ const mockPayoutService = {
75
+ fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
76
+ };
77
+ const getPayouts = makeGetPayouts({
66
78
  id: '123',
67
79
  authToken: '123',
68
80
  service: mockPayoutService
69
81
  });
70
- page.rootInstance.fetchData();
82
+ const page = await newSpecPage({
83
+ components: [PayoutsListCore, Table, PaginationMenu],
84
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
85
+ });
71
86
  await page.waitForChanges();
72
87
  const rowClickedHandler = jest.fn();
73
88
  page.win.addEventListener('payout-row-clicked', rowClickedHandler);
@@ -83,22 +98,20 @@ describe('payouts-list-core', () => {
83
98
  const mockPayoutService = {
84
99
  fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
85
100
  };
86
- const page = await newSpecPage({
87
- components: [PayoutsListCore, Table, PaginationMenu],
88
- html: `<payouts-list-core></payouts-list-core>`,
89
- });
90
- page.rootInstance.componentWillLoad = () => { };
91
- page.rootInstance.getPayouts = makeGetPayouts({
101
+ const getPayouts = makeGetPayouts({
92
102
  id: '123',
93
103
  authToken: '123',
94
104
  service: mockPayoutService
95
105
  });
96
- page.rootInstance.fetchData();
106
+ const page = await newSpecPage({
107
+ components: [PayoutsListCore, Table, PaginationMenu],
108
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
109
+ });
97
110
  await page.waitForChanges();
98
111
  page.rootInstance.handleClickNext('nextCursor');
99
112
  await page.waitForChanges();
100
- // The mock function should be called 3 times: once for the initial load, twice for when mockGetPayouts is set and later after the pagination interaction
101
- expect(mockPayoutService.fetchPayouts).toHaveBeenCalledTimes(3);
113
+ // The mock function should be called 2 times: once for the initial load and later after the pagination interaction
114
+ expect(mockPayoutService.fetchPayouts).toHaveBeenCalledTimes(2);
102
115
  const updatedParams = page.rootInstance.params;
103
116
  expect(updatedParams.after_cursor).toBe('nextCursor');
104
117
  });
@@ -1,6 +1,9 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { PayoutsList } from "../payouts-list";
3
4
  import { PayoutsListCore } from "../payouts-list-core";
5
+ import { PayoutService } from "../../../api/services/payout.service";
6
+ jest.mock('../../../api/services/payout.service');
4
7
  describe('payouts-list', () => {
5
8
  it('renders an error message when accountId and authToken are not provided', async () => {
6
9
  const page = await newSpecPage({
@@ -26,4 +29,34 @@ describe('payouts-list', () => {
26
29
  await page.waitForChanges();
27
30
  expect(page.root).toMatchSnapshot();
28
31
  });
32
+ it('emits an error event when accountId and authToken are not provided', async () => {
33
+ const onErrorSpy = jest.fn();
34
+ const page = await newSpecPage({
35
+ components: [PayoutsList, PayoutsListCore],
36
+ template: () => h("justifi-payouts-list", { "onError-event": onErrorSpy }),
37
+ });
38
+ await page.waitForChanges();
39
+ expect(onErrorSpy).toHaveBeenCalledWith(expect.objectContaining({
40
+ detail: {
41
+ errorCode: 'missing-props',
42
+ message: 'Account ID and Auth Token are required',
43
+ },
44
+ }));
45
+ });
46
+ it('emits an error event when fetch fails', async () => {
47
+ PayoutService.prototype.fetchPayouts = jest.fn().mockRejectedValue(new Error('Fetch error'));
48
+ const onErrorSpy = jest.fn();
49
+ const page = await newSpecPage({
50
+ components: [PayoutsList, PayoutsListCore],
51
+ template: () => (h("justifi-payouts-list", { "account-id": "abc", "auth-token": "abc", "onError-event": onErrorSpy })),
52
+ });
53
+ await page.waitForChanges();
54
+ expect(onErrorSpy).toHaveBeenCalledWith(expect.objectContaining({
55
+ detail: {
56
+ errorCode: 'fetch-error',
57
+ message: 'Fetch error',
58
+ severity: 'error',
59
+ },
60
+ }));
61
+ });
29
62
  });