@tesouro/embedded-components-react 0.11.179 → 0.11.180

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 (83) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  78. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  79. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  80. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
  81. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
  82. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  83. package/package.json +1 -1
@@ -2,37 +2,56 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getPayablesIdSuggestionsOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
- import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
- import { isApiNotFoundError as i } from "../../../../shared/data-access/dist/lib/isApiNotFoundError.js";
5
+ import { getPaymentRecords as e } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getPaymentRecordsOptions as t } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpochInfinite as n } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as r } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as i } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
+ import { getAllPagesNextPaginationTokenParam as a, isAllPagesResolving as o, useAutoFetchNextPage as s } from "../../../../shared/data-access/dist/lib/allPages.js";
10
11
  import "../../../../shared/data-access/dist/index.js";
11
- import { useQuery as a } from "@tanstack/react-query";
12
+ import { useMemo as c } from "react";
13
+ import { useInfiniteQuery as l } from "@tanstack/react-query";
12
14
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js
13
- function o(o, { enabled: s = !0 } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s, m = e({
15
- client: c,
16
- headers: r(l),
17
- path: { payable_id: o ?? "" }
18
- }), { queryKey: h, queryFn: g } = t(m, {
19
- authEpoch: d,
20
- organizationStatus: f
21
- });
22
- return a({
23
- queryKey: h,
24
- enabled: p,
25
- retry: !1,
26
- queryFn: async (e) => {
27
- try {
28
- if (typeof g != "function") throw Error("getPayablesIdSuggestionsOptions has no queryFn");
29
- return await g(e);
30
- } catch (e) {
31
- if (i(e)) return null;
32
- throw e;
33
- }
15
+ var u = 100;
16
+ function d(d, { enabled: f } = {}) {
17
+ let { client: p, organizationId: m, widgetToken: h, authEpoch: g, organizationStatus: _ } = r(), v = i(m), y = !!(m && h && d) && f !== !1, b = {
18
+ limit: u,
19
+ object_id__in: d ? [d] : [],
20
+ order: "desc",
21
+ sort: "paid_at"
22
+ }, x = t({
23
+ client: p,
24
+ headers: v,
25
+ query: b
26
+ }), S = l({
27
+ ...n(x.queryKey, {
28
+ authEpoch: g,
29
+ organizationStatus: _
30
+ }, { suffix: ["all"] }),
31
+ enabled: y,
32
+ staleTime: 3e4,
33
+ initialPageParam: void 0,
34
+ queryFn: async ({ signal: t, pageParam: n }) => {
35
+ let { data: r } = await e({
36
+ client: p,
37
+ headers: v,
38
+ query: {
39
+ ...b,
40
+ ...n ? { pagination_token: n } : {}
41
+ },
42
+ signal: t,
43
+ throwOnError: !0
44
+ });
45
+ return r;
34
46
  },
35
- select: (e) => e ?? void 0
47
+ getNextPageParam: a
36
48
  });
49
+ s(S, y);
50
+ let C = c(() => S.data?.pages.flatMap((e) => e.data ?? []) ?? [], [S.data]);
51
+ return {
52
+ ...S,
53
+ paymentRecords: C,
54
+ isResolving: y && o(S)
55
+ };
37
56
  }
38
- export { o as usePayableSuggestionsQuery };
57
+ export { d as usePayablePaymentRecordsQuery };
@@ -1,22 +1,38 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getPayablesIdSuggestionsOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
+ import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
+ import { isApiNotFoundError as i } from "../../../../shared/data-access/dist/lib/isApiNotFoundError.js";
10
+ import "../../../../shared/data-access/dist/index.js";
11
+ import { useQuery as a } from "@tanstack/react-query";
1
12
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js
2
- var e = 1e4;
3
- function t(e) {
4
- if (e && !e.approval_policy_id && e.status === "approve_in_progress" && e.updated_at) return `${e.id ?? ""}|${e.updated_at}`;
13
+ function o(o, { enabled: s = !0 } = {}) {
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s, m = e({
15
+ client: c,
16
+ headers: r(l),
17
+ path: { payable_id: o ?? "" }
18
+ }), { queryKey: h, queryFn: g } = t(m, {
19
+ authEpoch: d,
20
+ organizationStatus: f
21
+ });
22
+ return a({
23
+ queryKey: h,
24
+ enabled: p,
25
+ retry: !1,
26
+ queryFn: async (e) => {
27
+ try {
28
+ if (typeof g != "function") throw Error("getPayablesIdSuggestionsOptions has no queryFn");
29
+ return await g(e);
30
+ } catch (e) {
31
+ if (i(e)) return null;
32
+ throw e;
33
+ }
34
+ },
35
+ select: (e) => e ?? void 0
36
+ });
5
37
  }
6
- function n(n, r) {
7
- if (!t(n) || !n?.updated_at) return;
8
- let i = new Date(n.updated_at).getTime() + e;
9
- return r === void 0 ? i : Math.min(i, r + e);
10
- }
11
- var r = /* @__PURE__ */ new Map();
12
- function i(e, n) {
13
- let i = t(e);
14
- if (!i) return;
15
- let a = r.get(i);
16
- return a !== void 0 || !n ? a : (r.set(i, n), n);
17
- }
18
- function a(e) {
19
- let n = t(e);
20
- return n ? r.get(n) : void 0;
21
- }
22
- export { e as POLICY_ASSIGNMENT_POLL_WINDOW_MS, n as policyAssignmentDeadline, a as policyAssignmentFirstSeenAt, t as policyAssignmentKey, i as recordPolicyAssignmentFirstSeen };
38
+ export { o as usePayableSuggestionsQuery };
@@ -1,20 +1,22 @@
1
- import { getPayablesIdOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
2
- import { organizationHeaders as t } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
3
- import "../../../../shared/data-access/dist/index.js";
4
- import { policyAssignmentDeadline as n, recordPolicyAssignmentFirstSeen as r } from "./index21.js";
5
1
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js
6
- var i = 1e3;
7
- function a({ client: a, organizationId: o, payableId: s }) {
8
- return {
9
- ...e({
10
- client: a,
11
- headers: t(o),
12
- path: { payable_id: s }
13
- }),
14
- refetchInterval: (e) => {
15
- let t = n(e.state.data, r(e.state.data, e.state.dataUpdatedAt)), a = t === void 0 ? 0 : t - Date.now();
16
- return a > 0 && Math.min(i, a);
17
- }
18
- };
2
+ var e = 1e4;
3
+ function t(e) {
4
+ if (e && !e.approval_policy_id && e.status === "approve_in_progress" && e.updated_at) return `${e.id ?? ""}|${e.updated_at}`;
19
5
  }
20
- export { a as payablePolicyAssignmentQueryOptions };
6
+ function n(n, r) {
7
+ if (!t(n) || !n?.updated_at) return;
8
+ let i = new Date(n.updated_at).getTime() + e;
9
+ return r === void 0 ? i : Math.min(i, r + e);
10
+ }
11
+ var r = /* @__PURE__ */ new Map();
12
+ function i(e, n) {
13
+ let i = t(e);
14
+ if (!i) return;
15
+ let a = r.get(i);
16
+ return a !== void 0 || !n ? a : (r.set(i, n), n);
17
+ }
18
+ function a(e) {
19
+ let n = t(e);
20
+ return n ? r.get(n) : void 0;
21
+ }
22
+ export { e as POLICY_ASSIGNMENT_POLL_WINDOW_MS, n as policyAssignmentDeadline, a as policyAssignmentFirstSeenAt, t as policyAssignmentKey, i as recordPolicyAssignmentFirstSeen };
@@ -1,43 +1,20 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
1
  import { getPayablesIdOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
- import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
2
+ import { organizationHeaders as t } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
3
  import "../../../../shared/data-access/dist/index.js";
10
- import { payableOcrQueryOptions as i } from "../../../data-access/dist/lib/payableOcrQueryOptions.js";
11
- import "../../../data-access/dist/invalidation.js";
12
- import { payablePolicyAssignmentQueryOptions as a } from "./index22.js";
13
- import { useQuery as o } from "@tanstack/react-query";
4
+ import { policyAssignmentDeadline as n, recordPolicyAssignmentFirstSeen as r } from "./index22.js";
14
5
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js
15
- function s(s, { enabled: c = !0, pollWhileOcrProcessing: l = !1, pollWhilePolicyAssignmentUnsettled: u = !1 } = {}) {
16
- let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationStatus: h } = n(), g = !!(f && p && s) && c, _ = l ? i({
17
- client: d,
18
- organizationId: f,
19
- payableId: s ?? ""
20
- }) : void 0, v = u ? a({
21
- client: d,
22
- organizationId: f,
23
- payableId: s ?? ""
24
- }) : void 0, y = _ ?? v ?? e({
25
- client: d,
26
- headers: r(f),
27
- path: { payable_id: s ?? "" }
28
- }), b = _ && v ? {
29
- ...y,
6
+ var i = 1e3;
7
+ function a({ client: a, organizationId: o, payableId: s }) {
8
+ return {
9
+ ...e({
10
+ client: a,
11
+ headers: t(o),
12
+ path: { payable_id: s }
13
+ }),
30
14
  refetchInterval: (e) => {
31
- let t = [_.refetchInterval(e), v.refetchInterval(e)].filter((e) => e !== !1);
32
- return t.length ? Math.min(...t) : !1;
15
+ let t = n(e.state.data, r(e.state.data, e.state.dataUpdatedAt)), a = t === void 0 ? 0 : t - Date.now();
16
+ return a > 0 && Math.min(i, a);
33
17
  }
34
- } : y;
35
- return o({
36
- ...t(b, {
37
- authEpoch: m,
38
- organizationStatus: h
39
- }),
40
- enabled: g
41
- });
18
+ };
42
19
  }
43
- export { s as usePayableQuery };
20
+ export { a as payablePolicyAssignmentQueryOptions };
@@ -7,20 +7,37 @@ import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/with
7
7
  import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../../shared/data-access/dist/index.js";
10
- import { useQueries as i } from "@tanstack/react-query";
10
+ import { payableOcrQueryOptions as i } from "../../../data-access/dist/lib/payableOcrQueryOptions.js";
11
+ import "../../../data-access/dist/invalidation.js";
12
+ import { payablePolicyAssignmentQueryOptions as a } from "./index23.js";
13
+ import { useQuery as o } from "@tanstack/react-query";
11
14
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js
12
- function a(a, { enabled: o = !0 } = {}) {
13
- let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = !!(c && l) && o, p = r(c);
14
- return i({ queries: a.map((n) => ({
15
- ...t(e({
16
- client: s,
17
- headers: p,
18
- path: { payable_id: n }
19
- }), {
20
- authEpoch: u,
21
- organizationStatus: d
15
+ function s(s, { enabled: c = !0, pollWhileOcrProcessing: l = !1, pollWhilePolicyAssignmentUnsettled: u = !1 } = {}) {
16
+ let { client: d, organizationId: f, widgetToken: p, authEpoch: m, organizationStatus: h } = n(), g = !!(f && p && s) && c, _ = l ? i({
17
+ client: d,
18
+ organizationId: f,
19
+ payableId: s ?? ""
20
+ }) : void 0, v = u ? a({
21
+ client: d,
22
+ organizationId: f,
23
+ payableId: s ?? ""
24
+ }) : void 0, y = _ ?? v ?? e({
25
+ client: d,
26
+ headers: r(f),
27
+ path: { payable_id: s ?? "" }
28
+ }), b = _ && v ? {
29
+ ...y,
30
+ refetchInterval: (e) => {
31
+ let t = [_.refetchInterval(e), v.refetchInterval(e)].filter((e) => e !== !1);
32
+ return t.length ? Math.min(...t) : !1;
33
+ }
34
+ } : y;
35
+ return o({
36
+ ...t(b, {
37
+ authEpoch: m,
38
+ organizationStatus: h
22
39
  }),
23
- enabled: f
24
- })) });
40
+ enabled: g
41
+ });
25
42
  }
26
- export { a as usePayablesByIdsQueries };
43
+ export { s as usePayableQuery };
@@ -1,2 +1,26 @@
1
- import "./index23.js";
2
- import "./index24.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getPayablesIdOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
+ import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useQueries as i } from "@tanstack/react-query";
11
+ // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js
12
+ function a(a, { enabled: o = !0 } = {}) {
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationStatus: d } = n(), f = !!(c && l) && o, p = r(c);
14
+ return i({ queries: a.map((n) => ({
15
+ ...t(e({
16
+ client: s,
17
+ headers: p,
18
+ path: { payable_id: n }
19
+ }), {
20
+ authEpoch: u,
21
+ organizationStatus: d
22
+ }),
23
+ enabled: f
24
+ })) });
25
+ }
26
+ export { a as usePayablesByIdsQueries };
@@ -0,0 +1,2 @@
1
+ import "./index24.js";
2
+ import "./index25.js";
@@ -2,31 +2,101 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getPayablesIdHistoryOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
- import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
5
+ import { postApprovalRequestsIdApprove as e, postApprovalRequestsIdReject as t } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getApprovalRequestsOptions as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
10
  import "../../../../shared/data-access/dist/index.js";
10
- import { useQuery as i } from "@tanstack/react-query";
11
+ import { NEWEST_REQUEST_FIRST as o, PAYABLE_OBJECT_TYPE as s } from "../../../data-access/dist/lib/queryKeys.js";
12
+ import { invalidateApprovalDecisionQueries as c, reconcileApprovalDecisionQueries as l } from "../../../data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js";
13
+ import { beginApprovalRequestWatch as u } from "../../../data-access/dist/lib/invalidatePayableQueries/approvalRequestWatch.js";
14
+ import { APPROVAL_REQUEST_POLL_TIMEOUT_MS as d } from "../../../data-access/dist/lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js";
15
+ import "../../../data-access/dist/index.js";
16
+ import "../../../data-access/dist/invalidation.js";
17
+ import { useState as f } from "react";
18
+ import { useMutation as p, useQuery as m } from "@tanstack/react-query";
11
19
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js
12
- var a = 100;
13
- function o(o, { enabled: s } = {}) {
14
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s !== !1, m = e({
15
- client: c,
16
- headers: r(l),
17
- path: { payable_id: o ?? "" },
20
+ var h = 5e3, g = 3e4;
21
+ function _(e, { enabled: t, hasAwaitedRequest: c, currentRoundStartedAt: l } = {}) {
22
+ let { client: u, organizationId: p, widgetToken: _, authEpoch: v, organizationStatus: y } = i(), [b] = f(() => Date.now()), x = Math.max(l ? Date.parse(l) : b, b) + d, S = !!(p && _ && e) && t !== !1, C = n({
23
+ client: u,
24
+ headers: a(p),
18
25
  query: {
19
- sort: "timestamp",
20
- order: "asc",
21
- limit: a
26
+ object_id: e ?? "",
27
+ object_type: s,
28
+ order: o
22
29
  }
23
30
  });
24
- return i({
25
- ...t(m, {
26
- authEpoch: d,
27
- organizationStatus: f
31
+ return m({
32
+ ...r(C, {
33
+ authEpoch: v,
34
+ organizationStatus: y
28
35
  }),
29
- enabled: p
36
+ enabled: S,
37
+ refetchInterval: (e) => !c || c(e.state.data?.data ?? []) ? !1 : Date.now() < x ? h : g
30
38
  });
31
39
  }
32
- export { o as usePayableHistoryQuery };
40
+ async function v({ client: e, organizationId: t, payableId: n, requestStatus: r }) {
41
+ let i = n && r !== "waiting" && n ? await u({
42
+ client: e,
43
+ organizationId: t,
44
+ payableId: n
45
+ }) : void 0;
46
+ await c({
47
+ client: e,
48
+ organizationId: t,
49
+ payableId: n
50
+ }), n && i && l({
51
+ client: e,
52
+ organizationId: t,
53
+ payableId: n,
54
+ watch: i
55
+ }).catch(() => {});
56
+ }
57
+ function y() {
58
+ let { client: t, organizationId: n } = i();
59
+ return p({
60
+ mutationFn: async ({ path: r }) => {
61
+ let { data: i } = await e({
62
+ client: t,
63
+ headers: a(n),
64
+ path: r,
65
+ throwOnError: !0
66
+ });
67
+ return i;
68
+ },
69
+ onSuccess: async (e) => {
70
+ await v({
71
+ client: t,
72
+ organizationId: n,
73
+ payableId: e?.object_id,
74
+ requestStatus: e?.status
75
+ });
76
+ }
77
+ });
78
+ }
79
+ function b() {
80
+ let { client: e, organizationId: n } = i();
81
+ return p({
82
+ mutationFn: async ({ path: r, body: i }) => {
83
+ let { data: o } = await t({
84
+ client: e,
85
+ headers: a(n),
86
+ path: r,
87
+ body: i?.reject_reason ? i : void 0,
88
+ throwOnError: !0
89
+ });
90
+ return o;
91
+ },
92
+ onSuccess: async (t) => {
93
+ await v({
94
+ client: e,
95
+ organizationId: n,
96
+ payableId: t?.object_id,
97
+ requestStatus: t?.status
98
+ });
99
+ }
100
+ });
101
+ }
102
+ export { y as useApprovePayableApprovalRequestMutation, _ as usePayableApprovalRequestsQuery, b as useRejectPayableApprovalRequestMutation };
@@ -1,10 +1,32 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getPayablesIdHistoryOptions as e } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
7
+ import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as r } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
9
+ import "../../../../shared/data-access/dist/index.js";
10
+ import { useQuery as i } from "@tanstack/react-query";
1
11
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js
2
- async function e(e) {
3
- let { data: t, error: n, response: r } = await e;
4
- if (n === void 0) return t;
5
- throw r && typeof n == "object" && n ? {
6
- ...n,
7
- status: r.status
8
- } : n;
12
+ var a = 100;
13
+ function o(o, { enabled: s } = {}) {
14
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d, organizationStatus: f } = n(), p = !!(l && u && o) && s !== !1, m = e({
15
+ client: c,
16
+ headers: r(l),
17
+ path: { payable_id: o ?? "" },
18
+ query: {
19
+ sort: "timestamp",
20
+ order: "asc",
21
+ limit: a
22
+ }
23
+ });
24
+ return i({
25
+ ...t(m, {
26
+ authEpoch: d,
27
+ organizationStatus: f
28
+ }),
29
+ enabled: p
30
+ });
9
31
  }
10
- export { e as dataOrThrowWithStatus };
32
+ export { o as usePayableHistoryQuery };
@@ -1,76 +1,10 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { getPayablesIdLineItems as e, putPayablesIdLineItems as t } from "../../../../shared/data-access/dist/lib/rest/sdk.gen.js";
6
- import { getPayablesIdLineItemsOptions as n } from "../../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
- import { withAuthEpochInfinite as r } from "../../../../shared/data-access/dist/lib/withAuthEpoch.js";
8
- import { useEmbedApi as i } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
9
- import { organizationHeaders as a } from "../../../../shared/data-access/dist/lib/organizationHeaders.js";
10
- import { getAllPagesNextPaginationTokenParam as o, isAllPagesResolving as s, useAutoFetchNextPage as c } from "../../../../shared/data-access/dist/lib/allPages.js";
11
- import "../../../../shared/data-access/dist/index.js";
12
- import { invalidatePayableQueries as l } from "../../../data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js";
13
- import "../../../data-access/dist/invalidation.js";
14
- import { dataOrThrowWithStatus as u } from "./index4.js";
15
- import { useMemo as d } from "react";
16
- import { useInfiniteQuery as f, useMutation as p } from "@tanstack/react-query";
17
1
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js
18
- var m = 100;
19
- function h(t, { enabled: l } = {}) {
20
- let { client: u, organizationId: p, widgetToken: h, authEpoch: g, organizationStatus: _ } = i(), v = a(p), y = !!(p && h && t) && l !== !1, b = n({
21
- client: u,
22
- headers: v,
23
- path: { payable_id: t ?? "" },
24
- query: { limit: m }
25
- }), x = f({
26
- ...r(b.queryKey, {
27
- authEpoch: g,
28
- organizationStatus: _
29
- }, { suffix: ["all"] }),
30
- enabled: y,
31
- initialPageParam: void 0,
32
- queryFn: async ({ signal: n, pageParam: r }) => {
33
- let { data: i } = await e({
34
- client: u,
35
- headers: v,
36
- path: { payable_id: t ?? "" },
37
- query: {
38
- limit: m,
39
- ...r ? { pagination_token: r } : {}
40
- },
41
- signal: n,
42
- throwOnError: !0
43
- });
44
- return i;
45
- },
46
- getNextPageParam: o
47
- });
48
- c(x, y);
49
- let S = d(() => x.data?.pages.flatMap((e) => e.data ?? []) ?? [], [x.data]);
50
- return {
51
- ...x,
52
- lineItems: S,
53
- isResolving: s(x)
54
- };
2
+ async function e(e) {
3
+ let { data: t, error: n, response: r } = await e;
4
+ if (n === void 0) return t;
5
+ throw r && typeof n == "object" && n ? {
6
+ ...n,
7
+ status: r.status
8
+ } : n;
55
9
  }
56
- function g() {
57
- let { client: e, organizationId: n } = i();
58
- return p({
59
- mutationFn: async ({ path: r, body: i }) => u(t({
60
- client: e,
61
- headers: a(n),
62
- path: r,
63
- body: i,
64
- throwOnError: !1
65
- })),
66
- onSuccess: async (t, r) => {
67
- await l({
68
- client: e,
69
- organizationId: n,
70
- payableId: r.path.payable_id,
71
- includeLineItems: !0
72
- });
73
- }
74
- });
75
- }
76
- export { h as useAllPayableLineItemsQuery, g as useReplacePayableLineItemsMutation };
10
+ export { e as dataOrThrowWithStatus };