@bacano/sdk 1.1.0 → 1.1.8
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 +98 -12
- package/STOREFRONT_CONSTRUCTION.md +17 -4
- package/STOREFRONT_MARKETING.md +5 -0
- package/STOREFRONT_PERFORMANCE.md +39 -0
- package/STOREFRONT_PREVIEW.md +25 -0
- package/STOREFRONT_PRODUCT_SPECIFICATIONS.md +127 -0
- package/STOREFRONT_VOLUME_PRICING.md +131 -0
- package/client.d.ts +1 -0
- package/graphql.cjs +203 -3
- package/graphql.d.ts +1 -1
- package/graphql.js +203 -3
- package/index.cjs +474 -44
- package/index.d.ts +1 -1
- package/index.js +474 -44
- package/marketing/attribution.d.ts +2 -0
- package/marketing/types.d.ts +2 -0
- package/modules/cart-errors.d.ts +2 -0
- package/modules/cart.d.ts +1 -0
- package/package.json +1 -1
- package/react/hooks.d.ts +1 -0
- package/react/website-gate.d.ts +1 -1
- package/react.cjs +508 -62
- package/react.js +509 -63
- package/skills/bacano-web/SKILL.md +17 -10
- package/skills/bacano-web/references/architecture-runtime.md +109 -0
- package/skills/bacano-web/references/common.md +2 -1
- package/skills/bacano-web/references/report.md +22 -4
- package/skills/bacano-web/scripts/audit-http.mjs +39 -2
- package/transport/documents.d.ts +21 -18
- package/types.d.ts +136 -0
|
@@ -22,11 +22,14 @@ corta y esperar: **“¿Esta web será informativa o una tienda virtual?”**
|
|
|
22
22
|
No aplicar la lista transaccional a una web informativa. Si un sitio híbrido
|
|
23
23
|
permite comprar, clasificarlo como tienda virtual.
|
|
24
24
|
|
|
25
|
-
Después construir
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
Después construir primero la matriz arquitectónica definida en
|
|
26
|
+
[references/architecture-runtime.md](references/architecture-runtime.md):
|
|
27
|
+
catálogo estático, estado dinámico de productos, configuración pública, vista
|
|
28
|
+
previa editorial, marketing/analítica y funciones transaccionales. Clasificar
|
|
29
|
+
cada capacidad como `ACTIVA`, `INACTIVA` o `BLOQUEADA` con evidencia del código,
|
|
30
|
+
build y configuración pública. Añadir debajo las capacidades específicas como
|
|
31
|
+
autenticación, formularios, GA4, Meta, Clarity, catálogo publicitario, cupones,
|
|
32
|
+
pagos y entregas.
|
|
30
33
|
|
|
31
34
|
Una capacidad inactiva no bloquea la salida y sus pruebas son `NO APLICA`, no
|
|
32
35
|
`NO VERIFICADO`. Una capacidad activa y visible debe probarse en proporción a
|
|
@@ -34,16 +37,19 @@ su riesgo.
|
|
|
34
37
|
|
|
35
38
|
## 2. Leer los contratos aplicables
|
|
36
39
|
|
|
37
|
-
Leer siempre [references/common.md](references/common.md)
|
|
40
|
+
Leer siempre [references/common.md](references/common.md) y
|
|
41
|
+
[references/architecture-runtime.md](references/architecture-runtime.md).
|
|
42
|
+
Después leer solo:
|
|
38
43
|
|
|
39
44
|
- [references/informational.md](references/informational.md) para web informativa.
|
|
40
45
|
- [references/storefront.md](references/storefront.md) para tienda virtual.
|
|
41
46
|
|
|
42
47
|
Si `@bacano/sdk` está disponible, leer sus contratos canónicos aplicables antes
|
|
43
48
|
de proponer cambios. Como mínimo revisar `STOREFRONT_LEGAL.md`,
|
|
44
|
-
`STOREFRONT_MARKETING.md
|
|
49
|
+
`STOREFRONT_MARKETING.md`, `STOREFRONT_PERFORMANCE.md` y
|
|
50
|
+
`STOREFRONT_PREVIEW.md`; añadir
|
|
45
51
|
`AUTHENTICATION.md`, `STOREFRONT_LEADS.md`, `STOREFRONT_CLARITY.md` y
|
|
46
|
-
|
|
52
|
+
otros contratos únicamente cuando esas capacidades existan. Leer
|
|
47
53
|
`STOREFRONT_CONSTRUCTION.md` cuando el website permita ocultarse temporalmente.
|
|
48
54
|
|
|
49
55
|
## 3. Auditar sin alterar el sistema
|
|
@@ -61,14 +67,15 @@ ejecutar compras/pagos sin autorización explícita.
|
|
|
61
67
|
5. Comparar router, salida del build y sitemap; ninguna ruta pública debe
|
|
62
68
|
omitirse silenciosamente.
|
|
63
69
|
6. Inspeccionar HTML generado, metadata, JSON-LD, media y enlaces internos.
|
|
64
|
-
7. Si existe un dominio, auditar sus rutas reales
|
|
70
|
+
7. Si existe un dominio o una aplicación ejecutable, auditar sus rutas reales,
|
|
71
|
+
la consola y un trace de red con nombres y conteos de operaciones GraphQL.
|
|
65
72
|
8. Probar vistas representativas desktop y mobile.
|
|
66
73
|
9. Retestar individualmente cada hallazgo antes de considerarlo real.
|
|
67
74
|
|
|
68
75
|
Para una comprobación HTTP inicial puede ejecutarse:
|
|
69
76
|
|
|
70
77
|
```bash
|
|
71
|
-
node <skill-dir>/scripts/audit-http.mjs https://ejemplo.com --max 500
|
|
78
|
+
node <skill-dir>/scripts/audit-http.mjs https://ejemplo.com --max 500 --preview /vista-previa/
|
|
72
79
|
```
|
|
73
80
|
|
|
74
81
|
El script no reemplaza pruebas de navegador, accesibilidad, interacción ni
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Arquitectura SDK y tráfico runtime
|
|
2
|
+
|
|
3
|
+
Usar este control en toda web construida con `@bacano/sdk`. Clasificar primero
|
|
4
|
+
estas seis capacidades, antes de evaluar si su implementación es correcta:
|
|
5
|
+
|
|
6
|
+
| Capacidad | Estado permitido |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| Catálogo estático | `ACTIVA`, `INACTIVA` o `BLOQUEADA` |
|
|
9
|
+
| Precio y disponibilidad dinámicos | `ACTIVA`, `INACTIVA` o `BLOQUEADA` |
|
|
10
|
+
| Configuración pública del website | `ACTIVA`, `INACTIVA` o `BLOQUEADA` |
|
|
11
|
+
| Vista previa editorial | `ACTIVA`, `INACTIVA` o `BLOQUEADA` |
|
|
12
|
+
| Marketing y analítica | `ACTIVA`, `INACTIVA` o `BLOQUEADA` |
|
|
13
|
+
| Funciones transaccionales | `ACTIVA`, `INACTIVA` o `BLOQUEADA` |
|
|
14
|
+
|
|
15
|
+
`INACTIVA` significa que la capacidad está apagada intencionalmente y no hace
|
|
16
|
+
parte del lanzamiento. `BLOQUEADA` significa que el sitio pretende usarla, pero
|
|
17
|
+
falta contrato, configuración o una dependencia necesaria. El resultado de una
|
|
18
|
+
prueba se informa aparte como aprobado, fallido o no verificado.
|
|
19
|
+
|
|
20
|
+
## Static First
|
|
21
|
+
|
|
22
|
+
Contrastar siempre con `STOREFRONT_PERFORMANCE.md`.
|
|
23
|
+
|
|
24
|
+
- Inventariar qué datos nacen en build/servidor y cuáles cambian en runtime.
|
|
25
|
+
- Verificar que catálogo, Content, metadata, rutas, sitemap y JSON-LD se
|
|
26
|
+
materialicen estáticamente cuando corresponda.
|
|
27
|
+
- Inspeccionar el HTML exportado directamente. No aceptar una página que solo
|
|
28
|
+
obtiene contenido después de hidratar.
|
|
29
|
+
- Confirmar un único `BacanoProvider` y un único `BacanoClient` por árbol de
|
|
30
|
+
ejecución. No crear clientes por módulo, hook, ruta o vista previa.
|
|
31
|
+
- Si `public-config` se obtuvo en servidor o build, derivar el contexto con
|
|
32
|
+
`getWebsiteContextFromPublicConfig()` y entregarlo como `initialContext`.
|
|
33
|
+
- No resolver repetidamente el website ni descargar en el navegador productos
|
|
34
|
+
completos que ya están en el snapshot.
|
|
35
|
+
- Actualizar en runtime solo datos volátiles mediante el contrato oficial:
|
|
36
|
+
precio, disponibilidad y `maxPurchasableQuantity`.
|
|
37
|
+
- Agrupar IDs, eliminar duplicados y usar caché/debounce razonables. Respetar el
|
|
38
|
+
máximo documentado por solicitud y conservar el snapshot si falla el refresh.
|
|
39
|
+
- Filtros o paginación dinámicos pueden consultar estructura únicamente cuando
|
|
40
|
+
el diseño publicado lo requiere. Deben usar el SDK y no repetir la descarga
|
|
41
|
+
inicial sin una interacción que lo justifique.
|
|
42
|
+
- No aceptar GraphQL directo, endpoints internos, clientes paralelos ni reglas
|
|
43
|
+
locales que reconstruyan catálogo, inventario o precios.
|
|
44
|
+
|
|
45
|
+
## Trace real del navegador
|
|
46
|
+
|
|
47
|
+
Cuando exista una aplicación ejecutable o un dominio, capturar la red en un
|
|
48
|
+
contexto limpio y registrar por fase:
|
|
49
|
+
|
|
50
|
+
1. carga inicial directa;
|
|
51
|
+
2. navegación interna;
|
|
52
|
+
3. filtro, orden o paginación;
|
|
53
|
+
4. apertura de un detalle representativo.
|
|
54
|
+
|
|
55
|
+
Para cada operación GraphQL registrar `operationName`, cantidad, fase,
|
|
56
|
+
iniciador, código HTTP y tipo de datos solicitado. Comparar payloads para
|
|
57
|
+
detectar la misma operación con las mismas variables. Una repetición sin nueva
|
|
58
|
+
interacción, invalidación o cambio de datos es un duplicado; una revalidación
|
|
59
|
+
documentada no lo es.
|
|
60
|
+
|
|
61
|
+
El informe debe indicar:
|
|
62
|
+
|
|
63
|
+
- número de instancias del cliente;
|
|
64
|
+
- cantidad y nombres de operaciones en la carga inicial;
|
|
65
|
+
- operaciones duplicadas y causa;
|
|
66
|
+
- datos provenientes del HTML/snapshot;
|
|
67
|
+
- datos actualizados en runtime;
|
|
68
|
+
- conclusión explícita sobre Static First.
|
|
69
|
+
|
|
70
|
+
Si no hay navegador disponible, marcar el trace `🧪 NO VERIFICADO`; no inferir
|
|
71
|
+
la ausencia de tráfico solo desde el código.
|
|
72
|
+
|
|
73
|
+
## Vista previa editorial
|
|
74
|
+
|
|
75
|
+
Contrastar siempre con `STOREFRONT_PREVIEW.md`. Si está activa, validar:
|
|
76
|
+
|
|
77
|
+
- una única ruta pública, preferiblemente `/vista-previa/`;
|
|
78
|
+
- `BacanoPreviewShell` desde `@bacano/sdk/react/preview`;
|
|
79
|
+
- el mismo provider y cliente global del storefront;
|
|
80
|
+
- una allowlist finita de rutas editoriales;
|
|
81
|
+
- exclusión de checkout, pagos, cuenta, pedidos y demás rutas transaccionales;
|
|
82
|
+
- los mismos componentes y mappers usados en producción;
|
|
83
|
+
- `noindex, nofollow` y ausencia total del sitemap;
|
|
84
|
+
- carrito, popups, chat y elementos comerciales globales ocultos;
|
|
85
|
+
- ausencia de scripts y requests efectivos de GA4, Meta, Clarity u otros
|
|
86
|
+
proveedores al cargar directamente preview;
|
|
87
|
+
- cero eventos de marketing durante navegación, refresh y errores de preview;
|
|
88
|
+
- estados SDK `idle`, `loading`, `ready` y `error`;
|
|
89
|
+
- resultados visuales `missing` y `unsupported` definidos por el storefront;
|
|
90
|
+
- reintento, refresh forzado, caché y navegación interna;
|
|
91
|
+
- contenido publicado únicamente, mientras el SDK no soporte borradores.
|
|
92
|
+
|
|
93
|
+
Activar preview no puede volver dinámica toda la web pública.
|
|
94
|
+
|
|
95
|
+
## Verificaciones automatizables
|
|
96
|
+
|
|
97
|
+
Automatizar cuando sea razonable:
|
|
98
|
+
|
|
99
|
+
- HTML estático con contenido y enlaces reales;
|
|
100
|
+
- conteo de providers/clientes mediante pruebas de integración;
|
|
101
|
+
- inventario de requests GraphQL sin duplicados;
|
|
102
|
+
- batching, caché y error del estado vivo;
|
|
103
|
+
- `noindex, nofollow` y exclusión del sitemap;
|
|
104
|
+
- ausencia de marketing en preview;
|
|
105
|
+
- allowlist y bloqueo de rutas transaccionales;
|
|
106
|
+
- estados, refresh y caché de preview.
|
|
107
|
+
|
|
108
|
+
No reemplazar un contrato faltante con GraphQL o API directa. Registrarlo como
|
|
109
|
+
brecha del SDK, con evidencia y prueba de aceptación propuesta.
|
|
@@ -10,7 +10,8 @@ función apagada en un bloqueo artificial.
|
|
|
10
10
|
- Identificar framework, modo estático/híbrido/SSR, hosting y dominio canónico.
|
|
11
11
|
- Verificar un único cliente/provider de Bacano y ausencia de GraphQL directo.
|
|
12
12
|
- Si el sitio admite modo construcción, verificar `BacanoWebsiteGate` por fuera
|
|
13
|
-
de auth y marketing, actualización en runtime
|
|
13
|
+
de auth y marketing, fallback estático `<noscript>`, actualización en runtime
|
|
14
|
+
y vista previa temporal.
|
|
14
15
|
- Confirmar que fallos de Content, marketing o servicios externos degradan sin
|
|
15
16
|
vaciar la página ni bloquear navegación.
|
|
16
17
|
- Ejecutar los controles definidos por el proyecto: instalación reproducible,
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
|
|
13
13
|
Antes del dictamen incluir una tabla corta:
|
|
14
14
|
|
|
15
|
-
| Capacidad
|
|
16
|
-
|
|
|
17
|
-
|
|
|
15
|
+
| Capacidad | Estado | ¿Bloquea este lanzamiento? | Evidencia |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| Catálogo estático, estado vivo, public-config, preview, marketing, transacciones | ACTIVA/INACTIVA/BLOQUEADA | Sí/No | configuración, código o prueba |
|
|
18
18
|
|
|
19
|
-
No exigir pruebas a una capacidad `INACTIVA
|
|
19
|
+
No exigir pruebas a una capacidad `INACTIVA`. Una capacidad `BLOQUEADA` debe
|
|
20
|
+
explicar la dependencia ausente y su impacto.
|
|
20
21
|
|
|
21
22
|
## Resultado ejecutivo
|
|
22
23
|
|
|
@@ -45,6 +46,23 @@ ni procesables.
|
|
|
45
46
|
Listar comandos y sus resultados, rutas auditadas, navegadores/viewports y
|
|
46
47
|
flujos externos realmente ejecutados. Separar pruebas locales de producción.
|
|
47
48
|
|
|
49
|
+
## Arquitectura SDK y tráfico runtime
|
|
50
|
+
|
|
51
|
+
Incluir siempre esta sección:
|
|
52
|
+
|
|
53
|
+
| Control | Resultado | Evidencia |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| Instancias de `BacanoClient` y `BacanoProvider` | cantidad | archivos o prueba |
|
|
56
|
+
| Operaciones GraphQL en carga inicial | cantidad y nombres | trace/HAR |
|
|
57
|
+
| Operaciones duplicadas | cantidad, nombres y causa | variables y fase |
|
|
58
|
+
| Datos estáticos | inventario | HTML, snapshot o build |
|
|
59
|
+
| Datos actualizados en runtime | inventario | requests observados |
|
|
60
|
+
| Static First | cumple/no cumple/no verificado | conclusión |
|
|
61
|
+
| Preview | cumple/no cumple/no aplica/no verificado | conclusión |
|
|
62
|
+
|
|
63
|
+
Para cada incumplimiento indicar severidad, efecto y recomendación. No afirmar
|
|
64
|
+
que no hubo requests cuando no se capturó un trace real.
|
|
65
|
+
|
|
48
66
|
## Riesgos y próximos pasos
|
|
49
67
|
|
|
50
68
|
Ordenar por severidad. Cada hallazgo debe incluir alcance, causa confirmada o
|
|
@@ -5,7 +5,7 @@ const baseArg = args[0];
|
|
|
5
5
|
|
|
6
6
|
if (!baseArg || baseArg === "--help") {
|
|
7
7
|
console.log(
|
|
8
|
-
"Usage: node audit-http.mjs <origin-or-url> [--sitemap <url>] [--max <n>] [--delay <ms>]",
|
|
8
|
+
"Usage: node audit-http.mjs <origin-or-url> [--sitemap <url>] [--preview <path-or-url>] [--max <n>] [--delay <ms>]",
|
|
9
9
|
);
|
|
10
10
|
process.exit(baseArg ? 0 : 1);
|
|
11
11
|
}
|
|
@@ -19,6 +19,7 @@ const startUrl = new URL(baseArg);
|
|
|
19
19
|
const maxRoutes = Math.max(1, Number(option("--max", "500")) || 500);
|
|
20
20
|
const delayMs = Math.max(0, Number(option("--delay", "250")) || 0);
|
|
21
21
|
const explicitSitemap = option("--sitemap", null);
|
|
22
|
+
const explicitPreview = option("--preview", null);
|
|
22
23
|
|
|
23
24
|
function sleep(ms) {
|
|
24
25
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -82,6 +83,12 @@ function sameOrigin(url) {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
function comparableRoute(url) {
|
|
87
|
+
const parsed = new URL(url, startUrl);
|
|
88
|
+
const pathname = parsed.pathname.replace(/\/+$/, "") || "/";
|
|
89
|
+
return `${parsed.origin}${pathname}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
85
92
|
function tagAttribute(tag, name) {
|
|
86
93
|
const match = tag.match(
|
|
87
94
|
new RegExp(`\\b${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"),
|
|
@@ -155,6 +162,7 @@ const sitemapCandidates = explicitSitemap
|
|
|
155
162
|
: [new URL("/sitemap.xml", startUrl).href];
|
|
156
163
|
|
|
157
164
|
const routes = new Set([startUrl.href]);
|
|
165
|
+
const sitemapPageUrls = new Set();
|
|
158
166
|
const sitemapReports = [];
|
|
159
167
|
|
|
160
168
|
for (const url of pageUrls(home.body, startUrl)) {
|
|
@@ -179,7 +187,9 @@ while (sitemapCandidates.length > 0) {
|
|
|
179
187
|
}
|
|
180
188
|
|
|
181
189
|
for (const url of urls) {
|
|
182
|
-
if (sameOrigin(url)
|
|
190
|
+
if (!sameOrigin(url)) continue;
|
|
191
|
+
sitemapPageUrls.add(url);
|
|
192
|
+
if (routes.size < maxRoutes) routes.add(url);
|
|
183
193
|
}
|
|
184
194
|
}
|
|
185
195
|
|
|
@@ -216,11 +226,38 @@ const requiredHeaders = [
|
|
|
216
226
|
"permissions-policy",
|
|
217
227
|
];
|
|
218
228
|
|
|
229
|
+
let previewAudit = null;
|
|
230
|
+
if (explicitPreview) {
|
|
231
|
+
const previewUrl = new URL(explicitPreview, startUrl).href;
|
|
232
|
+
if (!sameOrigin(previewUrl)) {
|
|
233
|
+
throw new Error("--preview must belong to the audited origin");
|
|
234
|
+
}
|
|
235
|
+
if (delayMs) await sleep(delayMs);
|
|
236
|
+
const preview = await fetchResult(previewUrl);
|
|
237
|
+
const html = auditHtml(preview.body);
|
|
238
|
+
const robots = html.robots?.toLowerCase() ?? "";
|
|
239
|
+
const sitemapRoutes = new Set(
|
|
240
|
+
[...sitemapPageUrls].map((url) => comparableRoute(url)),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
previewAudit = {
|
|
244
|
+
url: previewUrl,
|
|
245
|
+
finalUrl: preview.finalUrl,
|
|
246
|
+
status: preview.status,
|
|
247
|
+
error: preview.error,
|
|
248
|
+
robots: html.robots,
|
|
249
|
+
noindex: /(?:^|,)\s*noindex(?:\s|,|$)/.test(robots),
|
|
250
|
+
nofollow: /(?:^|,)\s*nofollow(?:\s|,|$)/.test(robots),
|
|
251
|
+
inSitemap: sitemapRoutes.has(comparableRoute(previewUrl)),
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
219
255
|
const output = {
|
|
220
256
|
auditedAt: new Date().toISOString(),
|
|
221
257
|
origin: startUrl.origin,
|
|
222
258
|
discoveredRoutes: routes.size,
|
|
223
259
|
sitemapReports,
|
|
260
|
+
previewAudit,
|
|
224
261
|
summary: {
|
|
225
262
|
successful: pages.filter((page) => page.status === 200).length,
|
|
226
263
|
redirectsOrOther: pages.filter(
|
package/transport/documents.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
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 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
|
|
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";
|
|
4
4
|
export declare const GET_PRODUCT_BY_SLUG: string;
|
|
5
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";
|
|
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";
|
|
@@ -9,16 +9,18 @@ export declare const GET_CATALOG_ATTRIBUTE_LIST = "\n query GetCatalogAttribute
|
|
|
9
9
|
export declare const GET_CONTEXTUAL_CATALOG_ATTRIBUTE_LIST = "\n mutation GetContextualCatalogAttributeList(\n $websiteId: uuid!\n $key: String!\n $onlyApplicable: Boolean\n $filters: WebsiteCatalogFiltersInput\n ) {\n websiteGetAttributeList(\n website_id: $websiteId\n key: $key\n only_applicable: $onlyApplicable\n filters: $filters\n ) {\n success\n errors\n list {\n id\n key\n name\n description\n status\n items {\n id\n attribute_id\n attribute_name\n attribute_type\n public_label\n public_slug\n sort_order\n values {\n id\n attribute_value_id\n code\n public_label\n public_slug\n sort_order\n metadata\n }\n }\n }\n }\n }\n";
|
|
10
10
|
export declare const WEBSITE_GET_CATALOG_PAGE = "\n mutation WebsiteGetCatalogPage(\n $websiteId: uuid!\n $categoryListKey: String!\n $attributeListKey: String!\n $filters: WebsiteCatalogPageFiltersInput\n $include: WebsiteCatalogPageIncludeInput\n ) {\n result: websiteGetCatalogPage(\n website_id: $websiteId\n category_list_key: $categoryListKey\n attribute_list_key: $attributeListKey\n filters: $filters\n include: $include\n ) {\n success\n products\n category_list\n attribute_list\n filters\n brands\n pagination\n applied_filters\n debug\n errors\n }\n }\n";
|
|
11
11
|
export declare const WEBSITE_GET_PRODUCT_RECOMMENDATIONS = "\n mutation WebsiteGetProductRecommendations(\n $websiteId: uuid!\n $productId: uuid!\n $limit: Int\n ) {\n result: websiteGetProductRecommendations(\n website_id: $websiteId\n product_id: $productId\n limit: $limit\n ) {\n success\n products\n strategy\n errors\n }\n }\n";
|
|
12
|
+
export declare const WEBSITE_GET_PRODUCT_SPECIFICATIONS = "\n mutation WebsiteGetProductSpecifications(\n $websiteId: uuid!\n $productIds: [uuid!]!\n ) {\n result: websiteGetProductSpecifications(\n website_id: $websiteId\n product_ids: $productIds\n ) {\n success\n specifications\n errors\n }\n }\n";
|
|
12
13
|
export declare const 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";
|
|
13
14
|
export declare const 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";
|
|
14
15
|
export declare const 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";
|
|
15
|
-
export declare const CHECK_AVAILABILITY = "\n query CheckAvailability($variantIds: [uuid!]
|
|
16
|
-
export declare const 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 ) {\n product_variant_id\n in_stock\n label\n max_purchasable_quantity\n }\n }\n";
|
|
17
|
-
export declare const 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 items {\n id\n product_variant_id\n 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";
|
|
18
|
-
export declare const GET_CART = "\n mutation GetCart($orderId: uuid!, $cartToken: String!) {\n websiteGetCart(order_id: $orderId, cart_token: $cartToken) {\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 items {\n id\n product_variant_id\n 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";
|
|
19
|
-
export declare const START_GUEST_CHECKOUT = "\n mutation StartGuestCheckout(\n $websiteId: uuid!\n $cartToken: String\n $contact: WebsiteGuestContactInput!\n $items: [WebsiteCheckoutItemInput!]!\n $fulfillmentFamily: String\n $marketingAttribution: WebsiteMarketingAttributionInput\n ) {\n websiteStartGuestCheckout(\n website_id: $websiteId\n cart_token: $cartToken\n contact: $contact\n items: $items\n fulfillment_family: $fulfillmentFamily\n marketing_attribution: $marketingAttribution\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 items {\n id\n product_variant_id\n 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";
|
|
20
|
-
export declare const SET_CART_ITEM = "\n mutation SetCartItem(\n $orderId: uuid!\n $cartToken: String!\n $variantId: uuid!\n $quantity: numeric!\n ) {\n websiteSetCartItem(\n order_id: $orderId\n cart_token: $cartToken\n product_variant_id: $variantId\n quantity: $quantity\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 items {\n id\n product_variant_id\n 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";
|
|
21
|
-
export declare const REMOVE_CART_ITEM = "\n mutation RemoveCartItem(\n $orderId: uuid!\n $cartToken: String!\n $itemId: uuid!\n ) {\n websiteRemoveCartItem(\n order_id: $orderId\n cart_token: $cartToken\n item_id: $itemId\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 items {\n id\n product_variant_id\n 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";
|
|
16
|
+
export declare const 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";
|
|
17
|
+
export declare const 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";
|
|
18
|
+
export declare const 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";
|
|
19
|
+
export declare const GET_CART = "\n mutation GetCart($orderId: uuid!, $cartToken: String!) {\n websiteGetCart(order_id: $orderId, cart_token: $cartToken) {\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";
|
|
20
|
+
export declare const START_GUEST_CHECKOUT = "\n mutation StartGuestCheckout(\n $websiteId: uuid!\n $cartToken: String\n $contact: WebsiteGuestContactInput!\n $items: [WebsiteCheckoutItemInput!]!\n $fulfillmentFamily: String\n $marketingAttribution: WebsiteMarketingAttributionInput\n ) {\n websiteStartGuestCheckout(\n website_id: $websiteId\n cart_token: $cartToken\n contact: $contact\n items: $items\n fulfillment_family: $fulfillmentFamily\n marketing_attribution: $marketingAttribution\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";
|
|
21
|
+
export declare const SET_CART_ITEM = "\n mutation SetCartItem(\n $orderId: uuid!\n $cartToken: String!\n $variantId: uuid!\n $quantity: numeric!\n ) {\n websiteSetCartItem(\n order_id: $orderId\n cart_token: $cartToken\n product_variant_id: $variantId\n quantity: $quantity\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";
|
|
22
|
+
export declare const REMOVE_CART_ITEM = "\n mutation RemoveCartItem(\n $orderId: uuid!\n $cartToken: String!\n $itemId: uuid!\n ) {\n websiteRemoveCartItem(\n order_id: $orderId\n cart_token: $cartToken\n item_id: $itemId\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";
|
|
23
|
+
export declare const DISCARD_CART = "\n mutation DiscardCart($orderId: uuid!, $cartToken: String!) {\n websiteDiscardCart(order_id: $orderId, cart_token: $cartToken) {\n success\n order_id\n website_cart_status\n errors\n }\n }\n";
|
|
22
24
|
export declare const CHECKOUT = "\n mutation Checkout(\n $orderId: uuid!\n $cartToken: String!\n $contact: WebsiteGuestContactInput!\n $fulfillmentFamily: String\n $address: WebsiteAddressInput\n $shippingQuoteId: uuid\n $paymentMode: String\n $paymentMethodId: uuid\n $buyerAccountOptIn: Boolean\n $initialPayment: WebsiteInitialPaymentInput\n $marketingAttribution: WebsiteMarketingAttributionInput\n $advertisingConsent: WebsiteAdvertisingConsentInput\n ) {\n websiteCheckout(\n order_id: $orderId\n cart_token: $cartToken\n contact: $contact\n fulfillment_family: $fulfillmentFamily\n address: $address\n shipping_quote_id: $shippingQuoteId\n payment_mode: $paymentMode\n payment_method_id: $paymentMethodId\n buyer_account_opt_in: $buyerAccountOptIn\n initial_payment: $initialPayment\n marketing_attribution: $marketingAttribution\n advertising_consent: $advertisingConsent\n ) {\n success\n order_id\n order_number\n payment_method_id\n public_order_token\n requires_payment_session\n buyer_account_invitation_requested\n errors\n }\n }\n";
|
|
23
25
|
export declare const GET_LOCATION_OPTIONS = "\n mutation GetLocationOptions($websiteId: uuid!) {\n websiteGetLocationOptions(website_id: $websiteId) {\n success\n country_code\n departments {\n department_id\n department_name\n department_code\n municipalities {\n municipality_id\n municipality_name\n municipality_code\n department_id\n department_code\n }\n }\n errors\n }\n }\n";
|
|
24
26
|
export declare const GET_DELIVERY_OPTIONS = "\n mutation GetDeliveryOptions($websiteId: uuid!) {\n websiteGetDeliveryOptions(website_id: $websiteId) {\n success\n delivery_options {\n id\n fulfillment_family\n label\n description\n is_enabled\n pickup_info {\n label\n address\n schedule\n notes\n }\n }\n errors\n }\n }\n";
|
|
@@ -43,8 +45,8 @@ export declare const GET_SEARCH_SUGGESTIONS = "\n query GetSearchSuggestions(\n
|
|
|
43
45
|
/** All documents as a named record for the advanced graphql entry point */
|
|
44
46
|
export declare const documents: {
|
|
45
47
|
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";
|
|
46
|
-
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
|
|
47
|
-
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 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
|
|
48
|
+
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";
|
|
49
|
+
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";
|
|
48
50
|
readonly GET_PRODUCT_BY_SLUG: string;
|
|
49
51
|
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";
|
|
50
52
|
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,17 +56,18 @@ export declare const documents: {
|
|
|
54
56
|
readonly WEBSITE_GET_CATALOG_PAGE: "\n mutation WebsiteGetCatalogPage(\n $websiteId: uuid!\n $categoryListKey: String!\n $attributeListKey: String!\n $filters: WebsiteCatalogPageFiltersInput\n $include: WebsiteCatalogPageIncludeInput\n ) {\n result: websiteGetCatalogPage(\n website_id: $websiteId\n category_list_key: $categoryListKey\n attribute_list_key: $attributeListKey\n filters: $filters\n include: $include\n ) {\n success\n products\n category_list\n attribute_list\n filters\n brands\n pagination\n applied_filters\n debug\n errors\n }\n }\n";
|
|
55
57
|
readonly WEBSITE_GET_PRODUCT_RECOMMENDATIONS: "\n mutation WebsiteGetProductRecommendations(\n $websiteId: uuid!\n $productId: uuid!\n $limit: Int\n ) {\n result: websiteGetProductRecommendations(\n website_id: $websiteId\n product_id: $productId\n limit: $limit\n ) {\n success\n products\n strategy\n errors\n }\n }\n";
|
|
56
58
|
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";
|
|
57
|
-
readonly CHECK_AVAILABILITY: "\n query CheckAvailability($variantIds: [uuid!]
|
|
58
|
-
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 ) {\n product_variant_id\n in_stock\n label\n max_purchasable_quantity\n }\n }\n";
|
|
59
|
+
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";
|
|
60
|
+
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";
|
|
59
61
|
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";
|
|
60
62
|
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";
|
|
61
63
|
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";
|
|
62
64
|
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";
|
|
63
|
-
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 items {\n id\n product_variant_id\n 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";
|
|
64
|
-
readonly GET_CART: "\n mutation GetCart($orderId: uuid!, $cartToken: String!) {\n websiteGetCart(order_id: $orderId, cart_token: $cartToken) {\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 items {\n id\n product_variant_id\n 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";
|
|
65
|
-
readonly START_GUEST_CHECKOUT: "\n mutation StartGuestCheckout(\n $websiteId: uuid!\n $cartToken: String\n $contact: WebsiteGuestContactInput!\n $items: [WebsiteCheckoutItemInput!]!\n $fulfillmentFamily: String\n $marketingAttribution: WebsiteMarketingAttributionInput\n ) {\n websiteStartGuestCheckout(\n website_id: $websiteId\n cart_token: $cartToken\n contact: $contact\n items: $items\n fulfillment_family: $fulfillmentFamily\n marketing_attribution: $marketingAttribution\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 items {\n id\n product_variant_id\n 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";
|
|
66
|
-
readonly SET_CART_ITEM: "\n mutation SetCartItem(\n $orderId: uuid!\n $cartToken: String!\n $variantId: uuid!\n $quantity: numeric!\n ) {\n websiteSetCartItem(\n order_id: $orderId\n cart_token: $cartToken\n product_variant_id: $variantId\n quantity: $quantity\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 items {\n id\n product_variant_id\n 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";
|
|
67
|
-
readonly REMOVE_CART_ITEM: "\n mutation RemoveCartItem(\n $orderId: uuid!\n $cartToken: String!\n $itemId: uuid!\n ) {\n websiteRemoveCartItem(\n order_id: $orderId\n cart_token: $cartToken\n item_id: $itemId\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 items {\n id\n product_variant_id\n 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";
|
|
65
|
+
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";
|
|
66
|
+
readonly GET_CART: "\n mutation GetCart($orderId: uuid!, $cartToken: String!) {\n websiteGetCart(order_id: $orderId, cart_token: $cartToken) {\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";
|
|
67
|
+
readonly START_GUEST_CHECKOUT: "\n mutation StartGuestCheckout(\n $websiteId: uuid!\n $cartToken: String\n $contact: WebsiteGuestContactInput!\n $items: [WebsiteCheckoutItemInput!]!\n $fulfillmentFamily: String\n $marketingAttribution: WebsiteMarketingAttributionInput\n ) {\n websiteStartGuestCheckout(\n website_id: $websiteId\n cart_token: $cartToken\n contact: $contact\n items: $items\n fulfillment_family: $fulfillmentFamily\n marketing_attribution: $marketingAttribution\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";
|
|
68
|
+
readonly SET_CART_ITEM: "\n mutation SetCartItem(\n $orderId: uuid!\n $cartToken: String!\n $variantId: uuid!\n $quantity: numeric!\n ) {\n websiteSetCartItem(\n order_id: $orderId\n cart_token: $cartToken\n product_variant_id: $variantId\n quantity: $quantity\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";
|
|
69
|
+
readonly REMOVE_CART_ITEM: "\n mutation RemoveCartItem(\n $orderId: uuid!\n $cartToken: String!\n $itemId: uuid!\n ) {\n websiteRemoveCartItem(\n order_id: $orderId\n cart_token: $cartToken\n item_id: $itemId\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";
|
|
70
|
+
readonly DISCARD_CART: "\n mutation DiscardCart($orderId: uuid!, $cartToken: String!) {\n websiteDiscardCart(order_id: $orderId, cart_token: $cartToken) {\n success\n order_id\n website_cart_status\n errors\n }\n }\n";
|
|
68
71
|
readonly CHECKOUT: "\n mutation Checkout(\n $orderId: uuid!\n $cartToken: String!\n $contact: WebsiteGuestContactInput!\n $fulfillmentFamily: String\n $address: WebsiteAddressInput\n $shippingQuoteId: uuid\n $paymentMode: String\n $paymentMethodId: uuid\n $buyerAccountOptIn: Boolean\n $initialPayment: WebsiteInitialPaymentInput\n $marketingAttribution: WebsiteMarketingAttributionInput\n $advertisingConsent: WebsiteAdvertisingConsentInput\n ) {\n websiteCheckout(\n order_id: $orderId\n cart_token: $cartToken\n contact: $contact\n fulfillment_family: $fulfillmentFamily\n address: $address\n shipping_quote_id: $shippingQuoteId\n payment_mode: $paymentMode\n payment_method_id: $paymentMethodId\n buyer_account_opt_in: $buyerAccountOptIn\n initial_payment: $initialPayment\n marketing_attribution: $marketingAttribution\n advertising_consent: $advertisingConsent\n ) {\n success\n order_id\n order_number\n payment_method_id\n public_order_token\n requires_payment_session\n buyer_account_invitation_requested\n errors\n }\n }\n";
|
|
69
72
|
readonly GET_LOCATION_OPTIONS: "\n mutation GetLocationOptions($websiteId: uuid!) {\n websiteGetLocationOptions(website_id: $websiteId) {\n success\n country_code\n departments {\n department_id\n department_name\n department_code\n municipalities {\n municipality_id\n municipality_name\n municipality_code\n department_id\n department_code\n }\n }\n errors\n }\n }\n";
|
|
70
73
|
readonly GET_DELIVERY_OPTIONS: "\n mutation GetDeliveryOptions($websiteId: uuid!) {\n websiteGetDeliveryOptions(website_id: $websiteId) {\n success\n delivery_options {\n id\n fulfillment_family\n label\n description\n is_enabled\n pickup_info {\n label\n address\n schedule\n notes\n }\n }\n errors\n }\n }\n";
|