@tesouro/embedded-components-react 0.3.37 → 0.3.39

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 (21) hide show
  1. package/dist/index.d.ts +16 -0
  2. package/dist/lib/CardDetailsWidget.d.ts +16 -0
  3. package/dist/lib/CardsWidget.d.ts +16 -0
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +59 -48
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +2 -2
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +163 -51
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +39 -20
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +5 -0
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +1 -0
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +1 -0
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +156 -138
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +19 -8
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +31 -15
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +12 -1
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -0
  17. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +151 -124
  18. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +3 -0
  19. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +23 -23
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -456,6 +456,11 @@ type CreditCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
456
456
  type CreditCardType = 'DIGITAL' | 'PHYSICAL';
457
457
  type DisclosureRequirement = 'NOT_REQUIRED' | 'REQUIRED';
458
458
  type OrganizationType = 'BANK' | 'EMBEDDED' | 'PLATFORM' | 'TRANSACTOR' | 'VERTICAL_SOFTWARE_PROVIDER';
459
+ /**
460
+ * The rolling period a velocity control's amount and usage limits are evaluated over.
461
+ * `TRANSACTION` applies the limit per-transaction and therefore carries no usage limit.
462
+ */
463
+ type VelocityWindow = 'DAY' | 'LIFETIME' | 'MONTH' | 'TRANSACTION' | 'WEEK';
459
464
  type WidgetInitResponse = {
460
465
  bankName?: null | string;
461
466
  /**
@@ -2160,7 +2165,11 @@ interface CardDetailsFieldLabels {
2160
2165
  cardholder: string;
2161
2166
  nickname: string;
2162
2167
  billingAddress: string;
2168
+ /** Sub-header over the merchant categories / velocity control rows. */
2169
+ cardControlsHeading: string;
2163
2170
  allowedCategories: string;
2171
+ spendLimit: string;
2172
+ perTransactionMax: string;
2164
2173
  /** Stands in for a row whose value the card does not carry. */
2165
2174
  emptyValue: string;
2166
2175
  copyCardholderAriaLabel: string;
@@ -2256,6 +2265,13 @@ interface CardDetailsFeatureLabels {
2256
2265
  statusLabels: Record<CardStatus, string>;
2257
2266
  /** Form-factor subtitle wording, keyed on the generated card type. */
2258
2267
  formFactorLabels: Record<CardType, string>;
2268
+ /**
2269
+ * A velocity control's reset-period wording, keyed on the generated
2270
+ * `velocityWindow`. Used to build the spend limit row, e.g. "$500 / month".
2271
+ * `TRANSACTION` is unused there (it drives the separate per-transaction max
2272
+ * row instead) but is still a real enum member, so it stays in the map.
2273
+ */
2274
+ velocityWindowLabels: Record<VelocityWindow, string>;
2259
2275
  }
2260
2276
 
2261
2277
  interface CardDetailsWidgetProps extends WidgetProviderProps {
@@ -21,7 +21,11 @@ interface CardDetailsFieldLabels {
21
21
  cardholder: string;
22
22
  nickname: string;
23
23
  billingAddress: string;
24
+ /** Sub-header over the merchant categories / velocity control rows. */
25
+ cardControlsHeading: string;
24
26
  allowedCategories: string;
27
+ spendLimit: string;
28
+ perTransactionMax: string;
25
29
  /** Stands in for a row whose value the card does not carry. */
26
30
  emptyValue: string;
27
31
  copyCardholderAriaLabel: string;
@@ -396,6 +400,11 @@ type ClientOptions = {
396
400
  };
397
401
  type CreditCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
398
402
  type CreditCardType = 'DIGITAL' | 'PHYSICAL';
403
+ /**
404
+ * The rolling period a velocity control's amount and usage limits are evaluated over.
405
+ * `TRANSACTION` applies the limit per-transaction and therefore carries no usage limit.
406
+ */
407
+ type VelocityWindow = 'DAY' | 'LIFETIME' | 'MONTH' | 'TRANSACTION' | 'WEEK';
399
408
 
400
409
  type EmbeddedClient = Client;
401
410
  type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
@@ -785,6 +794,13 @@ interface CardDetailsFeatureLabels {
785
794
  statusLabels: Record<CardStatus, string>;
786
795
  /** Form-factor subtitle wording, keyed on the generated card type. */
787
796
  formFactorLabels: Record<CardType, string>;
797
+ /**
798
+ * A velocity control's reset-period wording, keyed on the generated
799
+ * `velocityWindow`. Used to build the spend limit row, e.g. "$500 / month".
800
+ * `TRANSACTION` is unused there (it drives the separate per-transaction max
801
+ * row instead) but is still a real enum member, so it stays in the map.
802
+ */
803
+ velocityWindowLabels: Record<VelocityWindow, string>;
788
804
  }
789
805
 
790
806
  interface CardDetailsWidgetProps extends WidgetProviderProps {
@@ -436,6 +436,11 @@ type ClientOptions = {
436
436
  };
437
437
  type CreditCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
438
438
  type CreditCardType = 'DIGITAL' | 'PHYSICAL';
439
+ /**
440
+ * The rolling period a velocity control's amount and usage limits are evaluated over.
441
+ * `TRANSACTION` applies the limit per-transaction and therefore carries no usage limit.
442
+ */
443
+ type VelocityWindow = 'DAY' | 'LIFETIME' | 'MONTH' | 'TRANSACTION' | 'WEEK';
439
444
 
440
445
  type EmbeddedClient = Client;
441
446
  type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
@@ -776,7 +781,11 @@ interface CardDetailsFieldLabels {
776
781
  cardholder: string;
777
782
  nickname: string;
778
783
  billingAddress: string;
784
+ /** Sub-header over the merchant categories / velocity control rows. */
785
+ cardControlsHeading: string;
779
786
  allowedCategories: string;
787
+ spendLimit: string;
788
+ perTransactionMax: string;
780
789
  /** Stands in for a row whose value the card does not carry. */
781
790
  emptyValue: string;
782
791
  copyCardholderAriaLabel: string;
@@ -872,6 +881,13 @@ interface CardDetailsFeatureLabels {
872
881
  statusLabels: Record<CardStatus, string>;
873
882
  /** Form-factor subtitle wording, keyed on the generated card type. */
874
883
  formFactorLabels: Record<CardType, string>;
884
+ /**
885
+ * A velocity control's reset-period wording, keyed on the generated
886
+ * `velocityWindow`. Used to build the spend limit row, e.g. "$500 / month".
887
+ * `TRANSACTION` is unused there (it drives the separate per-transaction max
888
+ * row instead) but is still a real enum member, so it stays in the map.
889
+ */
890
+ velocityWindowLabels: Record<VelocityWindow, string>;
875
891
  }
876
892
 
877
893
  interface CardDetailsWidgetProps extends WidgetProviderProps {
@@ -6,12 +6,12 @@ import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiC
6
6
  import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
7
7
  import { deletePayablesId as n, deletePayablesIdFile as r, patchPayablesId as i, postPayables as a, postPayablesIdApprovePaymentOperation as o, postPayablesIdAttachFile as s, postPayablesIdCancel as c, postPayablesIdMarkAsPaid as l, postPayablesIdReject as u, postPayablesIdReopen as d, postPayablesIdSubmitForApproval as f, postPayablesIdValidate as p, postPayablesUploadFromFile as m, postPaymentIntentsIdCancel as h } from "../../../shared/data-access/dist/lib/rest/sdk.gen.js";
8
8
  import "../../../shared/data-access/dist/index.js";
9
- import { invalidateDeletedPayableQueries as g, invalidatePayableQueries as _, reconcileCancelledPaymentQueries as v } from "./index5.js";
10
- import { useMutation as y } from "@tanstack/react-query";
9
+ import { beginApprovalRequestWatch as g, invalidateDeletedPayableQueries as _, invalidatePayableQueries as v, reconcileCancelledPaymentQueries as y, reconcileSubmittedForApprovalQueries as b } from "./index5.js";
10
+ import { useMutation as x } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js
12
- function b() {
12
+ function S() {
13
13
  let { client: n, organizationId: r } = e();
14
- return y({
14
+ return x({
15
15
  mutationFn: async ({ body: e }) => {
16
16
  let { data: i } = await a({
17
17
  client: n,
@@ -22,16 +22,16 @@ function b() {
22
22
  return i;
23
23
  },
24
24
  onSuccess: async () => {
25
- await _({
25
+ await v({
26
26
  client: n,
27
27
  organizationId: r
28
28
  });
29
29
  }
30
30
  });
31
31
  }
32
- function x() {
32
+ function C() {
33
33
  let { client: n, organizationId: r } = e();
34
- return y({
34
+ return x({
35
35
  mutationFn: async ({ path: e, body: a }) => {
36
36
  let { data: o } = await i({
37
37
  client: n,
@@ -43,7 +43,7 @@ function x() {
43
43
  return o;
44
44
  },
45
45
  onSuccess: async (e, t) => {
46
- await _({
46
+ await v({
47
47
  client: n,
48
48
  organizationId: r,
49
49
  payableId: t.path.payable_id
@@ -51,9 +51,9 @@ function x() {
51
51
  }
52
52
  });
53
53
  }
54
- function S() {
54
+ function w() {
55
55
  let { client: r, organizationId: i } = e();
56
- return y({
56
+ return x({
57
57
  mutationFn: async ({ path: e }) => {
58
58
  await n({
59
59
  client: r,
@@ -63,7 +63,7 @@ function S() {
63
63
  });
64
64
  },
65
65
  onSuccess: async (e, t) => {
66
- await g({
66
+ await _({
67
67
  client: r,
68
68
  organizationId: i,
69
69
  payableId: t.path.payable_id
@@ -71,9 +71,9 @@ function S() {
71
71
  }
72
72
  });
73
73
  }
74
- function C() {
74
+ function T() {
75
75
  let { client: n, organizationId: r } = e();
76
- return y({
76
+ return x({
77
77
  mutationFn: async ({ file: e }) => {
78
78
  let { data: a } = await m({
79
79
  client: n,
@@ -96,16 +96,16 @@ function C() {
96
96
  return a;
97
97
  },
98
98
  onSuccess: async () => {
99
- await _({
99
+ await v({
100
100
  client: n,
101
101
  organizationId: r
102
102
  });
103
103
  }
104
104
  });
105
105
  }
106
- function w() {
106
+ function E() {
107
107
  let { client: n, organizationId: r } = e();
108
- return y({
108
+ return x({
109
109
  mutationFn: async ({ path: e, file: i }) => {
110
110
  let { data: a } = await s({
111
111
  client: n,
@@ -117,7 +117,7 @@ function w() {
117
117
  return a;
118
118
  },
119
119
  onSuccess: async (e, t) => {
120
- await _({
120
+ await v({
121
121
  client: n,
122
122
  organizationId: r,
123
123
  payableId: t.path.payable_id
@@ -125,9 +125,9 @@ function w() {
125
125
  }
126
126
  });
127
127
  }
128
- function T() {
128
+ function D() {
129
129
  let { client: n, organizationId: i } = e();
130
- return y({
130
+ return x({
131
131
  mutationFn: async ({ path: e }) => {
132
132
  await r({
133
133
  client: n,
@@ -137,7 +137,7 @@ function T() {
137
137
  });
138
138
  },
139
139
  onSuccess: async (e, t) => {
140
- await _({
140
+ await v({
141
141
  client: n,
142
142
  organizationId: i,
143
143
  payableId: t.path.payable_id
@@ -145,9 +145,9 @@ function T() {
145
145
  }
146
146
  });
147
147
  }
148
- function E() {
148
+ function O() {
149
149
  let { client: n, organizationId: r } = e();
150
- return y({ mutationFn: async ({ path: e }) => {
150
+ return x({ mutationFn: async ({ path: e }) => {
151
151
  let { data: i } = await p({
152
152
  client: n,
153
153
  headers: t(r),
@@ -160,9 +160,14 @@ function E() {
160
160
  };
161
161
  } });
162
162
  }
163
- function D() {
163
+ function k() {
164
164
  let { client: n, organizationId: r } = e();
165
- return y({
165
+ return x({
166
+ onMutate: async ({ path: e }) => g({
167
+ client: n,
168
+ organizationId: r,
169
+ payableId: e.payable_id
170
+ }, { requireRoundMarker: !0 }),
166
171
  mutationFn: async ({ path: e }) => {
167
172
  let { data: i } = await f({
168
173
  client: n,
@@ -172,19 +177,25 @@ function D() {
172
177
  });
173
178
  return i;
174
179
  },
175
- onSuccess: async (e, t) => {
176
- await _({
180
+ onSuccess: async (e, t, i) => {
181
+ let a = t.path.payable_id, o = e?.status === "approve_in_progress";
182
+ await v({
177
183
  client: n,
178
184
  organizationId: r,
179
- payableId: t.path.payable_id,
185
+ payableId: a,
180
186
  includeApprovalRequests: !0
181
- });
187
+ }), !(!o || !i) && b({
188
+ client: n,
189
+ organizationId: r,
190
+ payableId: a,
191
+ watch: i
192
+ }).catch(() => {});
182
193
  }
183
194
  });
184
195
  }
185
- function O() {
196
+ function A() {
186
197
  let { client: n, organizationId: r } = e();
187
- return y({
198
+ return x({
188
199
  mutationFn: async ({ path: e }) => {
189
200
  let { data: i } = await o({
190
201
  client: n,
@@ -195,7 +206,7 @@ function O() {
195
206
  return i;
196
207
  },
197
208
  onSuccess: async (e, t) => {
198
- await _({
209
+ await v({
199
210
  client: n,
200
211
  organizationId: r,
201
212
  payableId: t.path.payable_id,
@@ -204,9 +215,9 @@ function O() {
204
215
  }
205
216
  });
206
217
  }
207
- function k() {
218
+ function j() {
208
219
  let { client: n, organizationId: r } = e();
209
- return y({
220
+ return x({
210
221
  mutationFn: async ({ path: e }) => {
211
222
  let { data: i } = await u({
212
223
  client: n,
@@ -217,7 +228,7 @@ function k() {
217
228
  return i;
218
229
  },
219
230
  onSuccess: async (e, t) => {
220
- await _({
231
+ await v({
221
232
  client: n,
222
233
  organizationId: r,
223
234
  payableId: t.path.payable_id,
@@ -226,9 +237,9 @@ function k() {
226
237
  }
227
238
  });
228
239
  }
229
- function A() {
240
+ function M() {
230
241
  let { client: n, organizationId: r } = e();
231
- return y({
242
+ return x({
232
243
  mutationFn: async ({ path: e }) => {
233
244
  let { data: i } = await c({
234
245
  client: n,
@@ -239,7 +250,7 @@ function A() {
239
250
  return i;
240
251
  },
241
252
  onSuccess: async (e, t) => {
242
- await _({
253
+ await v({
243
254
  client: n,
244
255
  organizationId: r,
245
256
  payableId: t.path.payable_id
@@ -247,9 +258,9 @@ function A() {
247
258
  }
248
259
  });
249
260
  }
250
- function j() {
261
+ function N() {
251
262
  let { client: n, organizationId: r } = e();
252
- return y({
263
+ return x({
253
264
  mutationFn: async ({ path: e }) => {
254
265
  let { data: i } = await h({
255
266
  client: n,
@@ -260,11 +271,11 @@ function j() {
260
271
  return i;
261
272
  },
262
273
  onSuccess: async (e, t) => {
263
- await _({
274
+ await v({
264
275
  client: n,
265
276
  organizationId: r,
266
277
  payableId: t.payableId
267
- }), v({
278
+ }), y({
268
279
  client: n,
269
280
  organizationId: r,
270
281
  payableId: t.payableId
@@ -272,9 +283,9 @@ function j() {
272
283
  }
273
284
  });
274
285
  }
275
- function M() {
286
+ function P() {
276
287
  let { client: n, organizationId: r } = e();
277
- return y({
288
+ return x({
278
289
  mutationFn: async ({ path: e }) => {
279
290
  let { data: i } = await d({
280
291
  client: n,
@@ -285,7 +296,7 @@ function M() {
285
296
  return i;
286
297
  },
287
298
  onSuccess: async (e, t) => {
288
- await _({
299
+ await v({
289
300
  client: n,
290
301
  organizationId: r,
291
302
  payableId: t.path.payable_id
@@ -293,9 +304,9 @@ function M() {
293
304
  }
294
305
  });
295
306
  }
296
- function N() {
307
+ function F() {
297
308
  let { client: n, organizationId: r } = e();
298
- return y({
309
+ return x({
299
310
  mutationFn: async ({ path: e, body: i }) => {
300
311
  let { data: a } = await l({
301
312
  client: n,
@@ -307,7 +318,7 @@ function N() {
307
318
  return a;
308
319
  },
309
320
  onSuccess: async (e, t) => {
310
- await _({
321
+ await v({
311
322
  client: n,
312
323
  organizationId: r,
313
324
  payableId: t.path.payable_id
@@ -316,4 +327,4 @@ function N() {
316
327
  });
317
328
  }
318
329
  //#endregion
319
- export { w as useAttachPayableFileMutation, A as useCancelPayableMutation, j as useCancelScheduledPaymentMutation, b as useCreatePayableMutation, T as useDeletePayableFileMutation, S as useDeletePayableMutation, O as useForceApprovePayableMutation, k as useForceRejectPayableMutation, N as useMarkPayableAsPaidMutation, M as useReopenPayableMutation, D as useSubmitPayableForApprovalMutation, x as useUpdatePayableMutation, C as useUploadPayableFromFileMutation, E as useValidatePayableMutation };
330
+ export { E as useAttachPayableFileMutation, M as useCancelPayableMutation, N as useCancelScheduledPaymentMutation, S as useCreatePayableMutation, D as useDeletePayableFileMutation, w as useDeletePayableMutation, A as useForceApprovePayableMutation, j as useForceRejectPayableMutation, F as useMarkPayableAsPaidMutation, P as useReopenPayableMutation, k as useSubmitPayableForApprovalMutation, C as useUpdatePayableMutation, T as useUploadPayableFromFileMutation, O as useValidatePayableMutation };
@@ -26,6 +26,6 @@ var c = ({ client: t, organizationId: n }) => o({
26
26
  }), m = ({ client: t, organizationId: n }) => s({
27
27
  client: t,
28
28
  headers: e(n)
29
- });
29
+ }), h = "payable", g = "desc";
30
30
  //#endregion
31
- export { l as approvalRequestsInvalidationKey, f as payableHistoryInvalidationKey, d as payableInvalidationKey, p as payableLineItemsInvalidationKey, m as payablePaymentRecordsInvalidationKey, u as payablesAnalyticsInvalidationKey, c as payablesInvalidationKey };
31
+ export { g as NEWEST_REQUEST_FIRST, h as PAYABLE_OBJECT_TYPE, l as approvalRequestsInvalidationKey, f as payableHistoryInvalidationKey, d as payableInvalidationKey, p as payableLineItemsInvalidationKey, m as payablePaymentRecordsInvalidationKey, u as payablesAnalyticsInvalidationKey, c as payablesInvalidationKey };