@tesouro/embedded-components-react 0.5.194 → 0.5.196

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 (46) hide show
  1. package/README.md +1 -2
  2. package/dist/index.css +3 -3
  3. package/dist/index.d.ts +12 -3
  4. package/dist/index.js +1 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +12 -3
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +245 -65
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +66 -106
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +102 -223
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +225 -0
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +182 -371
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +401 -60
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +62 -193
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +184 -31
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +31 -149
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +292 -161
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +11 -3
  19. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index4.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +36 -36
  23. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +597 -604
  24. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index.js +12 -11
  26. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +16 -23
  27. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index11.js +7 -8
  28. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index12.js +17 -18
  29. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index13.js +36 -0
  30. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js +43 -16
  31. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +23 -13
  32. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index5.js +13 -30
  33. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index6.js +18 -23
  34. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index7.js +22 -16
  35. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index8.js +22 -15
  36. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +10 -11
  37. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +10 -9
  38. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +5 -5
  39. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +9 -13
  40. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +2 -2
  42. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductSelector.js +28 -41
  43. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +6 -6
  44. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +7 -15
  45. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +100 -69
  46. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.194", n = "c701023b2efd86283451811435610bda7d8aad53", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.196", n = "41a60053b91034e0be9d7320f7584ad81146cabd", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -1,12 +1,13 @@
1
1
  import { useProductsQuery as e } from "./index2.js";
2
- import { useProductQuery as t } from "./index3.js";
3
- import "./index4.js";
4
- import { useCreateProductMutation as n } from "./index5.js";
5
- import { useUpdateProductMutation as r } from "./index6.js";
6
- import { useDeleteProductMutation as i } from "./index7.js";
7
- import { useMeasureUnitsQuery as a } from "./index8.js";
8
- import { useProductsByMeasureUnitQuery as o } from "./index9.js";
9
- import { useCreateMeasureUnitMutation as s } from "./index10.js";
10
- import { useUpdateMeasureUnitMutation as c } from "./index11.js";
11
- import { useDeleteMeasureUnitMutation as l } from "./index12.js";
12
- export { s as useCreateMeasureUnitMutation, n as useCreateProductMutation, l as useDeleteMeasureUnitMutation, i as useDeleteProductMutation, a as useMeasureUnitsQuery, t as useProductQuery, o as useProductsByMeasureUnitQuery, e as useProductsQuery, c as useUpdateMeasureUnitMutation, r as useUpdateProductMutation };
2
+ import { useAllProductsQuery as t } from "./index3.js";
3
+ import { useProductQuery as n } from "./index4.js";
4
+ import "./index5.js";
5
+ import { useCreateProductMutation as r } from "./index6.js";
6
+ import { useUpdateProductMutation as i } from "./index7.js";
7
+ import { useDeleteProductMutation as a } from "./index8.js";
8
+ import { useMeasureUnitsQuery as o } from "./index9.js";
9
+ import { useProductsByMeasureUnitQuery as s } from "./index10.js";
10
+ import { useCreateMeasureUnitMutation as c } from "./index11.js";
11
+ import { useUpdateMeasureUnitMutation as l } from "./index12.js";
12
+ import { useDeleteMeasureUnitMutation as u } from "./index13.js";
13
+ export { t as useAllProductsQuery, c as useCreateMeasureUnitMutation, r as useCreateProductMutation, u as useDeleteMeasureUnitMutation, a as useDeleteProductMutation, o as useMeasureUnitsQuery, n as useProductQuery, s as useProductsByMeasureUnitQuery, e as useProductsQuery, l as useUpdateMeasureUnitMutation, i as useUpdateProductMutation };
@@ -2,33 +2,26 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { postMeasureUnits as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
- import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
5
+ import { getProductsOptions as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../../../data-access/dist/lib/withAuthEpoch.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { measureUnitsInvalidationKey as i } from "./index4.js";
11
- import { useMutation as a } from "@tanstack/react-query";
10
+ import { useQuery as i } from "@tanstack/react-query";
12
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js
13
- function o() {
14
- let { client: o, organizationId: s } = n();
15
- return a({
16
- mutationFn: async ({ body: t }) => {
17
- let { data: n } = await e({
18
- client: o,
19
- headers: r(s),
20
- body: t,
21
- throwOnError: !0
22
- });
23
- return n;
24
- },
25
- onSuccess: async () => {
26
- await t(i({
27
- client: o,
28
- organizationId: s
29
- }));
30
- }
12
+ function a(a) {
13
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
14
+ query: { measure_unit_id: a ?? "" },
15
+ client: o,
16
+ headers: r(s)
17
+ });
18
+ return i({
19
+ ...t(f, {
20
+ authEpoch: l,
21
+ organizationPending: u
22
+ }),
23
+ enabled: d
31
24
  });
32
25
  }
33
26
  //#endregion
34
- export { o as useCreateMeasureUnitMutation };
27
+ export { a as useProductsByMeasureUnitQuery };
@@ -2,26 +2,25 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { patchMeasureUnitsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
5
+ import { postMeasureUnits as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { measureUnitsInvalidationKey as i } from "./index4.js";
10
+ import { measureUnitsInvalidationKey as i } from "./index5.js";
11
11
  import { useMutation as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index11.js
13
13
  function o() {
14
14
  let { client: o, organizationId: s } = n();
15
15
  return a({
16
- mutationFn: async ({ path: t, body: n }) => {
17
- let { data: i } = await e({
16
+ mutationFn: async ({ body: t }) => {
17
+ let { data: n } = await e({
18
18
  client: o,
19
19
  headers: r(s),
20
- path: t,
21
- body: n,
20
+ body: t,
22
21
  throwOnError: !0
23
22
  });
24
- return i;
23
+ return n;
25
24
  },
26
25
  onSuccess: async () => {
27
26
  await t(i({
@@ -32,4 +31,4 @@ function o() {
32
31
  });
33
32
  }
34
33
  //#endregion
35
- export { o as useUpdateMeasureUnitMutation };
34
+ export { o as useCreateMeasureUnitMutation };
@@ -2,35 +2,34 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { deleteMeasureUnitsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
5
+ import { patchMeasureUnitsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { measureUnitsInvalidationKey as i, productsInvalidationKey as a } from "./index4.js";
11
- import { useMutation as o } from "@tanstack/react-query";
10
+ import { measureUnitsInvalidationKey as i } from "./index5.js";
11
+ import { useMutation as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index12.js
13
- function s() {
14
- let { client: s, organizationId: c } = n();
15
- return o({
16
- mutationFn: async ({ path: t }) => {
17
- await e({
18
- client: s,
19
- headers: r(c),
13
+ function o() {
14
+ let { client: o, organizationId: s } = n();
15
+ return a({
16
+ mutationFn: async ({ path: t, body: n }) => {
17
+ let { data: i } = await e({
18
+ client: o,
19
+ headers: r(s),
20
20
  path: t,
21
+ body: n,
21
22
  throwOnError: !0
22
23
  });
24
+ return i;
23
25
  },
24
26
  onSuccess: async () => {
25
- await Promise.all([t(i({
26
- client: s,
27
- organizationId: c
28
- })), t(a({
29
- client: s,
30
- organizationId: c
31
- }))]);
27
+ await t(i({
28
+ client: o,
29
+ organizationId: s
30
+ }));
32
31
  }
33
32
  });
34
33
  }
35
34
  //#endregion
36
- export { s as useDeleteMeasureUnitMutation };
35
+ export { o as useUpdateMeasureUnitMutation };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { deleteMeasureUnitsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
+ import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
+ import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
+ import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
+ import "../../../data-access/dist/index.js";
10
+ import { measureUnitsInvalidationKey as i, productsInvalidationKey as a } from "./index5.js";
11
+ import { useMutation as o } from "@tanstack/react-query";
12
+ //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index13.js
13
+ function s() {
14
+ let { client: s, organizationId: c } = n();
15
+ return o({
16
+ mutationFn: async ({ path: t }) => {
17
+ await e({
18
+ client: s,
19
+ headers: r(c),
20
+ path: t,
21
+ throwOnError: !0
22
+ });
23
+ },
24
+ onSuccess: async () => {
25
+ await Promise.all([t(i({
26
+ client: s,
27
+ organizationId: c
28
+ })), t(a({
29
+ client: s,
30
+ organizationId: c
31
+ }))]);
32
+ }
33
+ });
34
+ }
35
+ //#endregion
36
+ export { s as useDeleteMeasureUnitMutation };
@@ -2,26 +2,53 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getProductsIdOptions as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as t } from "../../../data-access/dist/lib/withAuthEpoch.js";
7
- import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
- import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
5
+ import { getProducts as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
+ import { getProductsQueryKey as t } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
7
+ import { withAuthEpoch as n } from "../../../data-access/dist/lib/withAuthEpoch.js";
8
+ import { useEmbedApi as r } from "../../../data-access/dist/lib/EmbedApiContext.js";
9
+ import { organizationHeaders as i } from "../../../data-access/dist/lib/organizationHeaders.js";
9
10
  import "../../../data-access/dist/index.js";
10
- import { useQuery as i } from "@tanstack/react-query";
11
+ import { queryOptions as a, useQuery as o } from "@tanstack/react-query";
11
12
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index3.js
12
- function a(a) {
13
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
14
- client: o,
15
- headers: r(s),
16
- path: { product_id: a ?? "" }
13
+ var s = 100;
14
+ function c({ enabled: c, ...l } = {}) {
15
+ let { client: u, organizationId: d, widgetToken: f, authEpoch: p, organizationPending: m } = r(), h = i(d), g = a({
16
+ queryKey: [...t({
17
+ client: u,
18
+ headers: h,
19
+ query: {
20
+ ...l,
21
+ limit: s
22
+ }
23
+ }), "all"],
24
+ queryFn: async ({ signal: t }) => {
25
+ let n = [], r = /* @__PURE__ */ new Set(), i;
26
+ do {
27
+ let { data: a } = await e({
28
+ client: u,
29
+ headers: h,
30
+ query: {
31
+ ...l,
32
+ limit: s,
33
+ ...i ? { pagination_token: i } : {}
34
+ },
35
+ signal: t,
36
+ throwOnError: !0
37
+ });
38
+ n.push(...a.data ?? []);
39
+ let o = a.next_pagination_token ?? void 0;
40
+ i = o && !r.has(o) ? o : void 0, i && r.add(i);
41
+ } while (i);
42
+ return { data: n };
43
+ }
17
44
  });
18
- return i({
19
- ...t(f, {
20
- authEpoch: l,
21
- organizationPending: u
45
+ return o({
46
+ ...n(g, {
47
+ authEpoch: p,
48
+ organizationPending: m
22
49
  }),
23
- enabled: d
50
+ enabled: !!(d && f) && (c === !0 || c === void 0)
24
51
  });
25
52
  }
26
53
  //#endregion
27
- export { a as useProductQuery };
54
+ export { c as useAllProductsQuery };
@@ -1,17 +1,27 @@
1
- import { getMeasureUnitsQueryKey as e, getProductsIdQueryKey as t, getProductsQueryKey as n } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { getProductsIdOptions as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
+ import { withAuthEpoch as t } from "../../../data-access/dist/lib/withAuthEpoch.js";
7
+ import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
2
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
3
9
  import "../../../data-access/dist/index.js";
10
+ import { useQuery as i } from "@tanstack/react-query";
4
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js
5
- var i = ({ client: e, organizationId: t }) => n({
6
- client: e,
7
- headers: r(t)
8
- }), a = ({ client: e, organizationId: n, productId: i }) => t({
9
- client: e,
10
- headers: r(n),
11
- path: { product_id: i }
12
- }), o = ({ client: t, organizationId: n }) => e({
13
- client: t,
14
- headers: r(n)
15
- });
12
+ function a(a) {
13
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
14
+ client: o,
15
+ headers: r(s),
16
+ path: { product_id: a ?? "" }
17
+ });
18
+ return i({
19
+ ...t(f, {
20
+ authEpoch: l,
21
+ organizationPending: u
22
+ }),
23
+ enabled: d
24
+ });
25
+ }
16
26
  //#endregion
17
- export { o as measureUnitsInvalidationKey, a as productInvalidationKey, i as productsInvalidationKey };
27
+ export { a as useProductQuery };
@@ -1,34 +1,17 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { postProducts as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
- import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
- import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
1
+ import { getMeasureUnitsQueryKey as e, getProductsIdQueryKey as t, getProductsQueryKey as n } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
8
2
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
3
  import "../../../data-access/dist/index.js";
10
- import { productsInvalidationKey as i } from "./index4.js";
11
- import { useMutation as a } from "@tanstack/react-query";
12
4
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index5.js
13
- function o() {
14
- let { client: o, organizationId: s } = n();
15
- return a({
16
- mutationFn: async ({ body: t }) => {
17
- let { data: n } = await e({
18
- client: o,
19
- headers: r(s),
20
- body: t,
21
- throwOnError: !0
22
- });
23
- return n;
24
- },
25
- onSuccess: async () => {
26
- await t(i({
27
- client: o,
28
- organizationId: s
29
- }));
30
- }
31
- });
32
- }
5
+ var i = ({ client: e, organizationId: t }) => n({
6
+ client: e,
7
+ headers: r(t)
8
+ }), a = ({ client: e, organizationId: n, productId: i }) => t({
9
+ client: e,
10
+ headers: r(n),
11
+ path: { product_id: i }
12
+ }), o = ({ client: t, organizationId: n }) => e({
13
+ client: t,
14
+ headers: r(n)
15
+ });
33
16
  //#endregion
34
- export { o as useCreateProductMutation };
17
+ export { o as measureUnitsInvalidationKey, a as productInvalidationKey, i as productsInvalidationKey };
@@ -2,38 +2,33 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { patchProductsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
5
+ import { postProducts as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { productInvalidationKey as i, productsInvalidationKey as a } from "./index4.js";
11
- import { useMutation as o } from "@tanstack/react-query";
10
+ import { productsInvalidationKey as i } from "./index5.js";
11
+ import { useMutation as a } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index6.js
13
- function s() {
14
- let { client: s, organizationId: c } = n();
15
- return o({
16
- mutationFn: async ({ path: t, body: n }) => {
17
- let { data: i } = await e({
18
- client: s,
19
- headers: r(c),
20
- path: t,
21
- body: n,
13
+ function o() {
14
+ let { client: o, organizationId: s } = n();
15
+ return a({
16
+ mutationFn: async ({ body: t }) => {
17
+ let { data: n } = await e({
18
+ client: o,
19
+ headers: r(s),
20
+ body: t,
22
21
  throwOnError: !0
23
22
  });
24
- return i;
23
+ return n;
25
24
  },
26
- onSuccess: async (e, n) => {
27
- await Promise.all([t(a({
28
- client: s,
29
- organizationId: c
30
- })), t(i({
31
- client: s,
32
- organizationId: c,
33
- productId: n.path.product_id
34
- }))]);
25
+ onSuccess: async () => {
26
+ await t(i({
27
+ client: o,
28
+ organizationId: s
29
+ }));
35
30
  }
36
31
  });
37
32
  }
38
33
  //#endregion
39
- export { s as useUpdateProductMutation };
34
+ export { o as useCreateProductMutation };
@@ -2,32 +2,38 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { deleteProductsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
5
+ import { patchProductsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
6
  import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { productsInvalidationKey as i } from "./index4.js";
11
- import { useMutation as a } from "@tanstack/react-query";
10
+ import { productInvalidationKey as i, productsInvalidationKey as a } from "./index5.js";
11
+ import { useMutation as o } from "@tanstack/react-query";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index7.js
13
- function o() {
14
- let { client: o, organizationId: s } = n();
15
- return a({
16
- mutationFn: async ({ path: t }) => {
17
- await e({
18
- client: o,
19
- headers: r(s),
13
+ function s() {
14
+ let { client: s, organizationId: c } = n();
15
+ return o({
16
+ mutationFn: async ({ path: t, body: n }) => {
17
+ let { data: i } = await e({
18
+ client: s,
19
+ headers: r(c),
20
20
  path: t,
21
+ body: n,
21
22
  throwOnError: !0
22
23
  });
24
+ return i;
23
25
  },
24
- onSuccess: async () => {
25
- await t(i({
26
- client: o,
27
- organizationId: s
28
- }));
26
+ onSuccess: async (e, n) => {
27
+ await Promise.all([t(a({
28
+ client: s,
29
+ organizationId: c
30
+ })), t(i({
31
+ client: s,
32
+ organizationId: c,
33
+ productId: n.path.product_id
34
+ }))]);
29
35
  }
30
36
  });
31
37
  }
32
38
  //#endregion
33
- export { o as useDeleteProductMutation };
39
+ export { s as useUpdateProductMutation };
@@ -2,25 +2,32 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getMeasureUnitsOptions as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
- import { withAuthEpoch as t } from "../../../data-access/dist/lib/withAuthEpoch.js";
5
+ import { deleteProductsId as e } from "../../../data-access/dist/lib/rest/sdk.gen.js";
6
+ import { invalidateAllClients as t } from "../../../data-access/dist/lib/clientRegistry.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
- import { useQuery as i } from "@tanstack/react-query";
10
+ import { productsInvalidationKey as i } from "./index5.js";
11
+ import { useMutation as a } from "@tanstack/react-query";
11
12
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index8.js
12
- function a() {
13
- let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationPending: l } = n(), u = !!(o && s), d = e({
14
- client: a,
15
- headers: r(o)
16
- });
17
- return i({
18
- ...t(d, {
19
- authEpoch: c,
20
- organizationPending: l
21
- }),
22
- enabled: u
13
+ function o() {
14
+ let { client: o, organizationId: s } = n();
15
+ return a({
16
+ mutationFn: async ({ path: t }) => {
17
+ await e({
18
+ client: o,
19
+ headers: r(s),
20
+ path: t,
21
+ throwOnError: !0
22
+ });
23
+ },
24
+ onSuccess: async () => {
25
+ await t(i({
26
+ client: o,
27
+ organizationId: s
28
+ }));
29
+ }
23
30
  });
24
31
  }
25
32
  //#endregion
26
- export { a as useMeasureUnitsQuery };
33
+ export { o as useDeleteProductMutation };
@@ -2,26 +2,25 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { getProductsOptions as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
5
+ import { getMeasureUnitsOptions as e } from "../../../data-access/dist/lib/rest/@tanstack/react-query.gen.js";
6
6
  import { withAuthEpoch as t } from "../../../data-access/dist/lib/withAuthEpoch.js";
7
7
  import { useEmbedApi as n } from "../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import { organizationHeaders as r } from "../../../data-access/dist/lib/organizationHeaders.js";
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js
12
- function a(a) {
13
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
14
- query: { measure_unit_id: a ?? "" },
15
- client: o,
16
- headers: r(s)
12
+ function a() {
13
+ let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationPending: l } = n(), u = !!(o && s), d = e({
14
+ client: a,
15
+ headers: r(o)
17
16
  });
18
17
  return i({
19
- ...t(f, {
20
- authEpoch: l,
21
- organizationPending: u
18
+ ...t(d, {
19
+ authEpoch: c,
20
+ organizationPending: l
22
21
  }),
23
- enabled: d
22
+ enabled: u
24
23
  });
25
24
  }
26
25
  //#endregion
27
- export { a as useProductsByMeasureUnitQuery };
26
+ export { a as useMeasureUnitsQuery };
@@ -1,24 +1,25 @@
1
1
  import "../../../util/dist/lib/apiErrors.js";
2
2
  import { PRODUCT_MESSAGE_LABELS_EN as e } from "./lib/labels.js";
3
- import { EMPTY_PRODUCT_FORM_VALUES as t, buildProductDetailsView as n, buildProductRows as r, getCurrencyOptions as i, hasSelectedText as a } from "./lib/helpers.js";
4
- import { ProductFormSheet as o } from "../../ui/dist/index3.js";
3
+ import { buildProductDetailsView as t, buildProductRows as n, getCurrencyOptions as r, hasSelectedText as i } from "./lib/helpers.js";
4
+ import { ProductFormSheet as a } from "../../ui/dist/index3.js";
5
5
  import "../../ui/dist/index4.js";
6
6
  import "../../ui/dist/index5.js";
7
7
  import "../../ui/dist/index.js";
8
- import { useProductsQuery as s } from "../../data-access/dist/index2.js";
9
- import { useProductQuery as c } from "../../data-access/dist/index3.js";
10
- import "../../data-access/dist/index5.js";
8
+ import { useProductsQuery as o } from "../../data-access/dist/index2.js";
9
+ import "../../data-access/dist/index3.js";
10
+ import { useProductQuery as s } from "../../data-access/dist/index4.js";
11
11
  import "../../data-access/dist/index6.js";
12
- import { useDeleteProductMutation as l } from "../../data-access/dist/index7.js";
13
- import "../../data-access/dist/index8.js";
14
- import "../../data-access/dist/index9.js";
12
+ import "../../data-access/dist/index7.js";
13
+ import { useDeleteProductMutation as c } from "../../data-access/dist/index8.js";
14
+ import { useMeasureUnitsQuery as l } from "../../data-access/dist/index9.js";
15
15
  import "../../data-access/dist/index10.js";
16
16
  import "../../data-access/dist/index11.js";
17
17
  import "../../data-access/dist/index12.js";
18
+ import "../../data-access/dist/index13.js";
18
19
  import "../../data-access/dist/index.js";
19
20
  import { MeasureUnitsManagerContainer as u } from "./lib/MeasureUnitsManagerContainer.js";
20
21
  import { useMeasureUnits as d } from "./lib/useMeasureUnits.js";
21
22
  import { useProductForm as f } from "./lib/useProductForm.js";
22
23
  import "./lib/useProductSelector.js";
23
24
  import { ProductSelector as p } from "./lib/ProductSelector.js";
24
- export { t as EMPTY_PRODUCT_FORM_VALUES, u as MeasureUnitsManagerContainer, e as PRODUCT_MESSAGE_LABELS_EN, o as ProductFormSheet, p as ProductSelector, n as buildProductDetailsView, r as buildProductRows, i as getCurrencyOptions, a as hasSelectedText, l as useDeleteProductMutation, d as useMeasureUnits, f as useProductForm, c as useProductQuery, s as useProductsQuery };
25
+ export { u as MeasureUnitsManagerContainer, e as PRODUCT_MESSAGE_LABELS_EN, a as ProductFormSheet, p as ProductSelector, t as buildProductDetailsView, n as buildProductRows, r as getCurrencyOptions, i as hasSelectedText, c as useDeleteProductMutation, d as useMeasureUnits, l as useMeasureUnitsQuery, f as useProductForm, s as useProductQuery, o as useProductsQuery };
@@ -8,11 +8,11 @@ import { formatPrice as n, validateMeasureUnit as r } from "./helpers.js";
8
8
  import { MeasureUnitsManager as i } from "../../../ui/dist/index4.js";
9
9
  import { MeasureUnitDeleteDialog as a } from "../../../ui/dist/index5.js";
10
10
  import "../../../ui/dist/index.js";
11
- import { useMeasureUnitsQuery as o } from "../../../data-access/dist/index8.js";
12
- import { useProductsByMeasureUnitQuery as s } from "../../../data-access/dist/index9.js";
13
- import { useCreateMeasureUnitMutation as c } from "../../../data-access/dist/index10.js";
14
- import { useUpdateMeasureUnitMutation as l } from "../../../data-access/dist/index11.js";
15
- import { useDeleteMeasureUnitMutation as u } from "../../../data-access/dist/index12.js";
11
+ import { useMeasureUnitsQuery as o } from "../../../data-access/dist/index9.js";
12
+ import { useProductsByMeasureUnitQuery as s } from "../../../data-access/dist/index10.js";
13
+ import { useCreateMeasureUnitMutation as c } from "../../../data-access/dist/index11.js";
14
+ import { useUpdateMeasureUnitMutation as l } from "../../../data-access/dist/index12.js";
15
+ import { useDeleteMeasureUnitMutation as u } from "../../../data-access/dist/index13.js";
16
16
  import "../../../data-access/dist/index.js";
17
17
  import { useCallback as d, useMemo as f, useState as p } from "react";
18
18
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";