@decocms/apps 0.23.3 → 0.25.0

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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/commerce/components/Image.tsx +129 -143
  3. package/commerce/components/JsonLd.tsx +192 -201
  4. package/commerce/components/Picture.tsx +65 -75
  5. package/commerce/sdk/analytics.ts +15 -15
  6. package/commerce/sdk/formatPrice.ts +13 -16
  7. package/commerce/sdk/url.ts +7 -7
  8. package/commerce/sdk/useOffer.ts +46 -57
  9. package/commerce/sdk/useVariantPossibilities.ts +25 -25
  10. package/commerce/types/commerce.ts +868 -875
  11. package/commerce/utils/canonical.ts +5 -8
  12. package/commerce/utils/constants.ts +5 -6
  13. package/commerce/utils/filters.ts +4 -4
  14. package/commerce/utils/productToAnalyticsItem.ts +52 -56
  15. package/commerce/utils/stateByZip.ts +42 -42
  16. package/package.json +24 -4
  17. package/shopify/actions/cart/addItems.ts +24 -25
  18. package/shopify/actions/cart/updateCoupons.ts +19 -20
  19. package/shopify/actions/cart/updateItems.ts +19 -20
  20. package/shopify/actions/user/signIn.ts +25 -30
  21. package/shopify/actions/user/signUp.ts +19 -24
  22. package/shopify/client.ts +24 -24
  23. package/shopify/index.ts +20 -18
  24. package/shopify/init.ts +18 -21
  25. package/shopify/loaders/ProductDetailsPage.ts +16 -20
  26. package/shopify/loaders/ProductList.ts +66 -69
  27. package/shopify/loaders/ProductListingPage.ts +150 -158
  28. package/shopify/loaders/RelatedProducts.ts +24 -27
  29. package/shopify/loaders/cart.ts +53 -52
  30. package/shopify/loaders/shop.ts +22 -27
  31. package/shopify/loaders/user.ts +27 -32
  32. package/shopify/utils/admin/admin.ts +33 -34
  33. package/shopify/utils/admin/queries.ts +2 -2
  34. package/shopify/utils/cart.ts +18 -14
  35. package/shopify/utils/cookies.ts +62 -65
  36. package/shopify/utils/enums.ts +424 -424
  37. package/shopify/utils/graphql.ts +44 -55
  38. package/shopify/utils/storefront/queries.ts +24 -29
  39. package/shopify/utils/storefront/storefront.graphql.gen.ts +55 -55
  40. package/shopify/utils/transform.ts +370 -376
  41. package/shopify/utils/types.ts +118 -118
  42. package/shopify/utils/user.ts +11 -11
  43. package/shopify/utils/utils.ts +135 -140
  44. package/vtex/actions/address.ts +86 -86
  45. package/vtex/actions/auth.ts +14 -27
  46. package/vtex/actions/checkout.ts +36 -49
  47. package/vtex/actions/masterData.ts +10 -27
  48. package/vtex/actions/misc.ts +101 -111
  49. package/vtex/actions/newsletter.ts +48 -52
  50. package/vtex/actions/orders.ts +13 -16
  51. package/vtex/actions/profile.ts +55 -55
  52. package/vtex/actions/session.ts +36 -35
  53. package/vtex/actions/trigger.ts +25 -25
  54. package/vtex/actions/wishlist.ts +51 -53
  55. package/vtex/client.ts +14 -42
  56. package/vtex/hooks/index.ts +4 -4
  57. package/vtex/hooks/useAutocomplete.ts +42 -48
  58. package/vtex/hooks/useCart.ts +153 -165
  59. package/vtex/hooks/useUser.ts +40 -40
  60. package/vtex/hooks/useWishlist.ts +70 -70
  61. package/vtex/inline-loaders/productDetailsPage.ts +1 -3
  62. package/vtex/inline-loaders/productList.ts +121 -127
  63. package/vtex/inline-loaders/productListShelf.ts +159 -0
  64. package/vtex/inline-loaders/productListingPage.ts +10 -34
  65. package/vtex/inline-loaders/relatedProducts.ts +1 -3
  66. package/vtex/inline-loaders/suggestions.ts +36 -39
  67. package/vtex/inline-loaders/workflowProducts.ts +45 -49
  68. package/vtex/invoke.ts +159 -194
  69. package/vtex/loaders/address.ts +49 -54
  70. package/vtex/loaders/brands.ts +19 -26
  71. package/vtex/loaders/cart.ts +24 -21
  72. package/vtex/loaders/catalog.ts +51 -53
  73. package/vtex/loaders/collections.ts +25 -27
  74. package/vtex/loaders/legacy.ts +487 -534
  75. package/vtex/loaders/logistics.ts +33 -37
  76. package/vtex/loaders/navbar.ts +5 -8
  77. package/vtex/loaders/orders.ts +28 -39
  78. package/vtex/loaders/pageType.ts +41 -35
  79. package/vtex/loaders/payment.ts +27 -37
  80. package/vtex/loaders/profile.ts +38 -38
  81. package/vtex/loaders/promotion.ts +5 -8
  82. package/vtex/loaders/search.ts +56 -59
  83. package/vtex/loaders/session.ts +22 -30
  84. package/vtex/loaders/user.ts +39 -41
  85. package/vtex/loaders/wishlist.ts +35 -35
  86. package/vtex/loaders/wishlistProducts.ts +3 -15
  87. package/vtex/loaders/workflow.ts +220 -227
  88. package/vtex/middleware.ts +116 -119
  89. package/vtex/types.ts +201 -201
  90. package/vtex/utils/batch.ts +13 -16
  91. package/vtex/utils/cookies.ts +76 -80
  92. package/vtex/utils/enrichment.ts +62 -42
  93. package/vtex/utils/fetchCache.ts +1 -4
  94. package/vtex/utils/index.ts +6 -6
  95. package/vtex/utils/intelligentSearch.ts +48 -57
  96. package/vtex/utils/legacy.ts +108 -124
  97. package/vtex/utils/pickAndOmit.ts +15 -20
  98. package/vtex/utils/proxy.ts +136 -146
  99. package/vtex/utils/resourceRange.ts +3 -3
  100. package/vtex/utils/segment.ts +100 -111
  101. package/vtex/utils/similars.ts +1 -2
  102. package/vtex/utils/sitemap.ts +91 -91
  103. package/vtex/utils/slugCache.ts +2 -6
  104. package/vtex/utils/slugify.ts +9 -9
  105. package/vtex/utils/transform.ts +1178 -1105
  106. package/vtex/utils/types.ts +1381 -1381
  107. package/vtex/utils/vtexId.ts +44 -47
  108. package/.github/workflows/release.yml +0 -34
  109. package/.releaserc.json +0 -28
  110. package/knip.json +0 -19
  111. package/tsconfig.json +0 -11
@@ -4,48 +4,41 @@
4
4
  *
5
5
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pub/brand/list
6
6
  */
7
- import { vtexFetch, getVtexConfig } from "../client";
8
- import { toBrand } from "../utils/transform";
7
+
9
8
  import type { Brand } from "../../commerce/types/commerce";
9
+ import { getVtexConfig, vtexFetch } from "../client";
10
+ import { toBrand } from "../utils/transform";
10
11
  import type { Brand as BrandVTEX } from "../utils/types";
11
12
 
12
13
  export interface ListBrandsOpts {
13
- /** When true, only returns active brands. @default false */
14
- filterInactive?: boolean;
14
+ /** When true, only returns active brands. @default false */
15
+ filterInactive?: boolean;
15
16
  }
16
17
 
17
18
  /**
18
19
  * List brands from the VTEX catalog, transformed to schema.org Brand format.
19
20
  */
20
- export async function listBrands(
21
- opts?: ListBrandsOpts,
22
- ): Promise<Brand[]> {
23
- const config = getVtexConfig();
24
- const baseUrl = `https://${config.account}.vteximg.com.br/arquivos/ids`;
21
+ export async function listBrands(opts?: ListBrandsOpts): Promise<Brand[]> {
22
+ const config = getVtexConfig();
23
+ const baseUrl = `https://${config.account}.vteximg.com.br/arquivos/ids`;
25
24
 
26
- const brands = await vtexFetch<BrandVTEX[]>(
27
- "/api/catalog_system/pub/brand/list",
28
- );
25
+ const brands = await vtexFetch<BrandVTEX[]>("/api/catalog_system/pub/brand/list");
29
26
 
30
- const filtered = opts?.filterInactive
31
- ? brands.filter((b) => b.isActive)
32
- : brands;
27
+ const filtered = opts?.filterInactive ? brands.filter((b) => b.isActive) : brands;
33
28
 
34
- return filtered.map((b) => toBrand(b, baseUrl));
29
+ return filtered.map((b) => toBrand(b, baseUrl));
35
30
  }
36
31
 
37
32
  /**
38
33
  * Get a single brand by ID, as schema.org Brand.
39
34
  */
40
35
  export async function getBrandById(brandId: number): Promise<Brand | null> {
41
- try {
42
- const config = getVtexConfig();
43
- const baseUrl = `https://${config.account}.vteximg.com.br/arquivos/ids`;
44
- const brand = await vtexFetch<BrandVTEX>(
45
- `/api/catalog_system/pub/brand/${brandId}`,
46
- );
47
- return toBrand(brand, baseUrl);
48
- } catch {
49
- return null;
50
- }
36
+ try {
37
+ const config = getVtexConfig();
38
+ const baseUrl = `https://${config.account}.vteximg.com.br/arquivos/ids`;
39
+ const brand = await vtexFetch<BrandVTEX>(`/api/catalog_system/pub/brand/${brandId}`);
40
+ return toBrand(brand, baseUrl);
41
+ } catch {
42
+ return null;
43
+ }
51
44
  }
@@ -7,10 +7,11 @@
7
7
  *
8
8
  * @see https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/orderForm
9
9
  */
10
- import { vtexFetch, getVtexConfig } from "../client";
11
- import type { OrderForm } from "../utils/types";
12
- import { forceHttpsOnAssets } from "../utils/transform";
10
+
13
11
  import { DEFAULT_EXPECTED_SECTIONS } from "../actions/checkout";
12
+ import { getVtexConfig, vtexFetch } from "../client";
13
+ import { forceHttpsOnAssets } from "../utils/transform";
14
+ import type { OrderForm } from "../utils/types";
14
15
 
15
16
  /**
16
17
  * Fetch the current cart (OrderForm).
@@ -23,27 +24,29 @@ import { DEFAULT_EXPECTED_SECTIONS } from "../actions/checkout";
23
24
  * @param authCookie - Optional cookie string for authenticated requests
24
25
  */
25
26
  export async function getCart(
26
- orderFormId?: string,
27
- opts?: { salesChannel?: string; authCookie?: string },
27
+ orderFormId?: string,
28
+ opts?: { salesChannel?: string; authCookie?: string },
28
29
  ): Promise<OrderForm> {
29
- const { salesChannel } = getVtexConfig();
30
- const sc = opts?.salesChannel ?? salesChannel;
31
- const headers: Record<string, string> = {};
32
- if (opts?.authCookie) headers.cookie = opts.authCookie;
30
+ const { salesChannel } = getVtexConfig();
31
+ const sc = opts?.salesChannel ?? salesChannel;
32
+ const headers: Record<string, string> = {};
33
+ if (opts?.authCookie) headers.cookie = opts.authCookie;
33
34
 
34
- const scParam = sc ? `?sc=${sc}` : "";
35
+ const scParam = sc ? `?sc=${sc}` : "";
35
36
 
36
- const body = JSON.stringify({ expectedOrderFormSections: DEFAULT_EXPECTED_SECTIONS });
37
+ const body = JSON.stringify({ expectedOrderFormSections: DEFAULT_EXPECTED_SECTIONS });
37
38
 
38
- const cart = orderFormId
39
- ? await vtexFetch<OrderForm>(
40
- `/api/checkout/pub/orderForm/${orderFormId}${scParam}`,
41
- { method: "POST", headers, body },
42
- )
43
- : await vtexFetch<OrderForm>(
44
- `/api/checkout/pub/orderForm${scParam}`,
45
- { method: "POST", headers, body },
46
- );
39
+ const cart = orderFormId
40
+ ? await vtexFetch<OrderForm>(`/api/checkout/pub/orderForm/${orderFormId}${scParam}`, {
41
+ method: "POST",
42
+ headers,
43
+ body,
44
+ })
45
+ : await vtexFetch<OrderForm>(`/api/checkout/pub/orderForm${scParam}`, {
46
+ method: "POST",
47
+ headers,
48
+ body,
49
+ });
47
50
 
48
- return forceHttpsOnAssets(cart);
51
+ return forceHttpsOnAssets(cart);
49
52
  }
@@ -5,29 +5,29 @@
5
5
  * Ported from deco-cx/apps vtex/loaders/legacy/*.ts and vtex/utils/client.ts
6
6
  * @see https://developers.vtex.com/docs/api-reference/catalog-api
7
7
  */
8
- import { vtexFetch, getVtexConfig } from "../client";
8
+ import { getVtexConfig, vtexFetch } from "../client";
9
9
 
10
10
  // ---------------------------------------------------------------------------
11
11
  // Product search (public)
12
12
  // ---------------------------------------------------------------------------
13
13
 
14
14
  export type LegacySort =
15
- | ""
16
- | "OrderByTopSaleDESC"
17
- | "OrderByReleaseDateDESC"
18
- | "OrderByBestDiscountDESC"
19
- | "OrderByPriceDESC"
20
- | "OrderByPriceASC"
21
- | "OrderByNameASC"
22
- | "OrderByNameDESC"
23
- | "OrderByScoreDESC";
15
+ | ""
16
+ | "OrderByTopSaleDESC"
17
+ | "OrderByReleaseDateDESC"
18
+ | "OrderByBestDiscountDESC"
19
+ | "OrderByPriceDESC"
20
+ | "OrderByPriceASC"
21
+ | "OrderByNameASC"
22
+ | "OrderByNameDESC"
23
+ | "OrderByScoreDESC";
24
24
 
25
25
  export interface SearchProductsOpts {
26
- fq?: string | string[];
27
- ft?: string;
28
- sort?: LegacySort;
29
- from?: number;
30
- to?: number;
26
+ fq?: string | string[];
27
+ ft?: string;
28
+ sort?: LegacySort;
29
+ from?: number;
30
+ to?: number;
31
31
  }
32
32
 
33
33
  /**
@@ -35,18 +35,18 @@ export interface SearchProductsOpts {
35
35
  * @see https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search
36
36
  */
37
37
  export async function searchProducts<T = any>(opts: SearchProductsOpts = {}): Promise<T[]> {
38
- const params = new URLSearchParams();
39
- const fqs = Array.isArray(opts.fq) ? opts.fq : opts.fq ? [opts.fq] : [];
40
- for (const f of fqs) params.append("fq", f);
41
- if (opts.ft) params.set("ft", opts.ft);
42
- if (opts.sort) params.set("O", opts.sort);
43
- if (opts.from != null) params.set("_from", String(opts.from));
44
- if (opts.to != null) params.set("_to", String(opts.to));
45
-
46
- const { salesChannel } = getVtexConfig();
47
- if (salesChannel) params.set("sc", salesChannel);
48
-
49
- return vtexFetch<T[]>(`/api/catalog_system/pub/products/search/?${params}`);
38
+ const params = new URLSearchParams();
39
+ const fqs = Array.isArray(opts.fq) ? opts.fq : opts.fq ? [opts.fq] : [];
40
+ for (const f of fqs) params.append("fq", f);
41
+ if (opts.ft) params.set("ft", opts.ft);
42
+ if (opts.sort) params.set("O", opts.sort);
43
+ if (opts.from != null) params.set("_from", String(opts.from));
44
+ if (opts.to != null) params.set("_to", String(opts.to));
45
+
46
+ const { salesChannel } = getVtexConfig();
47
+ if (salesChannel) params.set("sc", salesChannel);
48
+
49
+ return vtexFetch<T[]>(`/api/catalog_system/pub/products/search/?${params}`);
50
50
  }
51
51
 
52
52
  /**
@@ -54,16 +54,16 @@ export async function searchProducts<T = any>(opts: SearchProductsOpts = {}): Pr
54
54
  * @see https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search
55
55
  */
56
56
  export async function getProductByIdOrSku<T = any>(opts: {
57
- productId?: string;
58
- skuId?: string;
57
+ productId?: string;
58
+ skuId?: string;
59
59
  }): Promise<T | null> {
60
- let fq: string;
61
- if (opts.productId) fq = `productId:${opts.productId}`;
62
- else if (opts.skuId) fq = `skuId:${opts.skuId}`;
63
- else throw new Error("Neither productId nor skuId provided.");
60
+ let fq: string;
61
+ if (opts.productId) fq = `productId:${opts.productId}`;
62
+ else if (opts.skuId) fq = `skuId:${opts.skuId}`;
63
+ else throw new Error("Neither productId nor skuId provided.");
64
64
 
65
- const results = await searchProducts<T>({ fq });
66
- return results[0] ?? null;
65
+ const results = await searchProducts<T>({ fq });
66
+ return results[0] ?? null;
67
67
  }
68
68
 
69
69
  // ---------------------------------------------------------------------------
@@ -75,7 +75,7 @@ export async function getProductByIdOrSku<T = any>(opts: {
75
75
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pub/products/variations/-productId-
76
76
  */
77
77
  export async function getProductVariations<T = any>(productId: string): Promise<T> {
78
- return vtexFetch<T>(`/api/catalog_system/pub/products/variations/${productId}`);
78
+ return vtexFetch<T>(`/api/catalog_system/pub/products/variations/${productId}`);
79
79
  }
80
80
 
81
81
  // ---------------------------------------------------------------------------
@@ -87,7 +87,7 @@ export async function getProductVariations<T = any>(productId: string): Promise<
87
87
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pvt/products/-productId-/specification
88
88
  */
89
89
  export async function getProductSpecification<T = any>(productId: string): Promise<T> {
90
- return vtexFetch<T>(`/api/catalog_system/pvt/products/${productId}/Specification`);
90
+ return vtexFetch<T>(`/api/catalog_system/pvt/products/${productId}/Specification`);
91
91
  }
92
92
 
93
93
  // ---------------------------------------------------------------------------
@@ -95,25 +95,23 @@ export async function getProductSpecification<T = any>(productId: string): Promi
95
95
  // ---------------------------------------------------------------------------
96
96
 
97
97
  export type CrossSellingType =
98
- | "similars"
99
- | "suggestions"
100
- | "accessories"
101
- | "whosawalsosaw"
102
- | "whosawalsobought"
103
- | "whoboughtalsobought"
104
- | "showtogether";
98
+ | "similars"
99
+ | "suggestions"
100
+ | "accessories"
101
+ | "whosawalsosaw"
102
+ | "whosawalsobought"
103
+ | "whoboughtalsobought"
104
+ | "showtogether";
105
105
 
106
106
  /**
107
107
  * Get cross-selling products.
108
108
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pub/products/crossselling/-type-/-productId-
109
109
  */
110
110
  export async function getCrossSelling<T = any>(
111
- type: CrossSellingType,
112
- productId: string,
111
+ type: CrossSellingType,
112
+ productId: string,
113
113
  ): Promise<T[]> {
114
- return vtexFetch<T[]>(
115
- `/api/catalog_system/pub/products/crossselling/${type}/${productId}`,
116
- );
114
+ return vtexFetch<T[]>(`/api/catalog_system/pub/products/crossselling/${type}/${productId}`);
117
115
  }
118
116
 
119
117
  // ---------------------------------------------------------------------------
@@ -125,7 +123,7 @@ export async function getCrossSelling<T = any>(
125
123
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pub/category/tree/-categoryLevels-
126
124
  */
127
125
  export async function getCategoryTree<T = any>(levels = 3): Promise<T[]> {
128
- return vtexFetch<T[]>(`/api/catalog_system/pub/category/tree/${levels}`);
126
+ return vtexFetch<T[]>(`/api/catalog_system/pub/category/tree/${levels}`);
129
127
  }
130
128
 
131
129
  // ---------------------------------------------------------------------------
@@ -137,7 +135,7 @@ export async function getCategoryTree<T = any>(levels = 3): Promise<T[]> {
137
135
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pub/brand/list
138
136
  */
139
137
  export async function getBrands<T = any>(): Promise<T[]> {
140
- return vtexFetch<T[]>("/api/catalog_system/pub/brand/list");
138
+ return vtexFetch<T[]>("/api/catalog_system/pub/brand/list");
141
139
  }
142
140
 
143
141
  // ---------------------------------------------------------------------------
@@ -149,7 +147,7 @@ export async function getBrands<T = any>(): Promise<T[]> {
149
147
  * @see https://developers.vtex.com/docs/api-reference/catalog-api#get-/api/catalog_system/pub/portal/pagetype/-term-
150
148
  */
151
149
  export async function getPageType<T = any>(term: string): Promise<T> {
152
- return vtexFetch<T>(`/api/catalog_system/pub/portal/pagetype/${term}`);
150
+ return vtexFetch<T>(`/api/catalog_system/pub/portal/pagetype/${term}`);
153
151
  }
154
152
 
155
153
  // ---------------------------------------------------------------------------
@@ -161,5 +159,5 @@ export async function getPageType<T = any>(term: string): Promise<T> {
161
159
  * @see https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/facets/search/-term-
162
160
  */
163
161
  export async function getFacets<T = any>(term: string): Promise<T> {
164
- return vtexFetch<T>(`/api/catalog_system/pub/facets/search/${term}`);
162
+ return vtexFetch<T>(`/api/catalog_system/pub/facets/search/${term}`);
165
163
  }
@@ -11,8 +11,8 @@ import { vtexFetch } from "../client";
11
11
  import type { CollectionList } from "../utils/types";
12
12
 
13
13
  export interface CollectionOption {
14
- value: string;
15
- label: string;
14
+ value: string;
15
+ label: string;
16
16
  }
17
17
 
18
18
  /**
@@ -24,34 +24,32 @@ export interface CollectionOption {
24
24
  *
25
25
  * Note: uses the **pvt** (private) endpoint — requires appKey/appToken.
26
26
  */
27
- export async function getCollections(
28
- term?: string,
29
- ): Promise<CollectionOption[]> {
30
- const params = new URLSearchParams();
27
+ export async function getCollections(term?: string): Promise<CollectionOption[]> {
28
+ const params = new URLSearchParams();
31
29
 
32
- if (term) {
33
- params.set("page", "1");
34
- params.set("pageSize", "15");
35
- const list = await vtexFetch<CollectionList>(
36
- `/api/catalog_system/pvt/collection/search/${encodeURIComponent(term)}?${params}`,
37
- );
38
- return mapToOptions(list);
39
- }
30
+ if (term) {
31
+ params.set("page", "1");
32
+ params.set("pageSize", "15");
33
+ const list = await vtexFetch<CollectionList>(
34
+ `/api/catalog_system/pvt/collection/search/${encodeURIComponent(term)}?${params}`,
35
+ );
36
+ return mapToOptions(list);
37
+ }
40
38
 
41
- params.set("page", "1");
42
- params.set("pageSize", "3000");
43
- params.set("orderByAsc", "false");
44
- const list = await vtexFetch<CollectionList>(
45
- `/api/catalog_system/pvt/collection/search?${params}`,
46
- );
47
- return mapToOptions(list);
39
+ params.set("page", "1");
40
+ params.set("pageSize", "3000");
41
+ params.set("orderByAsc", "false");
42
+ const list = await vtexFetch<CollectionList>(
43
+ `/api/catalog_system/pvt/collection/search?${params}`,
44
+ );
45
+ return mapToOptions(list);
48
46
  }
49
47
 
50
48
  function mapToOptions(list: CollectionList): CollectionOption[] {
51
- return (
52
- list.items?.map((c) => ({
53
- value: `${c.id}`,
54
- label: `${c.id} - ${c.name}`,
55
- })) ?? []
56
- );
49
+ return (
50
+ list.items?.map((c) => ({
51
+ value: `${c.id}`,
52
+ label: `${c.id} - ${c.name}`,
53
+ })) ?? []
54
+ );
57
55
  }