@tesouro/embedded-components-react 0.2.318 → 0.2.320

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 (135) hide show
  1. package/README.md +5 -4
  2. package/dist/index.css +9 -0
  3. package/dist/index.d.ts +4 -1
  4. package/dist/index.js +1 -1
  5. package/dist/lib/BillPayWidget.d.ts +4 -1
  6. package/dist/lib/BillPayWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -7
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +170 -32
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +13 -32
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +30 -0
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +50 -0
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +36 -0
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index3.js +11 -8
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +33 -16
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +47 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +18 -63
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +40 -131
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +48 -11
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +30 -20
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +18 -16
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +29 -97
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +1 -9
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +13 -109
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +24 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +30 -21
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +19 -46
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +49 -76
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +4 -45
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +73 -3
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +50 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +4 -50
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -43
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +38 -1
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +115 -31
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +56 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +206 -16
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +195 -5
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +58 -64
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +46 -139
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +34 -5
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +155 -6
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +3 -60
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +36 -7
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +92 -73
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +9 -3
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +191 -6
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +4 -114
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +26 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +78 -21
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +92 -0
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +3 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +4 -0
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +5 -206
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +45 -0
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +1 -0
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +53 -0
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +11 -0
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +18 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +8 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +79 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +148 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +5 -0
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +8 -0
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +3 -197
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +9 -0
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +85 -0
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +3 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -0
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +115 -0
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +1 -0
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +25 -0
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +30 -41
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +38 -30
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +20 -151
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +158 -31
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +29 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +13 -7
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +13 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +24 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -22
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +31 -283
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +261 -1
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +2 -16
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +7 -118
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +49 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -10
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +20 -94
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +286 -2
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +1 -12
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +14 -56
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +120 -2
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -19
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +8 -157
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +96 -2
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -7
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +11 -42
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +57 -1
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -14
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +50 -20
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +138 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +1 -54
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +5 -227
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +37 -188
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +2 -10
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +55 -5
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +229 -84
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +195 -0
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +10 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +4 -3
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +88 -25
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -14
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +5 -87
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +30 -2
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -0
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +7 -0
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +34 -0
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -0
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +12 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +106 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +18 -0
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +10 -0
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +170 -0
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +2 -0
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +14 -0
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +89 -0
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +2 -0
  128. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -21
  129. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +189 -156
  130. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +157 -97
  131. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +10 -10
  132. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  134. package/package.json +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +0 -2
@@ -4,72 +4,27 @@
4
4
  "use client";
5
5
  import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
6
  import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
- import { getPayablesIdLineItems as n, putPayablesIdLineItems as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
- import { getPayablesIdLineItemsOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
9
- import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
10
- import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../shared/data-access/dist/lib/allPages.js";
7
+ import { getPayablesIdHistoryOptions as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
+ import { withAuthEpoch as r } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
11
9
  import "../../../shared/data-access/dist/index.js";
12
- import { invalidatePayableQueries as l } from "./index4.js";
13
- import { useMemo as u } from "react";
14
- import { useInfiniteQuery as d, useMutation as f } from "@tanstack/react-query";
10
+ import { useQuery as i } from "@tanstack/react-query";
15
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
16
- var p = 100;
17
- function m(r, { enabled: l } = {}) {
18
- let { client: f, organizationId: m, widgetToken: h, authEpoch: g } = e(), _ = t(m), v = !!(m && h && r) && l !== !1, y = i({
19
- client: f,
20
- headers: _,
21
- path: { payable_id: r ?? "" },
22
- query: { limit: p }
23
- }), b = d({
24
- queryKey: [...a(y, g).queryKey, "all"],
25
- enabled: v,
26
- initialPageParam: void 0,
27
- queryFn: async ({ signal: e, pageParam: t }) => {
28
- let { data: i } = await n({
29
- client: f,
30
- headers: _,
31
- path: { payable_id: r ?? "" },
32
- query: {
33
- limit: p,
34
- ...t ? { pagination_token: t } : {}
35
- },
36
- signal: e,
37
- throwOnError: !0
38
- });
39
- return i;
40
- },
41
- getNextPageParam: o
42
- });
43
- c(b, v);
44
- let x = u(() => b.data?.pages.flatMap((e) => e.data ?? []) ?? [], [b.data]);
45
- return {
46
- ...b,
47
- lineItems: x,
48
- isResolving: s(b)
49
- };
50
- }
51
- function h() {
52
- let { client: n, organizationId: i } = e();
53
- return f({
54
- mutationFn: async ({ path: e, body: a }) => {
55
- let { data: o } = await r({
56
- client: n,
57
- headers: t(i),
58
- path: e,
59
- body: a,
60
- throwOnError: !0
61
- });
62
- return o;
63
- },
64
- onSuccess: async (e, t) => {
65
- await l({
66
- client: n,
67
- organizationId: i,
68
- payableId: t.path.payable_id,
69
- includeLineItems: !0
70
- });
12
+ var a = 100;
13
+ function o(o, { enabled: s } = {}) {
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), f = !!(l && u && o) && s !== !1, p = n({
15
+ client: c,
16
+ headers: t(l),
17
+ path: { payable_id: o ?? "" },
18
+ query: {
19
+ sort: "timestamp",
20
+ order: "asc",
21
+ limit: a
71
22
  }
72
23
  });
24
+ return i({
25
+ ...r(p, d),
26
+ enabled: f
27
+ });
73
28
  }
74
29
  //#endregion
75
- export { m as useAllPayableLineItemsQuery, h as useReplacePayableLineItemsMutation };
30
+ export { o as usePayableHistoryQuery };
@@ -4,34 +4,53 @@
4
4
  "use client";
5
5
  import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
6
  import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
- import { deleteFilesId as n, patchPayablesId as r, postPayables as i, postPayablesIdAttachFile as a, postPayablesIdSubmitForApproval as o, postPayablesIdValidate as s, postPayablesUploadFromFile as c } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
7
+ import { getPayablesIdLineItems as n, putPayablesIdLineItems as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
+ import { getPayablesIdLineItemsOptions as i } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
9
+ import { withAuthEpoch as a } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
10
+ import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../shared/data-access/dist/lib/allPages.js";
8
11
  import "../../../shared/data-access/dist/index.js";
9
12
  import { invalidatePayableQueries as l } from "./index4.js";
10
- import { useMutation as u } from "@tanstack/react-query";
13
+ import { useMemo as u } from "react";
14
+ import { useInfiniteQuery as d, useMutation as f } from "@tanstack/react-query";
11
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js
12
- function d() {
13
- let { client: n, organizationId: r } = e();
14
- return u({
15
- mutationFn: async ({ body: e }) => {
16
- let { data: a } = await i({
17
- client: n,
18
- headers: t(r),
19
- body: e,
16
+ var p = 100;
17
+ function m(r, { enabled: l } = {}) {
18
+ let { client: f, organizationId: m, widgetToken: h, authEpoch: g } = e(), _ = t(m), v = !!(m && h && r) && l !== !1, y = i({
19
+ client: f,
20
+ headers: _,
21
+ path: { payable_id: r ?? "" },
22
+ query: { limit: p }
23
+ }), b = d({
24
+ queryKey: [...a(y, g).queryKey, "all"],
25
+ enabled: v,
26
+ initialPageParam: void 0,
27
+ queryFn: async ({ signal: e, pageParam: t }) => {
28
+ let { data: i } = await n({
29
+ client: f,
30
+ headers: _,
31
+ path: { payable_id: r ?? "" },
32
+ query: {
33
+ limit: p,
34
+ ...t ? { pagination_token: t } : {}
35
+ },
36
+ signal: e,
20
37
  throwOnError: !0
21
38
  });
22
- return a;
39
+ return i;
23
40
  },
24
- onSuccess: async () => {
25
- await l({
26
- client: n,
27
- organizationId: r
28
- });
29
- }
41
+ getNextPageParam: o
30
42
  });
43
+ c(b, v);
44
+ let x = u(() => b.data?.pages.flatMap((e) => e.data ?? []) ?? [], [b.data]);
45
+ return {
46
+ ...b,
47
+ lineItems: x,
48
+ isResolving: s(b)
49
+ };
31
50
  }
32
- function f() {
51
+ function h() {
33
52
  let { client: n, organizationId: i } = e();
34
- return u({
53
+ return f({
35
54
  mutationFn: async ({ path: e, body: a }) => {
36
55
  let { data: o } = await r({
37
56
  client: n,
@@ -46,121 +65,11 @@ function f() {
46
65
  await l({
47
66
  client: n,
48
67
  organizationId: i,
49
- payableId: t.path.payable_id
50
- });
51
- }
52
- });
53
- }
54
- function p() {
55
- let { client: n, organizationId: i } = e();
56
- return u({
57
- mutationFn: async ({ file: e }) => {
58
- let { data: a } = await c({
59
- client: n,
60
- headers: t(i),
61
- body: { file: e },
62
- throwOnError: !0
63
- });
64
- if (a?.id && a.currency !== "USD") try {
65
- return await r({
66
- client: n,
67
- headers: t(i),
68
- path: { payable_id: a.id },
69
- body: { currency: "USD" },
70
- throwOnError: !0
71
- }), {
72
- ...a,
73
- currency: "USD"
74
- };
75
- } catch {}
76
- return a;
77
- },
78
- onSuccess: async () => {
79
- await l({
80
- client: n,
81
- organizationId: i
82
- });
83
- }
84
- });
85
- }
86
- function m() {
87
- let { client: n, organizationId: r } = e();
88
- return u({
89
- mutationFn: async ({ path: e, file: i }) => {
90
- let { data: o } = await a({
91
- client: n,
92
- headers: t(r),
93
- path: e,
94
- body: { file: i },
95
- throwOnError: !0
96
- });
97
- return o;
98
- },
99
- onSuccess: async (e, t) => {
100
- await l({
101
- client: n,
102
- organizationId: r,
103
- payableId: t.path.payable_id
104
- });
105
- }
106
- });
107
- }
108
- function h() {
109
- let { client: r, organizationId: i } = e();
110
- return u({
111
- mutationFn: async ({ path: e }) => {
112
- await n({
113
- client: r,
114
- headers: t(i),
115
- path: e,
116
- throwOnError: !0
117
- });
118
- },
119
- onSuccess: async (e, t) => {
120
- await l({
121
- client: r,
122
- organizationId: i,
123
- payableId: t.payableId
124
- });
125
- }
126
- });
127
- }
128
- function g() {
129
- let { client: n, organizationId: r } = e();
130
- return u({ mutationFn: async ({ path: e }) => {
131
- let { data: i } = await s({
132
- client: n,
133
- headers: t(r),
134
- path: e,
135
- throwOnError: !0
136
- });
137
- return {
138
- id: i.id,
139
- validation_errors: i.validation_errors ?? []
140
- };
141
- } });
142
- }
143
- function _() {
144
- let { client: n, organizationId: r } = e();
145
- return u({
146
- mutationFn: async ({ path: e }) => {
147
- let { data: i } = await o({
148
- client: n,
149
- headers: t(r),
150
- path: e,
151
- throwOnError: !0
152
- });
153
- return i;
154
- },
155
- onSuccess: async (e, t) => {
156
- await l({
157
- client: n,
158
- organizationId: r,
159
68
  payableId: t.path.payable_id,
160
- includeApprovalRequests: !0
69
+ includeLineItems: !0
161
70
  });
162
71
  }
163
72
  });
164
73
  }
165
74
  //#endregion
166
- export { m as useAttachPayableFileMutation, d as useCreatePayableMutation, h as useDeletePayableFileMutation, _ as useSubmitPayableForApprovalMutation, f as useUpdatePayableMutation, p as useUploadPayableFromFileMutation, g as useValidatePayableMutation };
75
+ export { m as useAllPayableLineItemsQuery, h as useReplacePayableLineItemsMutation };
@@ -1,17 +1,54 @@
1
- import { organizationHeaders as e } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
2
- import { getPayablesIdOptions as t } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
+ import { getPaymentRecords as n } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
+ import { getPaymentRecordsOptions as r } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
9
+ import { withAuthEpoch as i } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
10
+ import { getAllPagesNextPaginationTokenParam as a, isAllPagesResolving as o, useAutoFetchNextPage as s } from "../../../shared/data-access/dist/lib/allPages.js";
3
11
  import "../../../shared/data-access/dist/index.js";
12
+ import { useMemo as c } from "react";
13
+ import { useInfiniteQuery as l } from "@tanstack/react-query";
4
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js
5
- var n = 2500;
6
- function r({ client: n, organizationId: r, payableId: i }) {
15
+ var u = 100;
16
+ function d(d, { enabled: f } = {}) {
17
+ let { client: p, organizationId: m, widgetToken: h, authEpoch: g } = e(), _ = t(m), v = !!(m && h && d) && f !== !1, y = {
18
+ limit: u,
19
+ object_id__in: d ? [d] : [],
20
+ order: "desc",
21
+ sort: "paid_at"
22
+ }, b = r({
23
+ client: p,
24
+ headers: _,
25
+ query: y
26
+ }), x = l({
27
+ queryKey: [...i(b, g).queryKey, "all"],
28
+ enabled: v,
29
+ initialPageParam: void 0,
30
+ queryFn: async ({ signal: e, pageParam: t }) => {
31
+ let { data: r } = await n({
32
+ client: p,
33
+ headers: _,
34
+ query: {
35
+ ...y,
36
+ ...t ? { pagination_token: t } : {}
37
+ },
38
+ signal: e,
39
+ throwOnError: !0
40
+ });
41
+ return r;
42
+ },
43
+ getNextPageParam: a
44
+ });
45
+ s(x, v);
46
+ let S = c(() => x.data?.pages.flatMap((e) => e.data ?? []) ?? [], [x.data]);
7
47
  return {
8
- ...t({
9
- client: n,
10
- headers: e(r),
11
- path: { payable_id: i }
12
- }),
13
- refetchInterval: (e) => e.state.data?.ocr_status === "processing" && 2500
48
+ ...x,
49
+ paymentRecords: S,
50
+ isResolving: o(x)
14
51
  };
15
52
  }
16
53
  //#endregion
17
- export { n as OCR_POLL_INTERVAL_MS, r as payableOcrQueryOptions };
54
+ export { d as usePayablePaymentRecordsQuery };
@@ -3,28 +3,38 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
- import { withAuthEpoch as t } from "../../../shared/data-access/dist/lib/withAuthEpoch.js";
6
+ import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
+ import { postPayablesIdSchedulePayment as n } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
7
8
  import "../../../shared/data-access/dist/index.js";
8
- import { payableOcrQueryOptions as n } from "./index8.js";
9
- import { useQueries as r } from "@tanstack/react-query";
9
+ import { invalidatePayableQueries as r } from "./index4.js";
10
+ import { useMutation as i } from "@tanstack/react-query";
10
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js
11
- function i({ payableIds: i, enabled: a }) {
12
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l } = e(), u = !!(s && c) && (a === !0 || a === void 0);
13
- return r({
14
- queries: i.map((e) => ({
15
- ...t(n({
16
- client: o,
17
- organizationId: s,
18
- payableId: e
19
- }), l),
20
- enabled: u && !!e
21
- })),
22
- combine: (e) => e.map((e, t) => ({
23
- payableId: i[t],
24
- ocrStatus: e.data?.ocr_status,
25
- isError: e.isError
26
- }))
12
+ function a() {
13
+ let { client: a, organizationId: o } = e();
14
+ return i({
15
+ mutationFn: async ({ payableId: e, paymentDate: r, sourceBankAccountId: i }) => {
16
+ let { data: s } = await n({
17
+ client: a,
18
+ headers: t(o),
19
+ path: { payable_id: e },
20
+ body: {
21
+ payment_date: r,
22
+ source_bank_account_id: i
23
+ },
24
+ throwOnError: !0
25
+ });
26
+ return s;
27
+ },
28
+ onSuccess: async (e, t) => {
29
+ try {
30
+ await r({
31
+ client: a,
32
+ organizationId: o,
33
+ payableId: t.payableId
34
+ });
35
+ } catch {}
36
+ }
27
37
  });
28
38
  }
29
39
  //#endregion
30
- export { i as usePayableOcrQueries };
40
+ export { a as useSchedulePaymentMutation };
@@ -1,22 +1,24 @@
1
- import "./index2.js";
2
- import "./index8.js";
3
1
  import "./index10.js";
4
- import "./index12.js";
5
- import "./index13.js";
6
- import "./index14.js";
7
- import "./index15.js";
2
+ import "./index11.js";
8
3
  import "./index16.js";
9
- import "./index17.js";
10
- import "./index18.js";
11
4
  import "./index22.js";
12
- import "./index24.js";
13
- import "./index25.js";
14
- import "./index26.js";
15
- import "./index27.js";
16
- import "./index28.js";
17
5
  import "./index29.js";
18
- import "./index30.js";
19
6
  import "./index31.js";
20
- import "./index32.js";
21
- import { BillPayWidget as e } from "./index36.js";
7
+ import "./index33.js";
8
+ import "./index34.js";
9
+ import "./index35.js";
10
+ import "./index36.js";
11
+ import "./index37.js";
12
+ import "./index38.js";
13
+ import "./index42.js";
14
+ import "./index44.js";
15
+ import "./index45.js";
16
+ import "./index46.js";
17
+ import "./index47.js";
18
+ import "./index48.js";
19
+ import "./index49.js";
20
+ import "./index50.js";
21
+ import "./index51.js";
22
+ import "./index52.js";
23
+ import { BillPayWidget as e } from "./index56.js";
22
24
  export { e as BillPayWidget };
@@ -2,103 +2,35 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { calculateTotal as e, displayLineAmount as t, parseMoneyToMinorUnits as n } from "./index6.js";
6
- import { emptyLineItem as r, mapPayableToBillForm as i } from "./index9.js";
7
- import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
5
+ import { resolveAmountDueMinorUnits as e } from "./index2.js";
6
+ import { resolveVendor as t } from "./index3.js";
7
+ import { payBillFlowTestIds as n } from "./index4.js";
8
+ import { ReviewTransactionDialog as r } from "../../ui/dist/index55.js";
9
+ import { SchedulePaymentDialog as i } from "../../ui/dist/index59.js";
10
+ import "../../ui/dist/index.js";
11
+ import { usePayBillFlow as a } from "./index9.js";
12
+ import { useImperativeHandle as o } from "react";
13
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
9
- function l(e, r, i) {
10
- return n(r) === null ? i : t(e, r);
11
- }
12
- function u({ payable: t, lineItems: n } = {}) {
13
- let u = s(() => i({
14
- payable: t ?? {},
15
- lineItems: n ?? []
16
- }), [t, n]), [d, f] = c(u.values), [p, m] = c(u.lineItems), [h, g] = c(u.discount), [_, v] = c(u.tax), [y, b] = c(u.total || void 0), [x, S] = c(), [C, w] = c(), [T, E] = c(!1), [D, O] = c(!1), [k, A] = c(!1);
17
- o(() => {
18
- T || f(u.values);
19
- }, [u]), o(() => {
20
- D || m(u.lineItems);
21
- }, [u]), o(() => {
22
- k || (g(u.discount), v(u.tax), b(u.total || void 0));
23
- }, [u]);
24
- let j = a((e) => {
25
- f((t) => ({
26
- ...t,
27
- ...e
28
- })), E(!0);
29
- }, []), M = a((e) => {
30
- w((t) => {
31
- if (!t?.[e]) return t;
32
- let n = { ...t };
33
- return delete n[e], Object.keys(n).length ? n : void 0;
34
- });
35
- }, []), N = a((e, t) => {
36
- M(e), m((n) => n.map((n) => {
37
- if (n.id !== e) return n;
38
- let r = {
39
- ...n,
40
- ...t
41
- };
42
- return "amount" in t ? r : {
43
- ...r,
44
- amount: l(r.quantity, r.price, r.amount)
45
- };
46
- })), O(!0), b(void 0);
47
- }, [M]), P = a((e, t) => {
48
- M(e), m((n) => n.map((n) => {
49
- if (n.id !== e) return n;
50
- let r = Number.parseFloat(n.quantity), i = String(Math.max(1, (Number.isFinite(r) ? r : 1) + t));
51
- return {
52
- ...n,
53
- quantity: i,
54
- amount: l(i, n.price, n.amount)
55
- };
56
- })), O(!0), b(void 0);
57
- }, [M]), F = a((e) => {
58
- M(e), m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), O(!0), b(void 0);
59
- }, [M]), I = a(() => {
60
- m((e) => [...e, r()]), O(!0), b(void 0);
61
- }, []), L = a((e) => {
62
- g(e), A(!0), b(void 0);
63
- }, []), R = a((e) => {
64
- v(e), A(!0), b(void 0);
65
- }, []), z = a((e) => {
66
- b(e), A(!0);
67
- }, []), B = s(() => p.map((e) => ({
68
- ...e,
69
- onChange: (t) => N(e.id, t),
70
- onQuantityStep: (t) => P(e.id, t),
71
- onRemove: () => F(e.id)
72
- })), [
73
- p,
74
- N,
75
- F,
76
- P
77
- ]), V = s(() => e(p, _, h), [
78
- p,
79
- _,
80
- h
81
- ]);
82
- return {
83
- values: d,
84
- errors: x,
85
- setErrors: S,
86
- lineItemErrors: C,
87
- setLineItemErrors: w,
88
- onChange: j,
89
- lineItems: p,
90
- lineItemRows: B,
91
- discount: h,
92
- onDiscountChange: L,
93
- tax: _,
94
- onTaxChange: R,
95
- total: y ?? V,
96
- totalOverride: y,
97
- onTotalChange: z,
98
- onAddLineItem: I,
99
- isTotalsDirty: k,
100
- isDirty: T || D || k
101
- };
15
+ function u({ ref: u, payable: d, poweredByBankName: f, labels: p }) {
16
+ let m = t(d), h = a({
17
+ payableId: d.id,
18
+ amountDueMinorUnits: e(d) ?? 0,
19
+ currencyCode: d.currency ?? void 0,
20
+ dueDate: d.due_date,
21
+ vendorName: m?.name,
22
+ vendorEmail: m?.email,
23
+ vendorBankAccount: m?.bank_account,
24
+ poweredByBankName: f,
25
+ labels: p
26
+ });
27
+ return o(u, () => ({ open: h.open }), [h.open]), /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(i, {
28
+ ...h.dialogProps,
29
+ testId: n.scheduleDialog
30
+ }), /* @__PURE__ */ c(r, {
31
+ ...h.reviewProps,
32
+ testId: n.reviewDialog
33
+ })] });
102
34
  }
103
35
  //#endregion
104
- export { u as useBillForm };
36
+ export { u as PayBillFlow, u as default };
@@ -1,9 +1 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js
2
- var e = {
3
- dialog: "bill-pay-bill-create-dialog",
4
- vendorSection: "bill-pay-bill-create-vendor",
5
- lineItems: "bill-pay-bill-create-line-items",
6
- documentPanel: "bill-pay-bill-create-document"
7
- };
8
- //#endregion
9
- export { e as billCreateTestIds };
1
+ import "./index10.js";