@bacano/sdk 1.2.4 → 1.2.6
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.
- package/README.md +10 -7
- package/STOREFRONT_PERFORMANCE.md +12 -5
- package/graphql.cjs +59 -0
- package/graphql.js +59 -0
- package/index.cjs +102 -11
- package/index.js +102 -11
- package/package.json +1 -1
- package/react.cjs +102 -11
- package/react.js +102 -11
- package/skills/bacano-web/references/storefront.md +11 -0
- package/transport/documents.d.ts +10 -10
- package/types.d.ts +5 -2
package/react.js
CHANGED
|
@@ -202,6 +202,12 @@ var GET_PRODUCTS = (
|
|
|
202
202
|
id
|
|
203
203
|
name
|
|
204
204
|
description
|
|
205
|
+
product_website_publications(
|
|
206
|
+
where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }
|
|
207
|
+
limit: 1
|
|
208
|
+
) {
|
|
209
|
+
show_when_out_of_stock
|
|
210
|
+
}
|
|
205
211
|
long_description
|
|
206
212
|
slug
|
|
207
213
|
seo_title
|
|
@@ -437,6 +443,12 @@ var GET_PRODUCT_BY_PK = (
|
|
|
437
443
|
limit: 1
|
|
438
444
|
) {
|
|
439
445
|
id
|
|
446
|
+
product_website_publications(
|
|
447
|
+
where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }
|
|
448
|
+
limit: 1
|
|
449
|
+
) {
|
|
450
|
+
show_when_out_of_stock
|
|
451
|
+
}
|
|
440
452
|
product_option_group_members(limit: 1) {
|
|
441
453
|
group {
|
|
442
454
|
id
|
|
@@ -686,6 +698,12 @@ var GET_PRODUCT_SEO_ENTRIES = (
|
|
|
686
698
|
id
|
|
687
699
|
name
|
|
688
700
|
slug
|
|
701
|
+
product_website_publications(
|
|
702
|
+
where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }
|
|
703
|
+
limit: 1
|
|
704
|
+
) {
|
|
705
|
+
show_when_out_of_stock
|
|
706
|
+
}
|
|
689
707
|
seo_title
|
|
690
708
|
seo_description
|
|
691
709
|
seo_image_file_id
|
|
@@ -2319,6 +2337,7 @@ var GET_PRODUCT_FILTERS = (
|
|
|
2319
2337
|
query GetProductFilters(
|
|
2320
2338
|
$companyId: uuid!
|
|
2321
2339
|
$chainId: uuid!
|
|
2340
|
+
$websiteId: uuid!
|
|
2322
2341
|
$where: products_bool_exp = {}
|
|
2323
2342
|
$attributeListKey: String!
|
|
2324
2343
|
) {
|
|
@@ -2326,6 +2345,12 @@ var GET_PRODUCT_FILTERS = (
|
|
|
2326
2345
|
where: {
|
|
2327
2346
|
_and: [
|
|
2328
2347
|
{ company_id: { _eq: $companyId } }
|
|
2348
|
+
{
|
|
2349
|
+
product_website_publications: {
|
|
2350
|
+
website_id: { _eq: $websiteId }
|
|
2351
|
+
is_visible: { _eq: true }
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2329
2354
|
{
|
|
2330
2355
|
chain_products: {
|
|
2331
2356
|
chain_id: { _eq: $chainId }
|
|
@@ -2338,6 +2363,12 @@ var GET_PRODUCT_FILTERS = (
|
|
|
2338
2363
|
}
|
|
2339
2364
|
) {
|
|
2340
2365
|
id
|
|
2366
|
+
product_website_publications(
|
|
2367
|
+
where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }
|
|
2368
|
+
limit: 1
|
|
2369
|
+
) {
|
|
2370
|
+
show_when_out_of_stock
|
|
2371
|
+
}
|
|
2341
2372
|
category
|
|
2342
2373
|
subcategory
|
|
2343
2374
|
color
|
|
@@ -2445,6 +2476,7 @@ var GET_SEARCH_SUGGESTIONS = (
|
|
|
2445
2476
|
query GetSearchSuggestions(
|
|
2446
2477
|
$companyId: uuid!
|
|
2447
2478
|
$chainId: uuid!
|
|
2479
|
+
$websiteId: uuid!
|
|
2448
2480
|
$term: String!
|
|
2449
2481
|
$productLimit: Int = 5
|
|
2450
2482
|
$brandLimit: Int = 3
|
|
@@ -2452,6 +2484,10 @@ var GET_SEARCH_SUGGESTIONS = (
|
|
|
2452
2484
|
products(
|
|
2453
2485
|
where: {
|
|
2454
2486
|
company_id: { _eq: $companyId }
|
|
2487
|
+
product_website_publications: {
|
|
2488
|
+
website_id: { _eq: $websiteId }
|
|
2489
|
+
is_visible: { _eq: true }
|
|
2490
|
+
}
|
|
2455
2491
|
chain_products: {
|
|
2456
2492
|
chain_id: { _eq: $chainId }
|
|
2457
2493
|
is_enabled: { _eq: true }
|
|
@@ -2464,6 +2500,29 @@ var GET_SEARCH_SUGGESTIONS = (
|
|
|
2464
2500
|
) {
|
|
2465
2501
|
id
|
|
2466
2502
|
name
|
|
2503
|
+
product_website_publications(
|
|
2504
|
+
where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }
|
|
2505
|
+
limit: 1
|
|
2506
|
+
) {
|
|
2507
|
+
show_when_out_of_stock
|
|
2508
|
+
}
|
|
2509
|
+
product_variants(where: { is_disabled: { _eq: false } }) {
|
|
2510
|
+
id
|
|
2511
|
+
product_variant_prices(
|
|
2512
|
+
where: {
|
|
2513
|
+
price_type: { _eq: CLIENT }
|
|
2514
|
+
_or: [
|
|
2515
|
+
{ chain_id: { _eq: $chainId } }
|
|
2516
|
+
{ chain_id: { _is_null: true } }
|
|
2517
|
+
]
|
|
2518
|
+
}
|
|
2519
|
+
) {
|
|
2520
|
+
id
|
|
2521
|
+
price
|
|
2522
|
+
price_type
|
|
2523
|
+
chain_id
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2467
2526
|
}
|
|
2468
2527
|
brands(
|
|
2469
2528
|
where: {
|
|
@@ -2945,6 +3004,7 @@ function mapProduct(raw, storageUrl, labels, chainId) {
|
|
|
2945
3004
|
createdAt: raw.created_at,
|
|
2946
3005
|
updatedAt: raw.updated_at ?? raw.created_at,
|
|
2947
3006
|
variants,
|
|
3007
|
+
outOfStockVisibilityOverride: raw.product_website_publications?.[0]?.show_when_out_of_stock ?? null,
|
|
2948
3008
|
detailVariants,
|
|
2949
3009
|
media: raw.product_media.map((m) => mapMedia(m, storageUrl)),
|
|
2950
3010
|
attributes: raw.product_attributes.map(
|
|
@@ -3306,7 +3366,7 @@ async function getWebsiteAvailabilityByVariantId(graphqlUrl, getHeaders, variant
|
|
|
3306
3366
|
}
|
|
3307
3367
|
return availabilityByVariantId;
|
|
3308
3368
|
}
|
|
3309
|
-
async function filterProductsForWebsiteStock(graphqlUrl, getHeaders, products, chainId, websiteId) {
|
|
3369
|
+
async function filterProductsForWebsiteStock(graphqlUrl, getHeaders, products, chainId, websiteId, showOutOfStockByDefault = false, onlyInStock = false) {
|
|
3310
3370
|
const variantIds = products.flatMap(
|
|
3311
3371
|
(product) => product.variants.map((variant) => variant.id)
|
|
3312
3372
|
);
|
|
@@ -3332,11 +3392,11 @@ async function filterProductsForWebsiteStock(graphqlUrl, getHeaders, products, c
|
|
|
3332
3392
|
pricing: resolveProductPricing(prices)
|
|
3333
3393
|
};
|
|
3334
3394
|
}).filter(
|
|
3335
|
-
(variant) => inStockVariantIds.has(variant.id) && variant.pricing.currentPrice != null
|
|
3395
|
+
(variant) => (inStockVariantIds.has(variant.id) || !onlyInStock && (product.outOfStockVisibilityOverride ?? showOutOfStockByDefault)) && variant.pricing.currentPrice != null
|
|
3336
3396
|
)
|
|
3337
3397
|
})).filter((product) => product.variants.length > 0);
|
|
3338
3398
|
}
|
|
3339
|
-
async function filterSeoProductsForWebsiteStock(graphqlUrl, getHeaders, products, chainId, websiteId) {
|
|
3399
|
+
async function filterSeoProductsForWebsiteStock(graphqlUrl, getHeaders, products, chainId, websiteId, showOutOfStockByDefault = false) {
|
|
3340
3400
|
const variantIds = products.flatMap(
|
|
3341
3401
|
(product) => product.product_variants.map((variant) => variant.id)
|
|
3342
3402
|
);
|
|
@@ -3358,7 +3418,7 @@ async function filterSeoProductsForWebsiteStock(graphqlUrl, getHeaders, products
|
|
|
3358
3418
|
const pricing = resolveProductPricing(
|
|
3359
3419
|
selectPublicPrices(prices, chainId)
|
|
3360
3420
|
);
|
|
3361
|
-
return inStockVariantIds.has(variant.id) && pricing.currentPrice != null;
|
|
3421
|
+
return (inStockVariantIds.has(variant.id) || (product.product_website_publications?.[0]?.show_when_out_of_stock ?? showOutOfStockByDefault)) && pricing.currentPrice != null;
|
|
3362
3422
|
})
|
|
3363
3423
|
);
|
|
3364
3424
|
}
|
|
@@ -3429,7 +3489,8 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
3429
3489
|
getHeaders,
|
|
3430
3490
|
[mappedProduct],
|
|
3431
3491
|
ctx.chainId,
|
|
3432
|
-
ctx.websiteId
|
|
3492
|
+
ctx.websiteId,
|
|
3493
|
+
ctx.config?.show_out_of_stock_products === true
|
|
3433
3494
|
);
|
|
3434
3495
|
if (!filteredProducts[0]) return null;
|
|
3435
3496
|
const specifications = await loadProductSpecifications([product.id]);
|
|
@@ -3662,7 +3723,8 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
3662
3723
|
getHeaders,
|
|
3663
3724
|
data.products ?? [],
|
|
3664
3725
|
ctx.chainId,
|
|
3665
|
-
ctx.websiteId
|
|
3726
|
+
ctx.websiteId,
|
|
3727
|
+
ctx.config?.show_out_of_stock_products === true
|
|
3666
3728
|
);
|
|
3667
3729
|
const entries = availableProducts.slice(0, limit).map((product) => mapProductSeoEntry(product, storageUrl)).filter((entry) => Boolean(entry));
|
|
3668
3730
|
return {
|
|
@@ -3739,7 +3801,9 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
3739
3801
|
(p) => mapProduct(p, storageUrl, publicAttributeLabels, chainId)
|
|
3740
3802
|
),
|
|
3741
3803
|
chainId,
|
|
3742
|
-
ctx.websiteId
|
|
3804
|
+
ctx.websiteId,
|
|
3805
|
+
ctx.config?.show_out_of_stock_products === true,
|
|
3806
|
+
opts?.inStock === true
|
|
3743
3807
|
);
|
|
3744
3808
|
const specifications = await loadProductSpecifications(
|
|
3745
3809
|
products.map((product) => product.id)
|
|
@@ -3846,6 +3910,7 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
3846
3910
|
{
|
|
3847
3911
|
companyId: ctx.companyId,
|
|
3848
3912
|
chainId,
|
|
3913
|
+
websiteId: ctx.websiteId,
|
|
3849
3914
|
attributeListKey: DEFAULT_FILTER_ATTRIBUTE_LIST_KEY,
|
|
3850
3915
|
where: buildProductWhere(opts.filters ?? {}, chainId)
|
|
3851
3916
|
},
|
|
@@ -3869,7 +3934,7 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
3869
3934
|
variant.product_variant_prices.map(mapPrice),
|
|
3870
3935
|
chainId
|
|
3871
3936
|
);
|
|
3872
|
-
return prices.length > 0 && (availabilityByVariantId.get(variant.id)?.inStock ?? false);
|
|
3937
|
+
return prices.length > 0 && ((availabilityByVariantId.get(variant.id)?.inStock ?? false) || (product.product_website_publications?.[0]?.show_when_out_of_stock ?? ctx.config?.show_out_of_stock_products === true));
|
|
3873
3938
|
});
|
|
3874
3939
|
if (!hasVisibleVariant) continue;
|
|
3875
3940
|
applicableCategories.add(product.category);
|
|
@@ -3957,6 +4022,7 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
3957
4022
|
{
|
|
3958
4023
|
companyId: ctx.companyId,
|
|
3959
4024
|
chainId,
|
|
4025
|
+
websiteId: ctx.websiteId,
|
|
3960
4026
|
attributeListKey: opts?.attributeListKey ?? DEFAULT_FILTER_ATTRIBUTE_LIST_KEY,
|
|
3961
4027
|
where: {
|
|
3962
4028
|
...opts?.categoryName ? { category: { _eq: opts.categoryName } } : {},
|
|
@@ -4011,7 +4077,9 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
4011
4077
|
chainId
|
|
4012
4078
|
),
|
|
4013
4079
|
inStock: availabilityByVariantId.get(variant.id)?.inStock ?? false
|
|
4014
|
-
})).filter(
|
|
4080
|
+
})).filter(
|
|
4081
|
+
(variant) => (variant.inStock || (product.product_website_publications?.[0]?.show_when_out_of_stock ?? ctx.config?.show_out_of_stock_products === true)) && variant.prices.length > 0
|
|
4082
|
+
);
|
|
4015
4083
|
if (visibleVariants.length === 0) continue;
|
|
4016
4084
|
categoryCounts.set(
|
|
4017
4085
|
product.category,
|
|
@@ -4096,6 +4164,7 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
4096
4164
|
"NO_CHAIN"
|
|
4097
4165
|
);
|
|
4098
4166
|
}
|
|
4167
|
+
const chainId = ctx.chainId;
|
|
4099
4168
|
const term = `%${opts.query}%`;
|
|
4100
4169
|
const limit = opts.limit ?? 8;
|
|
4101
4170
|
const data = await executeGraphQL(
|
|
@@ -4103,7 +4172,8 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
4103
4172
|
GET_SEARCH_SUGGESTIONS,
|
|
4104
4173
|
{
|
|
4105
4174
|
companyId: ctx.companyId,
|
|
4106
|
-
chainId
|
|
4175
|
+
chainId,
|
|
4176
|
+
websiteId: ctx.websiteId,
|
|
4107
4177
|
term,
|
|
4108
4178
|
productLimit: Math.min(limit, 5),
|
|
4109
4179
|
brandLimit: Math.max(limit - 5, 3)
|
|
@@ -4111,8 +4181,29 @@ function createCatalogModule(graphqlUrl, getHeaders, getContext, storageUrl) {
|
|
|
4111
4181
|
getHeaders
|
|
4112
4182
|
);
|
|
4113
4183
|
const suggestions = [];
|
|
4184
|
+
const availability = await getWebsiteAvailabilityByVariantId(
|
|
4185
|
+
graphqlUrl,
|
|
4186
|
+
getHeaders,
|
|
4187
|
+
(data.products ?? []).flatMap(
|
|
4188
|
+
(product) => product.product_variants.map((variant) => variant.id)
|
|
4189
|
+
),
|
|
4190
|
+
chainId,
|
|
4191
|
+
ctx.websiteId
|
|
4192
|
+
);
|
|
4114
4193
|
for (const p of data.products ?? []) {
|
|
4115
|
-
|
|
4194
|
+
const showWithoutStock = p.product_website_publications?.[0]?.show_when_out_of_stock ?? ctx.config?.show_out_of_stock_products === true;
|
|
4195
|
+
const isVisible = p.product_variants.some((variant) => {
|
|
4196
|
+
const hasPrice = resolveProductPricing(
|
|
4197
|
+
selectPublicPrices(
|
|
4198
|
+
variant.product_variant_prices.map(mapPrice),
|
|
4199
|
+
chainId
|
|
4200
|
+
)
|
|
4201
|
+
).currentPrice != null;
|
|
4202
|
+
return hasPrice && (showWithoutStock || availability.get(variant.id)?.inStock === true);
|
|
4203
|
+
});
|
|
4204
|
+
if (isVisible) {
|
|
4205
|
+
suggestions.push({ type: "product", text: p.name, id: p.id });
|
|
4206
|
+
}
|
|
4116
4207
|
}
|
|
4117
4208
|
for (const b of data.brands ?? []) {
|
|
4118
4209
|
suggestions.push({ type: "brand", text: b.name, id: b.id });
|
|
@@ -18,6 +18,17 @@ Aplicar además de los controles comunes.
|
|
|
18
18
|
alterar canonical.
|
|
19
19
|
- Precio, SKU, stock, variante seleccionada, JSON-LD, carrito, WhatsApp y
|
|
20
20
|
eventos deben referirse a la misma variante.
|
|
21
|
+
- Verificar la regla de **productos agotados** del website y las excepciones
|
|
22
|
+
por producto y por web. La regla predeterminada oculta agotados; una excepción
|
|
23
|
+
`true` los muestra, `false` los oculta y `null` hereda la regla. La publicación
|
|
24
|
+
del producto, cadena activa y precio público siguen siendo requisitos. El
|
|
25
|
+
SDK aplica la visibilidad en catálogo, rutas, SEO, filtros, recomendaciones y
|
|
26
|
+
búsqueda: la tienda no debe duplicar ese filtrado ni consultar Hasura.
|
|
27
|
+
- Un producto agotado visible no es comprable: comprobar `inStock: false` y
|
|
28
|
+
`maxPurchasableQuantity: 0` en estado vivo, controles de cantidad y checkout.
|
|
29
|
+
`getProducts({ inStock: true })` debe seguir excluyéndolo. Si el sitio es
|
|
30
|
+
estático, cambiar esta regla exige rebuild para que rutas, sitemap y HTML
|
|
31
|
+
reflejen los productos ahora visibles u ocultos.
|
|
21
32
|
- El HTML inicial debe contener producto, precio y enlaces reales sin depender
|
|
22
33
|
de JavaScript. Después de hidratar, refrescar únicamente estado volátil por
|
|
23
34
|
lotes con `getProductLiveState()` y respetar `maxPurchasableQuantity`.
|
package/transport/documents.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const RESOLVE_WEBSITE_BY_SLUG = "\n query ResolveWebsiteBySlug($slug: String!) {\n websites(\n where: { slug: { _eq: $slug }, is_active: { _eq: true } }\n limit: 1\n ) {\n id\n company_id\n chain_id\n name\n slug\n domain\n config\n }\n }\n";
|
|
2
|
-
export declare const GET_PRODUCTS = "\n query GetProducts(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int = 20\n $offset: Int = 0\n $where: products_bool_exp = {}\n $orderBy: [products_order_by!] = [{ name: asc }]\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n name\n description\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
3
|
-
export declare const GET_PRODUCT_BY_PK = "\n query GetProductByPk(\n $productId: uuid!\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n ) {\n products(\n where: {\n id: { _eq: $productId }\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: 1\n ) {\n id\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n name\n description\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
2
|
+
export declare const GET_PRODUCTS = "\n query GetProducts(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int = 20\n $offset: Int = 0\n $where: products_bool_exp = {}\n $orderBy: [products_order_by!] = [{ name: asc }]\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n name\n description\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
3
|
+
export declare const GET_PRODUCT_BY_PK = "\n query GetProductByPk(\n $productId: uuid!\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n ) {\n products(\n where: {\n id: { _eq: $productId }\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: 1\n ) {\n id\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n name\n description\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
4
4
|
export declare const GET_PRODUCT_BY_SLUG: string;
|
|
5
|
-
export declare const GET_PRODUCT_SEO_ENTRIES = "\n query GetProductSeoEntries(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int!\n $offset: Int!\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n slug: { _is_null: false }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: $limit\n offset: $offset\n order_by: [{ updated_at: desc }, { created_at: desc }]\n ) {\n id\n name\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n created_at\n updated_at\n seo_image_file {\n mimeType\n name\n }\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n";
|
|
5
|
+
export declare const GET_PRODUCT_SEO_ENTRIES = "\n query GetProductSeoEntries(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int!\n $offset: Int!\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n slug: { _is_null: false }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: $limit\n offset: $offset\n order_by: [{ updated_at: desc }, { created_at: desc }]\n ) {\n id\n name\n slug\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n created_at\n updated_at\n seo_image_file {\n mimeType\n name\n }\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n";
|
|
6
6
|
export declare const GET_CATEGORIES = "\n query GetCategories {\n product_categories {\n name\n description\n product_subcategories {\n id\n name\n description\n }\n }\n }\n";
|
|
7
7
|
export declare const GET_CATALOG_CATEGORY_LIST = "\n query GetCatalogCategoryList($companyId: uuid!, $key: String!) {\n list: catalog_category_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $key }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n source_type\n product_category\n product_subcategory_id\n public_label\n public_slug\n sort_order\n category_ref {\n name\n description\n }\n subcategory_ref {\n id\n name\n description\n category\n }\n }\n }\n }\n";
|
|
8
8
|
export declare const GET_CATALOG_ATTRIBUTE_LIST = "\n query GetCatalogAttributeList($companyId: uuid!, $key: String!) {\n list: catalog_attribute_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $key }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
@@ -41,15 +41,15 @@ export declare const GET_PUBLIC_ORDER = "\n mutation GetPublicOrder($websiteId:
|
|
|
41
41
|
export declare const GET_PROFILE = "\n query GetProfile {\n clients {\n id\n party_id\n party {\n first_name\n last_name\n email\n phone_e164\n phone_national_number\n address\n address_complement\n birthdate\n legal_name\n commercial_name\n country_code\n department_code\n municipality_code\n geo_country {\n name\n }\n geo_department {\n name\n }\n geo_municipality {\n name\n }\n shipping_addresses(\n where: { is_primary: { _eq: true } }\n order_by: { created_at: asc }\n limit: 1\n ) {\n address\n address_complement\n country_code\n department_code\n municipality_code\n geo_country {\n name\n }\n geo_department {\n name\n }\n geo_municipality {\n name\n }\n }\n }\n }\n }\n";
|
|
42
42
|
export declare const GET_PROFILE_ADDRESSES = "\n query GetProfileAddresses {\n clients {\n party_id\n party {\n first_name\n last_name\n display_name\n phone_e164\n phone_national_number\n address\n address_complement\n country_code\n department_code\n municipality_code\n geo_country {\n name\n }\n geo_department {\n name\n }\n geo_municipality {\n name\n }\n shipping_addresses(\n order_by: [{ is_primary: desc }, { created_at: asc }]\n ) {\n id\n label\n recipient_name\n phone_e164\n address\n address_complement\n notes\n is_primary\n country_code\n department_code\n municipality_code\n geo_country {\n name\n }\n geo_department {\n name\n }\n geo_municipality {\n name\n }\n }\n }\n }\n }\n";
|
|
43
43
|
export declare const UPDATE_PROFILE = "\n mutation UpdateProfile($partyId: uuid!, $data: business_parties_set_input!) {\n update_business_parties_by_pk(pk_columns: { id: $partyId }, _set: $data) {\n email\n first_name\n last_name\n phone_e164\n phone_national_number\n address\n address_complement\n birthdate\n legal_name\n commercial_name\n country_code\n department_code\n municipality_code\n geo_country {\n name\n }\n geo_department {\n name\n }\n geo_municipality {\n name\n }\n shipping_addresses(\n where: { is_primary: { _eq: true } }\n order_by: { created_at: asc }\n limit: 1\n ) {\n address\n address_complement\n country_code\n department_code\n municipality_code\n geo_country {\n name\n }\n geo_department {\n name\n }\n geo_municipality {\n name\n }\n }\n }\n }\n";
|
|
44
|
-
export declare const GET_PRODUCT_FILTERS = "\n query GetProductFilters(\n $companyId: uuid!\n $chainId: uuid!\n $where: products_bool_exp = {}\n $attributeListKey: String!\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n ) {\n id\n category\n subcategory\n color\n brand {\n id\n name\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n product_variants(where: { is_disabled: { _eq: false } }) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n }\n catalog_attribute_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $attributeListKey }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
45
|
-
export declare const GET_SEARCH_SUGGESTIONS = "\n query GetSearchSuggestions(\n $companyId: uuid!\n $chainId: uuid!\n $term: String!\n $productLimit: Int = 5\n $brandLimit: Int = 3\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n name: { _ilike: $term }\n }\n limit: $productLimit\n order_by: { name: asc }\n ) {\n id\n name\n }\n brands(\n where: {\n company_id: { _eq: $companyId }\n name: { _ilike: $term }\n products: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n limit: $brandLimit\n order_by: { name: asc }\n ) {\n id\n name\n }\n }\n";
|
|
44
|
+
export declare const GET_PRODUCT_FILTERS = "\n query GetProductFilters(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $where: products_bool_exp = {}\n $attributeListKey: String!\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n ) {\n id\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n category\n subcategory\n color\n brand {\n id\n name\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n product_variants(where: { is_disabled: { _eq: false } }) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n }\n catalog_attribute_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $attributeListKey }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
45
|
+
export declare const GET_SEARCH_SUGGESTIONS = "\n query GetSearchSuggestions(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $term: String!\n $productLimit: Int = 5\n $brandLimit: Int = 3\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n name: { _ilike: $term }\n }\n limit: $productLimit\n order_by: { name: asc }\n ) {\n id\n name\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n product_variants(where: { is_disabled: { _eq: false } }) {\n id\n product_variant_prices(\n where: {\n price_type: { _eq: CLIENT }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n }\n brands(\n where: {\n company_id: { _eq: $companyId }\n name: { _ilike: $term }\n products: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n limit: $brandLimit\n order_by: { name: asc }\n ) {\n id\n name\n }\n }\n";
|
|
46
46
|
/** All documents as a named record for the advanced graphql entry point */
|
|
47
47
|
export declare const documents: {
|
|
48
48
|
readonly RESOLVE_WEBSITE_BY_SLUG: "\n query ResolveWebsiteBySlug($slug: String!) {\n websites(\n where: { slug: { _eq: $slug }, is_active: { _eq: true } }\n limit: 1\n ) {\n id\n company_id\n chain_id\n name\n slug\n domain\n config\n }\n }\n";
|
|
49
|
-
readonly GET_PRODUCTS: "\n query GetProducts(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int = 20\n $offset: Int = 0\n $where: products_bool_exp = {}\n $orderBy: [products_order_by!] = [{ name: asc }]\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n name\n description\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
50
|
-
readonly GET_PRODUCT_BY_PK: "\n query GetProductByPk(\n $productId: uuid!\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n ) {\n products(\n where: {\n id: { _eq: $productId }\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: 1\n ) {\n id\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n name\n description\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
49
|
+
readonly GET_PRODUCTS: "\n query GetProducts(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int = 20\n $offset: Int = 0\n $where: products_bool_exp = {}\n $orderBy: [products_order_by!] = [{ name: asc }]\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n name\n description\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
50
|
+
readonly GET_PRODUCT_BY_PK: "\n query GetProductByPk(\n $productId: uuid!\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n ) {\n products(\n where: {\n id: { _eq: $productId }\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: 1\n ) {\n id\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n product_option_group_members(limit: 1) {\n group {\n id\n display_title\n members(\n where: {\n product: {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n product_id\n display_label\n sort_order\n product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n }\n }\n name\n description\n long_description\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n color\n measurement_unit\n created_at\n updated_at\n brand {\n id\n name\n }\n seo_image_file {\n mimeType\n name\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n sku\n barcode\n order\n weight\n depth\n height\n length\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n product_media(order_by: { order: asc }) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_related_products(\n where: {\n related_product: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { sort_order: asc }\n ) {\n id\n related_product_id\n sort_order\n related_product {\n id\n slug\n name\n sku\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n }\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n catalog_attribute_lists(\n where: { company_id: { _eq: $companyId }, status: { _eq: published } }\n order_by: { updated_at: desc }\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
51
51
|
readonly GET_PRODUCT_BY_SLUG: string;
|
|
52
|
-
readonly GET_PRODUCT_SEO_ENTRIES: "\n query GetProductSeoEntries(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int!\n $offset: Int!\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n slug: { _is_null: false }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: $limit\n offset: $offset\n order_by: [{ updated_at: desc }, { created_at: desc }]\n ) {\n id\n name\n slug\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n created_at\n updated_at\n seo_image_file {\n mimeType\n name\n }\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n";
|
|
52
|
+
readonly GET_PRODUCT_SEO_ENTRIES: "\n query GetProductSeoEntries(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $limit: Int!\n $offset: Int!\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n slug: { _is_null: false }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n limit: $limit\n offset: $offset\n order_by: [{ updated_at: desc }, { created_at: desc }]\n ) {\n id\n name\n slug\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n seo_title\n seo_description\n seo_image_file_id\n category\n subcategory\n created_at\n updated_at\n seo_image_file {\n mimeType\n name\n }\n product_media(\n where: { file: { mimeType: { _ilike: \"image/%\" } } }\n order_by: { order: asc }\n limit: 1\n ) {\n id\n file_id\n order\n file {\n mimeType\n name\n }\n }\n product_variants(\n where: { is_disabled: { _eq: false } }\n order_by: { order: asc }\n ) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n";
|
|
53
53
|
readonly GET_CATEGORIES: "\n query GetCategories {\n product_categories {\n name\n description\n product_subcategories {\n id\n name\n description\n }\n }\n }\n";
|
|
54
54
|
readonly GET_CATALOG_CATEGORY_LIST: "\n query GetCatalogCategoryList($companyId: uuid!, $key: String!) {\n list: catalog_category_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $key }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n source_type\n product_category\n product_subcategory_id\n public_label\n public_slug\n sort_order\n category_ref {\n name\n description\n }\n subcategory_ref {\n id\n name\n description\n category\n }\n }\n }\n }\n";
|
|
55
55
|
readonly GET_CATALOG_ATTRIBUTE_LIST: "\n query GetCatalogAttributeList($companyId: uuid!, $key: String!) {\n list: catalog_attribute_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $key }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
@@ -59,8 +59,8 @@ export declare const documents: {
|
|
|
59
59
|
readonly GET_BRANDS: "\n query GetBrands($companyId: uuid!, $chainId: uuid!) {\n brands(\n where: {\n company_id: { _eq: $companyId }\n products: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n order_by: { name: asc }\n ) {\n id\n name\n }\n }\n";
|
|
60
60
|
readonly CHECK_AVAILABILITY: "\n query CheckAvailability(\n $variantIds: [uuid!]!\n $chainId: uuid!\n $websiteId: uuid\n ) {\n websiteProductAvailability(\n product_variant_ids: $variantIds\n chain_id: $chainId\n website_id: $websiteId\n ) {\n product_variant_id\n in_stock\n label\n max_purchasable_quantity\n }\n }\n";
|
|
61
61
|
readonly GET_PRODUCT_LIVE_STATE: "\n query GetProductLiveState(\n $variantIds: [uuid!]!\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n ) {\n product_variants(\n where: {\n id: { _in: $variantIds }\n is_disabled: { _eq: false }\n product: {\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n ) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n websiteProductAvailability(\n product_variant_ids: $variantIds\n chain_id: $chainId\n website_id: $websiteId\n ) {\n product_variant_id\n in_stock\n label\n max_purchasable_quantity\n }\n }\n";
|
|
62
|
-
readonly GET_PRODUCT_FILTERS: "\n query GetProductFilters(\n $companyId: uuid!\n $chainId: uuid!\n $where: products_bool_exp = {}\n $attributeListKey: String!\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n ) {\n id\n category\n subcategory\n color\n brand {\n id\n name\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n product_variants(where: { is_disabled: { _eq: false } }) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n }\n catalog_attribute_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $attributeListKey }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
63
|
-
readonly GET_SEARCH_SUGGESTIONS: "\n query GetSearchSuggestions(\n $companyId: uuid!\n $chainId: uuid!\n $term: String!\n $productLimit: Int = 5\n $brandLimit: Int = 3\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n name: { _ilike: $term }\n }\n limit: $productLimit\n order_by: { name: asc }\n ) {\n id\n name\n }\n brands(\n where: {\n company_id: { _eq: $companyId }\n name: { _ilike: $term }\n products: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n limit: $brandLimit\n order_by: { name: asc }\n ) {\n id\n name\n }\n }\n";
|
|
62
|
+
readonly GET_PRODUCT_FILTERS: "\n query GetProductFilters(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $where: products_bool_exp = {}\n $attributeListKey: String!\n ) {\n products(\n where: {\n _and: [\n { company_id: { _eq: $companyId } }\n {\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n }\n {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n $where\n ]\n }\n ) {\n id\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n category\n subcategory\n color\n brand {\n id\n name\n }\n product_attributes {\n id\n value\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n product_variants(where: { is_disabled: { _eq: false } }) {\n id\n product_variant_prices(\n where: {\n price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n product_variant_attributes(order_by: { order: asc }) {\n id\n value\n order\n attribute_value {\n id\n code\n sort_order\n metadata\n }\n attribute {\n id\n name\n }\n }\n }\n }\n catalog_attribute_lists(\n where: {\n company_id: { _eq: $companyId }\n key: { _eq: $attributeListKey }\n status: { _eq: published }\n }\n limit: 1\n ) {\n id\n key\n name\n description\n status\n items(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_id\n public_label\n public_slug\n sort_order\n attribute {\n id\n name\n type\n }\n values(\n where: { is_visible: { _eq: true } }\n order_by: [{ sort_order: asc }, { public_label: asc }]\n ) {\n id\n attribute_value_id\n public_label\n public_slug\n sort_order\n attribute_value {\n id\n code\n metadata\n }\n }\n }\n }\n }\n";
|
|
63
|
+
readonly GET_SEARCH_SUGGESTIONS: "\n query GetSearchSuggestions(\n $companyId: uuid!\n $chainId: uuid!\n $websiteId: uuid!\n $term: String!\n $productLimit: Int = 5\n $brandLimit: Int = 3\n ) {\n products(\n where: {\n company_id: { _eq: $companyId }\n product_website_publications: {\n website_id: { _eq: $websiteId }\n is_visible: { _eq: true }\n }\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n name: { _ilike: $term }\n }\n limit: $productLimit\n order_by: { name: asc }\n ) {\n id\n name\n product_website_publications(\n where: { website_id: { _eq: $websiteId }, is_visible: { _eq: true } }\n limit: 1\n ) {\n show_when_out_of_stock\n }\n product_variants(where: { is_disabled: { _eq: false } }) {\n id\n product_variant_prices(\n where: {\n price_type: { _eq: CLIENT }\n _or: [\n { chain_id: { _eq: $chainId } }\n { chain_id: { _is_null: true } }\n ]\n }\n ) {\n id\n price\n price_type\n chain_id\n }\n }\n }\n brands(\n where: {\n company_id: { _eq: $companyId }\n name: { _ilike: $term }\n products: {\n chain_products: {\n chain_id: { _eq: $chainId }\n is_enabled: { _eq: true }\n status: { _eq: active }\n }\n }\n }\n limit: $brandLimit\n order_by: { name: asc }\n ) {\n id\n name\n }\n }\n";
|
|
64
64
|
readonly WEBSITE_GET_CONTENT: "\n mutation WebsiteGetContent(\n $websiteId: uuid!\n $key: String\n $categoryKey: String\n $tag: String\n $locale: String\n ) {\n result: websiteGetContent(\n website_id: $websiteId\n key: $key\n category_key: $categoryKey\n tag: $tag\n locale: $locale\n ) {\n success\n errors\n entries {\n \n id\n key\n category_key\n name\n locale\n status\n tags\n content_json\n resolved_fields\n published_at\n updated_at\n content_type {\n id\n key\n name\n kind\n }\n\n }\n }\n }\n";
|
|
65
65
|
readonly WEBSITE_GET_PRODUCT_CONTENT: "\n mutation WebsiteGetProductContent(\n $websiteId: uuid!\n $productId: uuid!\n $locale: String\n ) {\n result: websiteGetProductContent(\n website_id: $websiteId\n product_id: $productId\n locale: $locale\n ) {\n success\n errors\n blocks {\n id\n product_id\n locale\n content_json\n resolved_fields\n sort_order\n updated_at\n content_type {\n id\n key\n name\n kind\n }\n }\n }\n }\n";
|
|
66
66
|
readonly CREATE_CART: "\n mutation CreateCart(\n $websiteId: uuid!\n $cartToken: String\n $contact: WebsiteGuestContactInput\n $fulfillmentFamily: String\n ) {\n websiteCreateCart(\n website_id: $websiteId\n cart_token: $cartToken\n contact: $contact\n fulfillment_family: $fulfillmentFamily\n ) {\n success\n order_id\n cart_token\n cart {\n id\n status\n discount\n tax\n total_without_tax\n total_with_tax\n total_with_discount\n created_at\n updated_at\n volume_pricing {\n enabled\n eligibleQuantity\n appliedPriceType\n appliedMinQuantity\n nextPriceType\n nextMinQuantity\n remainingQuantity\n totalSavings\n }\n items {\n id\n product_variant_id\n quantity\n unit_price\n line_total\n base_unit_price\n unit_savings\n line_savings\n volume_pricing_eligible\n resolved_price_type\n volume_pricing_min_quantity\n product_variant {\n id\n sku\n product {\n id\n name\n }\n prices {\n id\n price\n price_type\n chain_id\n }\n }\n }\n }\n errors\n }\n }\n";
|
package/types.d.ts
CHANGED
|
@@ -345,9 +345,12 @@ export interface Product {
|
|
|
345
345
|
createdAt: string;
|
|
346
346
|
updatedAt: string;
|
|
347
347
|
variants: ProductVariant[];
|
|
348
|
+
/** Per-website exception; null inherits the website's out-of-stock rule. This is not live availability. */
|
|
349
|
+
outOfStockVisibilityOverride?: boolean | null;
|
|
348
350
|
/**
|
|
349
|
-
* Variants visible on a product detail page. Unlike `variants`, this
|
|
350
|
-
* also preserves enabled public-price variants
|
|
351
|
+
* Variants visible on a product detail page. Unlike listing `variants`, this
|
|
352
|
+
* list also preserves enabled public-price variants currently sold out when
|
|
353
|
+
* the website's listing rule hides them.
|
|
351
354
|
*/
|
|
352
355
|
detailVariants?: ProductVariant[];
|
|
353
356
|
media: ProductMedia[];
|