@tesouro/embedded-components-react 0.3.49 → 0.3.51

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 (144) hide show
  1. package/dist/index.css +8 -2
  2. package/dist/index.js +2 -2
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/lib/LinkedAccountsWidget.js +1 -1
  5. package/dist/libs/shared/util-validation/dist/{index22.js → index23.js} +1 -1
  6. package/dist/libs/shared/util-validation/dist/index7.js +6 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +11 -10
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +39 -30
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +26 -311
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index12.js +325 -12
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +13 -26
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +20 -40
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +75 -24
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +36 -0
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +80 -68
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +86 -73
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +77 -14
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +18 -63
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +50 -29
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +22 -18
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +82 -30
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -42
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +15 -159
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +23 -33
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +66 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +2 -50
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +3 -4
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +5 -14
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -14
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +31 -63
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +23 -18
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +37 -24
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +161 -61
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +29 -130
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +1 -25
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +47 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +4 -41
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +12 -55
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -4
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +63 -72
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +26 -49
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +23 -23
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +62 -93
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +133 -34
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +20 -163
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +4 -77
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +39 -21
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +5 -210
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +70 -211
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +47 -103
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +92 -12
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +34 -47
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +59 -62
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +163 -29
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +67 -181
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +20 -32
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +203 -94
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +214 -15
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +98 -312
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +16 -4
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +49 -31
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +29 -80
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +183 -156
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +9 -2
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +38 -3
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +102 -2
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +18 -44
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +343 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +4 -8
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -8
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +79 -88
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +179 -3
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +3 -9
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +2 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +4 -2
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -51
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -2
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +6 -126
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +9 -9
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +92 -44
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -23
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +123 -26
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +7 -82
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -48
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +45 -250
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +69 -5
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +21 -113
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +27 -208
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +86 -4
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +47 -5
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +244 -106
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +115 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +201 -16
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +4 -0
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +8 -0
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +115 -0
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +44 -5
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +1 -0
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +25 -0
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +94 -3
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -19
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +1 -0
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +28 -28
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -3
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -16
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +119 -16
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +24 -111
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +89 -2
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +2 -7
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +5 -28
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +30 -2
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +2 -7
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +5 -32
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +34 -2
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -12
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +10 -104
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +105 -1
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -17
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +15 -123
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +125 -2
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -18
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +14 -6
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +7 -167
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +170 -2
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +2 -14
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +11 -105
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +108 -2
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +2 -10
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +8 -45
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +47 -2
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +2 -0
  132. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index8.js +95 -94
  133. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index.js +1 -1
  134. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index10.js +45 -0
  135. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index7.js +18 -55
  136. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index8.js +46 -265
  137. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +273 -34
  138. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApproverOptions.js +1 -1
  139. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
  140. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +87 -71
  141. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  142. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index11.js +1 -1
  143. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  144. package/package.json +1 -1
@@ -5,44 +5,56 @@ import "../../../shared/data-access/dist/index.js";
5
5
  import { isLiveScheduledPaymentRecord as c } from "./index3.js";
6
6
  import { NEWEST_REQUEST_FIRST as l, PAYABLE_OBJECT_TYPE as u, approvalRequestsInvalidationKey as d, payableHistoryInvalidationKey as f, payableInvalidationKey as p, payableLineItemsInvalidationKey as m, payablePaymentRecordsInvalidationKey as h, payablesAnalyticsInvalidationKey as g, payablesInvalidationKey as _ } from "./index4.js";
7
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js
8
- async function v({ client: e, organizationId: n, payableId: r, includeLineItems: i, includeApprovalRequests: a }) {
9
- let o = {
8
+ async function v({ client: e, organizationId: n, payableId: r, payableIds: i, deletedPayableIds: a, includeLineItems: o, includeApprovalRequests: s }) {
9
+ let c = {
10
10
  client: e,
11
11
  organizationId: n
12
- }, s = r ? {
13
- ...o,
14
- payableId: r
15
- } : void 0, c = [
16
- _(o),
17
- g(o),
18
- ...a ? [d(o)] : [],
19
- ...s ? [
20
- p(s),
21
- f(s),
22
- h(s)
23
- ] : [],
24
- ...s && i ? [m(s)] : []
12
+ }, l = new Set(a ?? []), u = [.../* @__PURE__ */ new Set([...i ?? [], r])].filter((e) => !!e && !l.has(e)).map((e) => ({
13
+ ...c,
14
+ payableId: e
15
+ })), v = [
16
+ _(c),
17
+ g(c),
18
+ ...s ? [d(c)] : [],
19
+ ...u.flatMap((e) => [
20
+ p(e),
21
+ f(e),
22
+ h(e),
23
+ ...o ? [m(e)] : []
24
+ ])
25
25
  ];
26
- await Promise.all(c.map((e) => t(e)));
26
+ await Promise.all(v.map((e) => t(e))), await Promise.all([...l].map((t) => y({
27
+ client: e,
28
+ organizationId: n,
29
+ payableId: t
30
+ })));
27
31
  }
28
- async function y({ client: r, organizationId: i, payableId: a }) {
29
- let o = {
30
- client: r,
31
- organizationId: i
32
- };
33
- if (await Promise.all([t(_(o)), t(g(o))]), !a) return;
34
- let s = {
35
- ...o,
36
- payableId: a
37
- }, c = [
38
- p(s),
39
- f(s),
40
- m(s)
32
+ async function y({ client: t, organizationId: r, payableId: i }) {
33
+ if (!i) return;
34
+ let a = {
35
+ client: t,
36
+ organizationId: r,
37
+ payableId: i
38
+ }, o = [
39
+ p(a),
40
+ f(a),
41
+ m(a)
41
42
  ];
42
- await Promise.all(c.map((t) => e(t))), c.forEach((e) => n(e));
43
+ await Promise.all(o.map((t) => e(t))), o.forEach((e) => n(e));
44
+ }
45
+ async function b({ client: e, organizationId: n, payableId: r }) {
46
+ let i = {
47
+ client: e,
48
+ organizationId: n
49
+ };
50
+ await Promise.all([t(_(i)), t(g(i))]), await y({
51
+ client: e,
52
+ organizationId: n,
53
+ payableId: r
54
+ });
43
55
  }
44
- var b = 2e4, x = 1e3, S = 1.5, C = 5e3, w = (e) => Math.min(e * S, C), T = /* @__PURE__ */ new Set(["new", "approve_in_progress"]), E = 6e4;
45
- async function D({ client: e, organizationId: n, payableId: r }) {
56
+ var x = 2e4, S = 1e3, C = 1.5, w = 5e3, T = (e) => Math.min(e * C, w), E = /* @__PURE__ */ new Set(["new", "approve_in_progress"]), D = 6e4;
57
+ async function O({ client: e, organizationId: n, payableId: r }) {
46
58
  await t(d({
47
59
  client: e,
48
60
  organizationId: n
@@ -52,8 +64,8 @@ async function D({ client: e, organizationId: n, payableId: r }) {
52
64
  payableId: r
53
65
  });
54
66
  }
55
- var O = 100;
56
- async function k({ client: e, organizationId: t, payableId: n }) {
67
+ var k = 100;
68
+ async function A({ client: e, organizationId: t, payableId: n }) {
57
69
  try {
58
70
  let { data: a } = await i({
59
71
  client: e,
@@ -62,7 +74,7 @@ async function k({ client: e, organizationId: t, payableId: n }) {
62
74
  object_id: n,
63
75
  object_type: u,
64
76
  order: l,
65
- limit: O
77
+ limit: k
66
78
  }
67
79
  });
68
80
  return (a?.data ?? []).map((e) => `${e.id}:${e.status}`).sort().join(",");
@@ -70,19 +82,19 @@ async function k({ client: e, organizationId: t, payableId: n }) {
70
82
  return;
71
83
  }
72
84
  }
73
- var A = 3, j = 250;
74
- async function M(e) {
85
+ var j = 3, M = 250;
86
+ async function N(e) {
75
87
  let t = 0;
76
88
  for (;;) {
77
- let n = await F(e);
78
- if (t += 1, n.readable || t >= A) return n;
89
+ let n = await I(e);
90
+ if (t += 1, n.readable || t >= j) return n;
79
91
  await new Promise((e) => {
80
- setTimeout(e, j * t);
92
+ setTimeout(e, M * t);
81
93
  });
82
94
  }
83
95
  }
84
- var N = "submitted_for_approval", P = 100;
85
- async function F({ client: e, organizationId: t, payableId: n }) {
96
+ var P = "submitted_for_approval", F = 100;
97
+ async function I({ client: e, organizationId: t, payableId: n }) {
86
98
  try {
87
99
  let { data: i } = await o({
88
100
  client: e,
@@ -91,41 +103,41 @@ async function F({ client: e, organizationId: t, payableId: n }) {
91
103
  query: {
92
104
  sort: "timestamp",
93
105
  order: "asc",
94
- limit: P
106
+ limit: F
95
107
  }
96
108
  });
97
109
  return {
98
110
  readable: !0,
99
- at: (i?.data ?? []).reduce((e, t) => t.event_type === N ? t.timestamp : e, void 0)
111
+ at: (i?.data ?? []).reduce((e, t) => t.event_type === P ? t.timestamp : e, void 0)
100
112
  };
101
113
  } catch {
102
114
  return { readable: !1 };
103
115
  }
104
116
  }
105
- async function I(e, { requireRoundMarker: t = !1 } = {}) {
106
- let [n, r] = await Promise.all([k(e), t ? M(e) : void 0]), i = n, a = async () => {
117
+ async function L(e, { requireRoundMarker: t = !1 } = {}) {
118
+ let [n, r] = await Promise.all([A(e), t ? N(e) : void 0]), i = n, a = async () => {
107
119
  if (!r?.readable) return !0;
108
- let t = await F(e);
120
+ let t = await I(e);
109
121
  return t.readable && t.at !== r.at;
110
122
  }, o = !1;
111
123
  return { async poll() {
112
- let t = await k(e);
124
+ let t = await A(e);
113
125
  return t !== void 0 && i === void 0 ? (i = t, o = !0, await a() ? "changed" : "resynced") : (t !== void 0 && t !== i && (o = !0), o && await a() ? "changed" : "unchanged");
114
126
  } };
115
127
  }
116
- async function L({ client: e, organizationId: t, payableId: n, watch: i }) {
117
- let o = Date.now() + E, s = x, c = !1;
128
+ async function R({ client: e, organizationId: t, payableId: n, watch: i }) {
129
+ let o = Date.now() + D, s = S, c = !1;
118
130
  for (; !c && Date.now() < o;) {
119
131
  await new Promise((e) => {
120
132
  setTimeout(e, s);
121
- }), s = w(s);
133
+ }), s = T(s);
122
134
  try {
123
135
  let { data: i } = await a({
124
136
  client: e,
125
137
  headers: r(t),
126
138
  path: { payable_id: n }
127
139
  });
128
- c = !!(i?.status && !T.has(i.status));
140
+ c = !!(i?.status && !E.has(i.status));
129
141
  } catch {}
130
142
  if (!c) {
131
143
  let r = await i.poll();
@@ -144,13 +156,13 @@ async function L({ client: e, organizationId: t, payableId: n, watch: i }) {
144
156
  includeApprovalRequests: !0
145
157
  }), c;
146
158
  }
147
- var R = 15e4, z = 3e3;
148
- async function B({ client: e, organizationId: t, payableId: n, watch: r }) {
149
- let i = Date.now() + R, a = z, o = !1;
159
+ var z = 15e4, B = 3e3;
160
+ async function V({ client: e, organizationId: t, payableId: n, watch: r }) {
161
+ let i = Date.now() + z, a = B, o = !1;
150
162
  for (; !o && Date.now() < i;) {
151
163
  await new Promise((e) => {
152
164
  setTimeout(e, a);
153
- }), a = w(a);
165
+ }), a = T(a);
154
166
  let i = await r.poll();
155
167
  o = i === "changed", i === "resynced" && await v({
156
168
  client: e,
@@ -166,12 +178,12 @@ async function B({ client: e, organizationId: t, payableId: n, watch: r }) {
166
178
  includeApprovalRequests: !0
167
179
  }), o;
168
180
  }
169
- var V = 100;
170
- async function H({ client: e, organizationId: t, payableId: n }) {
171
- let r = Date.now() + b, i = !1;
181
+ var H = 100;
182
+ async function U({ client: e, organizationId: t, payableId: n }) {
183
+ let r = Date.now() + x, i = !1;
172
184
  for (; !i && Date.now() < r;) await new Promise((e) => {
173
- setTimeout(e, x);
174
- }), i = await U({
185
+ setTimeout(e, S);
186
+ }), i = await W({
175
187
  client: e,
176
188
  organizationId: t,
177
189
  payableId: n
@@ -182,7 +194,7 @@ async function H({ client: e, organizationId: t, payableId: n }) {
182
194
  payableId: n
183
195
  }), i;
184
196
  }
185
- async function U({ client: e, organizationId: t, payableId: n }) {
197
+ async function W({ client: e, organizationId: t, payableId: n }) {
186
198
  let i = /* @__PURE__ */ new Set(), a;
187
199
  try {
188
200
  do {
@@ -190,7 +202,7 @@ async function U({ client: e, organizationId: t, payableId: n }) {
190
202
  client: e,
191
203
  headers: r(t),
192
204
  query: {
193
- limit: V,
205
+ limit: H,
194
206
  object_id__in: [n],
195
207
  order: "desc",
196
208
  sort: "paid_at",
@@ -207,11 +219,11 @@ async function U({ client: e, organizationId: t, payableId: n }) {
207
219
  return;
208
220
  }
209
221
  }
210
- async function W({ client: e, organizationId: t, payableId: n }) {
211
- let i = Date.now() + b, o = !1;
222
+ async function G({ client: e, organizationId: t, payableId: n }) {
223
+ let i = Date.now() + x, o = !1;
212
224
  for (; !o && Date.now() < i;) {
213
225
  await new Promise((e) => {
214
- setTimeout(e, x);
226
+ setTimeout(e, S);
215
227
  });
216
228
  try {
217
229
  let { data: i } = await a({
@@ -219,7 +231,7 @@ async function W({ client: e, organizationId: t, payableId: n }) {
219
231
  headers: r(t),
220
232
  path: { payable_id: n }
221
233
  });
222
- o = !i?.scheduled_payment_date && await U({
234
+ o = !i?.scheduled_payment_date && await W({
223
235
  client: e,
224
236
  organizationId: t,
225
237
  payableId: n
@@ -233,4 +245,4 @@ async function W({ client: e, organizationId: t, payableId: n }) {
233
245
  }), o;
234
246
  }
235
247
  //#endregion
236
- export { I as beginApprovalRequestWatch, D as invalidateApprovalDecisionQueries, y as invalidateDeletedPayableQueries, v as invalidatePayableQueries, L as reconcileApprovalDecisionQueries, W as reconcileCancelledPaymentQueries, H as reconcileScheduledPaymentQueries, B as reconcileSubmittedForApprovalQueries };
248
+ export { L as beginApprovalRequestWatch, O as invalidateApprovalDecisionQueries, b as invalidateDeletedPayableQueries, v as invalidatePayableQueries, R as reconcileApprovalDecisionQueries, G as reconcileCancelledPaymentQueries, U as reconcileScheduledPaymentQueries, V as reconcileSubmittedForApprovalQueries };
@@ -4,90 +4,103 @@
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 { postApprovalRequestsIdApprove as n, postApprovalRequestsIdReject as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
- import { getApprovalRequestsOptions 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";
7
+ import { deletePayablesId as n, postPayablesIdCancel as r, postPayablesIdDuplicatesIdConfirm as i, postPayablesIdDuplicatesIdDismiss as a } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
10
8
  import "../../../shared/data-access/dist/index.js";
11
- import { NEWEST_REQUEST_FIRST as o, PAYABLE_OBJECT_TYPE as s } from "./index4.js";
12
- import { beginApprovalRequestWatch as c, invalidateApprovalDecisionQueries as l, reconcileApprovalDecisionQueries as u } from "./index5.js";
13
- import { useMutation as d, useQuery as f } from "@tanstack/react-query";
9
+ import { invalidatePayableQueries as o } from "./index5.js";
10
+ import { useMutation as s } from "@tanstack/react-query";
14
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js
15
- function p(n, { enabled: r } = {}) {
16
- let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), p = !!(l && u && n) && r !== !1, m = i({
17
- client: c,
18
- headers: t(l),
19
- query: {
20
- object_id: n ?? "",
21
- object_type: s,
22
- order: o
23
- }
24
- });
25
- return f({
26
- ...a(m, d),
27
- enabled: p
28
- });
12
+ var c = [
13
+ "suspected",
14
+ "dismissed",
15
+ "confirmed"
16
+ ];
17
+ function l(e) {
18
+ if (typeof e != "object" || !e) return !1;
19
+ let t = e;
20
+ return typeof t.id == "string" && typeof t.matched_payable_id == "string" && c.includes(t.status);
29
21
  }
30
- async function m({ client: e, organizationId: t, payableId: n, requestStatus: r }) {
31
- let i = n && r !== "waiting" && n ? await c({
32
- client: e,
33
- organizationId: t,
34
- payableId: n
35
- }) : void 0;
36
- await l({
37
- client: e,
38
- organizationId: t,
39
- payableId: n
40
- }), !(!n || !i) && u({
41
- client: e,
42
- organizationId: t,
43
- payableId: n,
44
- watch: i
45
- }).catch(() => {});
22
+ function u(e) {
23
+ return Array.isArray(e?.duplicates) ? e.duplicates.filter(l) : [];
46
24
  }
47
- function h() {
48
- let { client: r, organizationId: i } = e();
49
- return d({
50
- mutationFn: async ({ path: e }) => {
51
- let { data: a } = await n({
52
- client: r,
53
- headers: t(i),
54
- path: e,
55
- throwOnError: !0
56
- });
57
- return a;
58
- },
59
- onSuccess: async (e) => {
60
- await m({
61
- client: r,
62
- organizationId: i,
63
- payableId: e?.object_id,
64
- requestStatus: e?.status
65
- });
66
- }
67
- });
25
+ function d(e) {
26
+ return u(e).filter((e) => e.status === "suspected");
27
+ }
28
+ function f(e) {
29
+ return d(e).length > 0;
30
+ }
31
+ var p = {
32
+ Keep: "keep",
33
+ Remove: "remove"
34
+ }, m = class extends Error {
35
+ applied;
36
+ constructor(e, t) {
37
+ super("A duplicate verdict batch failed partway through.", { cause: t }), this.name = "DuplicateVerdictBatchError", this.applied = e;
38
+ }
39
+ };
40
+ function h(e) {
41
+ return e.payableIds.length > 0 || e.deletedPayableIds.length > 0;
68
42
  }
69
43
  function g() {
70
- let { client: n, organizationId: i } = e();
71
- return d({
72
- mutationFn: async ({ path: e, body: a }) => {
73
- let { data: o } = await r({
74
- client: n,
75
- headers: t(i),
76
- path: e,
77
- body: a?.reject_reason ? a : void 0,
78
- throwOnError: !0
44
+ let { client: c, organizationId: l } = e();
45
+ return s({
46
+ mutationFn: async ({ verdict: e, targets: o }) => {
47
+ let s = t(l), u = [], d = [], f = () => o.filter((e) => e.matchedPayableId !== void 0 && d.includes(e.payableId) && !d.includes(e.matchedPayableId)).map((e) => e.matchedPayableId), h = () => ({
48
+ payableIds: [.../* @__PURE__ */ new Set([...u, ...f()])],
49
+ deletedPayableIds: [...new Set(d)]
79
50
  });
80
- return o;
51
+ try {
52
+ let t = /* @__PURE__ */ new Set();
53
+ if (e === p.Remove) {
54
+ for (let e of o) if (!t.has(e.payableId)) {
55
+ if (t.add(e.payableId), e.removeBy === "delete") {
56
+ await n({
57
+ client: c,
58
+ headers: s,
59
+ path: { payable_id: e.payableId },
60
+ throwOnError: !0
61
+ }), d.push(e.payableId);
62
+ continue;
63
+ }
64
+ e.removeBy === "cancel" && (await r({
65
+ client: c,
66
+ headers: s,
67
+ path: { payable_id: e.payableId },
68
+ throwOnError: !0
69
+ }), u.push(e.payableId));
70
+ }
71
+ }
72
+ let l = /* @__PURE__ */ new Set(), f = e === p.Remove ? i : a;
73
+ for (let e of o) l.has(e.duplicateId) || d.includes(e.payableId) || e.matchedPayableId && d.includes(e.matchedPayableId) || (l.add(e.duplicateId), await f({
74
+ client: c,
75
+ headers: s,
76
+ path: {
77
+ payable_id: e.payableId,
78
+ duplicate_id: e.duplicateId
79
+ },
80
+ throwOnError: !0
81
+ }), u.push(e.payableId), e.matchedPayableId && u.push(e.matchedPayableId));
82
+ } catch (e) {
83
+ throw new m(h(), e);
84
+ }
85
+ return h();
81
86
  },
82
87
  onSuccess: async (e) => {
83
- await m({
84
- client: n,
85
- organizationId: i,
86
- payableId: e?.object_id,
87
- requestStatus: e?.status
88
+ await o({
89
+ client: c,
90
+ organizationId: l,
91
+ payableIds: e.payableIds,
92
+ deletedPayableIds: e.deletedPayableIds
93
+ });
94
+ },
95
+ onError: async (e) => {
96
+ !(e instanceof m) || !h(e.applied) || await o({
97
+ client: c,
98
+ organizationId: l,
99
+ payableIds: e.applied.payableIds,
100
+ deletedPayableIds: e.applied.deletedPayableIds
88
101
  });
89
102
  }
90
103
  });
91
104
  }
92
105
  //#endregion
93
- export { h as useApprovePayableApprovalRequestMutation, p as usePayableApprovalRequestsQuery, g as useRejectPayableApprovalRequestMutation };
106
+ export { p as DuplicateVerdict, m as DuplicateVerdictBatchError, f as hasSuspectedPayableDuplicate, u as readPayableDuplicates, d as suspectedPayableDuplicates, g as useApplyDuplicateVerdictsMutation };
@@ -4,27 +4,90 @@
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 { 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";
7
+ import { postApprovalRequestsIdApprove as n, postApprovalRequestsIdReject as r } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
+ import { getApprovalRequestsOptions 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";
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 "./index4.js";
12
+ import { beginApprovalRequestWatch as c, invalidateApprovalDecisionQueries as l, reconcileApprovalDecisionQueries as u } from "./index5.js";
13
+ import { useMutation as d, useQuery as f } from "@tanstack/react-query";
11
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js
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
+ function p(n, { enabled: r } = {}) {
16
+ let { client: c, organizationId: l, widgetToken: u, authEpoch: d } = e(), p = !!(l && u && n) && r !== !1, m = i({
15
17
  client: c,
16
18
  headers: t(l),
17
- path: { payable_id: o ?? "" },
18
19
  query: {
19
- sort: "timestamp",
20
- order: "asc",
21
- limit: a
20
+ object_id: n ?? "",
21
+ object_type: s,
22
+ order: o
22
23
  }
23
24
  });
24
- return i({
25
- ...r(p, d),
26
- enabled: f
25
+ return f({
26
+ ...a(m, d),
27
+ enabled: p
28
+ });
29
+ }
30
+ async function m({ client: e, organizationId: t, payableId: n, requestStatus: r }) {
31
+ let i = n && r !== "waiting" && n ? await c({
32
+ client: e,
33
+ organizationId: t,
34
+ payableId: n
35
+ }) : void 0;
36
+ await l({
37
+ client: e,
38
+ organizationId: t,
39
+ payableId: n
40
+ }), !(!n || !i) && u({
41
+ client: e,
42
+ organizationId: t,
43
+ payableId: n,
44
+ watch: i
45
+ }).catch(() => {});
46
+ }
47
+ function h() {
48
+ let { client: r, organizationId: i } = e();
49
+ return d({
50
+ mutationFn: async ({ path: e }) => {
51
+ let { data: a } = await n({
52
+ client: r,
53
+ headers: t(i),
54
+ path: e,
55
+ throwOnError: !0
56
+ });
57
+ return a;
58
+ },
59
+ onSuccess: async (e) => {
60
+ await m({
61
+ client: r,
62
+ organizationId: i,
63
+ payableId: e?.object_id,
64
+ requestStatus: e?.status
65
+ });
66
+ }
67
+ });
68
+ }
69
+ function g() {
70
+ let { client: n, organizationId: i } = e();
71
+ return d({
72
+ mutationFn: async ({ path: e, body: a }) => {
73
+ let { data: o } = await r({
74
+ client: n,
75
+ headers: t(i),
76
+ path: e,
77
+ body: a?.reject_reason ? a : void 0,
78
+ throwOnError: !0
79
+ });
80
+ return o;
81
+ },
82
+ onSuccess: async (e) => {
83
+ await m({
84
+ client: n,
85
+ organizationId: i,
86
+ payableId: e?.object_id,
87
+ requestStatus: e?.status
88
+ });
89
+ }
27
90
  });
28
91
  }
29
92
  //#endregion
30
- export { o as usePayableHistoryQuery };
93
+ export { h as useApprovePayableApprovalRequestMutation, p as usePayableApprovalRequestsQuery, g as useRejectPayableApprovalRequestMutation };
@@ -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 "./index5.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/index8.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 };