@bacano/sdk 1.0.1 → 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 +439 -18
- package/STOREFRONT_CLARITY.md +140 -0
- package/STOREFRONT_CONSTRUCTION.md +105 -0
- package/STOREFRONT_LEADS.md +130 -0
- package/STOREFRONT_LEGAL.md +66 -0
- package/STOREFRONT_MARKETING.md +291 -0
- package/STOREFRONT_PERFORMANCE.md +304 -0
- package/STOREFRONT_PREVIEW.md +499 -0
- package/STOREFRONT_PRODUCT_SPECIFICATIONS.md +127 -0
- package/STOREFRONT_VOLUME_PRICING.md +131 -0
- package/client.d.ts +8 -1
- package/errors.d.ts +9 -1
- package/graphql.cjs +266 -3
- package/graphql.d.ts +2 -2
- package/graphql.js +266 -3
- package/index.cjs +2035 -255
- package/index.d.ts +8 -6
- package/index.js +2035 -255
- package/marketing/attribution.d.ts +53 -0
- package/marketing/clarity.d.ts +3 -0
- package/marketing/domain.d.ts +1 -0
- package/marketing/ga4.d.ts +2 -0
- package/marketing/index.d.ts +5 -0
- package/marketing/runtime.d.ts +2 -0
- package/marketing/sanitize.d.ts +2 -0
- package/marketing/types.d.ts +111 -0
- package/media.d.ts +45 -2
- package/modules/auth.d.ts +3 -2
- package/modules/availability.d.ts +2 -2
- package/modules/cart-errors.d.ts +2 -0
- package/modules/cart-session.d.ts +2 -2
- package/modules/cart.d.ts +4 -3
- package/modules/catalog.d.ts +15 -3
- package/modules/content.d.ts +2 -2
- package/modules/marketing.d.ts +5 -0
- package/modules/orders.d.ts +2 -2
- package/modules/profile.d.ts +1 -1
- package/modules/static-catalog.d.ts +13 -0
- package/modules/website.d.ts +7 -1
- package/package.json +14 -3
- package/react/context-registry.d.ts +9 -0
- package/react/context.d.ts +1 -1
- package/react/hooks.d.ts +24 -2
- package/react/marketing-context.d.ts +3 -0
- package/react/marketing-provider.d.ts +10 -0
- package/react/preview/cache.d.ts +23 -0
- package/react/preview/context.d.ts +5 -0
- package/react/preview/navigation.d.ts +9 -0
- package/react/preview/provider.d.ts +3 -0
- package/react/preview/shell.d.ts +3 -0
- package/react/preview/toolbar.d.ts +3 -0
- package/react/preview/types.d.ts +60 -0
- package/react/preview.cjs +742 -0
- package/react/preview.d.ts +14 -0
- package/react/preview.js +730 -0
- package/react/website-gate.d.ts +22 -0
- package/react.cjs +3893 -1795
- package/react.d.ts +8 -4
- package/react.js +3891 -1789
- package/skills/bacano-web/SKILL.md +116 -0
- package/skills/bacano-web/agents/openai.yaml +4 -0
- package/skills/bacano-web/references/architecture-runtime.md +109 -0
- package/skills/bacano-web/references/common.md +92 -0
- package/skills/bacano-web/references/informational.md +39 -0
- package/skills/bacano-web/references/report.md +70 -0
- package/skills/bacano-web/references/storefront.md +116 -0
- package/skills/bacano-web/scripts/audit-http.mjs +284 -0
- package/skills/bacano-web/scripts/cli.mjs +222 -0
- package/skills/bacano-web/scripts/postinstall.mjs +8 -0
- package/transport/documents.d.ts +23 -18
- package/transport/graphql.d.ts +13 -1
- package/types.d.ts +338 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Precios por cantidad en storefronts
|
|
2
|
+
|
|
3
|
+
Este documento define el contrato oficial para mayoreo por cantidad en sitios
|
|
4
|
+
web Bacano. El storefront no calcula, copia ni fuerza precios: Bacano resuelve
|
|
5
|
+
el carrito completo en cada cambio y vuelve a validarlo al cerrar la compra.
|
|
6
|
+
|
|
7
|
+
## Configuración
|
|
8
|
+
|
|
9
|
+
La política pertenece a un `website_id`. El comercio activa un primer umbral
|
|
10
|
+
para `WHOLESALE` y, si tiene habilitado ese tipo de precio, puede configurar un
|
|
11
|
+
segundo umbral para `WHOLESALE_2`.
|
|
12
|
+
|
|
13
|
+
- Solo participan variantes con un precio `WHOLESALE` válido para la sucursal
|
|
14
|
+
del website.
|
|
15
|
+
- La cantidad elegible es la suma de unidades participantes del carrito, no la
|
|
16
|
+
cantidad de una única línea.
|
|
17
|
+
- Al alcanzar el segundo nivel, una variante sin `WHOLESALE_2` conserva su
|
|
18
|
+
precio `WHOLESALE`.
|
|
19
|
+
- Un nivel mayorista nunca reemplaza un precio regular o promocional menor.
|
|
20
|
+
- Las variantes sin precio mayorista siguen comprándose a su mejor precio
|
|
21
|
+
regular, pero no suman para alcanzar el umbral.
|
|
22
|
+
|
|
23
|
+
## Configuración pública
|
|
24
|
+
|
|
25
|
+
`getWebsitePublicConfig()` expone únicamente los umbrales públicos necesarios
|
|
26
|
+
para comunicar la promoción:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
const config = await getWebsitePublicConfig({
|
|
30
|
+
apiUrl,
|
|
31
|
+
websiteSlug,
|
|
32
|
+
origin,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
config.volumePricing;
|
|
36
|
+
// {
|
|
37
|
+
// schemaVersion: 1,
|
|
38
|
+
// enabled: true,
|
|
39
|
+
// tiers: [
|
|
40
|
+
// { priceType: "WHOLESALE", minQuantity: 3 },
|
|
41
|
+
// { priceType: "WHOLESALE_2", minQuantity: 6 }
|
|
42
|
+
// ]
|
|
43
|
+
// }
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Este bloque sirve para mensajes generales. No debe usarse para calcular el
|
|
47
|
+
precio final porque la elegibilidad depende de los precios vigentes de cada
|
|
48
|
+
variante y del carrito completo.
|
|
49
|
+
|
|
50
|
+
## Respuesta del carrito
|
|
51
|
+
|
|
52
|
+
Las operaciones `cart.getOrCreate()`, `cart.get()`, `cart.setItem()`,
|
|
53
|
+
`cart.removeItem()` y `cart.startCheckout()` devuelven:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
cart.volumePricing;
|
|
57
|
+
// {
|
|
58
|
+
// enabled: true,
|
|
59
|
+
// eligibleQuantity: 4,
|
|
60
|
+
// appliedPriceType: "WHOLESALE",
|
|
61
|
+
// appliedMinQuantity: 3,
|
|
62
|
+
// nextPriceType: "WHOLESALE_2",
|
|
63
|
+
// nextMinQuantity: 6,
|
|
64
|
+
// remainingQuantity: 2,
|
|
65
|
+
// totalSavings: 24000
|
|
66
|
+
// }
|
|
67
|
+
|
|
68
|
+
cart.items[0];
|
|
69
|
+
// {
|
|
70
|
+
// baseUnitPrice: 50000,
|
|
71
|
+
// unitPrice: 42000,
|
|
72
|
+
// lineTotal: 126000,
|
|
73
|
+
// unitSavings: 8000,
|
|
74
|
+
// lineSavings: 24000,
|
|
75
|
+
// volumePricingEligible: true,
|
|
76
|
+
// resolvedPriceType: "WHOLESALE",
|
|
77
|
+
// volumePricingMinQuantity: 3,
|
|
78
|
+
// ...
|
|
79
|
+
// }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
El storefront debe pintar `unitPrice`, `lineTotal` y los totales retornados por
|
|
83
|
+
Bacano. `baseUnitPrice`, `unitSavings`, `lineSavings` y `totalSavings` permiten
|
|
84
|
+
explicar el cambio sin reconstruir reglas. `volumePricingEligible` indica si la
|
|
85
|
+
línea participa en los umbrales, incluso antes de alcanzar uno.
|
|
86
|
+
|
|
87
|
+
Al cambiar una cantidad debe esperar la respuesta de `setItem()` antes de
|
|
88
|
+
confirmar visualmente el nuevo total. La experiencia recomendada es mostrar el
|
|
89
|
+
precio anterior tachado cuando exista ahorro, el nivel aplicado y un mensaje
|
|
90
|
+
como “Agrega 2 unidades más para obtener Mayorista 2” usando
|
|
91
|
+
`remainingQuantity`. Si `volumePricing.enabled` es `false`, no debe mostrarse
|
|
92
|
+
ninguna comunicación de mayoreo.
|
|
93
|
+
|
|
94
|
+
## Sincronización antes del checkout
|
|
95
|
+
|
|
96
|
+
El precio por cantidad no depende del correo ni de la identidad del comprador.
|
|
97
|
+
Para mostrarlo desde el carrito, el storefront debe crear o recuperar la sesión
|
|
98
|
+
privada con `cart.getOrCreate()` al agregar la primera unidad y utilizar
|
|
99
|
+
`cart.setItem()` después de cada cambio. `cart.startCheckout()` incorpora el
|
|
100
|
+
contacto y vuelve a validar los mismos precios de forma autoritativa.
|
|
101
|
+
|
|
102
|
+
El carrito privado puede existir sin correo, teléfono ni identidad. Su creación
|
|
103
|
+
no inicia la logística: Bacano crea o sincroniza la entrega únicamente cuando
|
|
104
|
+
el storefront llama `cart.startCheckout()` con la modalidad elegida.
|
|
105
|
+
|
|
106
|
+
El storefront conserva bajo su responsabilidad los datos visuales que necesite
|
|
107
|
+
(imagen, slug o atributos), pero no precios ni totales autoritativos. Para
|
|
108
|
+
vaciar el carrito debe llamar `cart.clear()`: Bacano lo marca como descartado y
|
|
109
|
+
el SDK elimina exclusivamente su sesión privada. Quitar la última línea produce
|
|
110
|
+
el mismo cierre automáticamente. Ninguna de estas operaciones borra el carrito
|
|
111
|
+
local propio del storefront; ese almacenamiento se limpia después de recibir la
|
|
112
|
+
confirmación del SDK.
|
|
113
|
+
|
|
114
|
+
## Checkout y concurrencia
|
|
115
|
+
|
|
116
|
+
El checkout vuelve a resolver precios, stock y cupones de forma autoritativa.
|
|
117
|
+
Los valores locales son únicamente una vista optimista. Una modificación de
|
|
118
|
+
precios, inventario o política entre la vista del carrito y el checkout puede
|
|
119
|
+
producir una respuesta actualizada o un error comercial controlado.
|
|
120
|
+
|
|
121
|
+
Los pedidos conservan por línea el tipo de precio resuelto y el umbral aplicado
|
|
122
|
+
como evidencia. La configuración futura del website no cambia el pedido ya
|
|
123
|
+
confirmado.
|
|
124
|
+
|
|
125
|
+
## Prohibiciones
|
|
126
|
+
|
|
127
|
+
- No calcular umbrales en Baby Rex ni en otro storefront.
|
|
128
|
+
- No seleccionar `WHOLESALE` directamente desde el navegador.
|
|
129
|
+
- No enviar precios en operaciones de carrito o checkout.
|
|
130
|
+
- No consultar Hasura ni tablas de precios mediante GraphQL directo.
|
|
131
|
+
- No aplicar descuentos paralelos para simular mayoreo.
|
package/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BacanoClientConfig, BacanoClientContext, Brand, Cart, CartItem, CatalogAttributeList,
|
|
1
|
+
import type { BacanoClientConfig, BacanoClientContext, Brand, Cart, CartItem, CatalogAttributeList, CatalogCategoryList, CatalogPageResult, CheckoutResult, CheckoutSubmission, ContentEntry, CustomerAddress, CustomerProfile, CustomerProfileUpdate, GetAttributeListOptions, GetCatalogPageOptions, GetCategoryListOptions, GetContentOptions, GetOrdersOptions, GetProductFiltersOptions, GetProductRecommendationsOptions, GetProductSeoEntriesOptions, GetProductsOptions, GetSearchSuggestionsOptions, GetStaticCatalogBootstrapOptions, GetStaticCatalogSnapshotOptions, Order, Product, ProductAvailability, ProductCategory, ProductContentBlock, ProductFilters, ProductRecommendationsResult, ProductSeoEntriesResult, ProductVariantLiveState, PublicOrder, PublicOrderLookupInput, SearchSuggestion, StartGuestCheckoutInput, StaticCatalogBootstrap, StaticCatalogSnapshot, WaitForPublicOrderPaymentInput, WebsiteCampaignCaptureInput, WebsiteCampaignCaptureResult, WebsiteCheckoutAddress, WebsiteCheckoutItem, WebsiteCouponActionResult, WebsiteDeliveryOption, WebsiteFreeShippingProgress, WebsiteFulfillmentFamily, WebsiteGuestContact, WebsiteLocationOptions, WebsitePaymentMethod, WebsitePaymentOption, WebsitePaymentSessionResult, WebsiteShippingPolicy, WebsiteShippingQuote } from "./types";
|
|
2
2
|
export interface BacanoClient {
|
|
3
3
|
/** Initialize the client and resolve its website context. */
|
|
4
4
|
init(): Promise<void>;
|
|
@@ -12,8 +12,11 @@ export interface BacanoClient {
|
|
|
12
12
|
};
|
|
13
13
|
catalog: {
|
|
14
14
|
getCatalogPage(opts: GetCatalogPageOptions): Promise<CatalogPageResult>;
|
|
15
|
+
getStaticCatalogSnapshot(opts: GetStaticCatalogSnapshotOptions): Promise<StaticCatalogSnapshot>;
|
|
16
|
+
getStaticCatalogBootstrap(opts: GetStaticCatalogBootstrapOptions): Promise<StaticCatalogBootstrap>;
|
|
15
17
|
getProductSeoEntries(opts?: GetProductSeoEntriesOptions): Promise<ProductSeoEntriesResult>;
|
|
16
18
|
getProductRecommendations(opts: GetProductRecommendationsOptions): Promise<ProductRecommendationsResult>;
|
|
19
|
+
getProductLiveState(productVariantIds: string[]): Promise<ProductVariantLiveState[]>;
|
|
17
20
|
getProducts(opts?: GetProductsOptions): Promise<Product[]>;
|
|
18
21
|
getProduct(productId: string): Promise<Product | null>;
|
|
19
22
|
getProductBySlug(slug: string): Promise<Product | null>;
|
|
@@ -42,6 +45,7 @@ export interface BacanoClient {
|
|
|
42
45
|
quantity: number;
|
|
43
46
|
}>;
|
|
44
47
|
removeItem(cartItemId: string): Promise<Cart>;
|
|
48
|
+
clear(): Promise<void>;
|
|
45
49
|
};
|
|
46
50
|
checkout: {
|
|
47
51
|
getLocationOptions(): Promise<WebsiteLocationOptions>;
|
|
@@ -92,5 +96,8 @@ export interface BacanoClient {
|
|
|
92
96
|
getAddresses(): Promise<CustomerAddress[]>;
|
|
93
97
|
update(data: CustomerProfileUpdate): Promise<CustomerProfile>;
|
|
94
98
|
};
|
|
99
|
+
marketing: {
|
|
100
|
+
captureLead(input: WebsiteCampaignCaptureInput): Promise<WebsiteCampaignCaptureResult>;
|
|
101
|
+
};
|
|
95
102
|
}
|
|
96
103
|
export declare function createBacanoClient(config: BacanoClientConfig): BacanoClient;
|
package/errors.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export declare class WebsiteError extends Error {
|
|
2
2
|
readonly code: string;
|
|
3
|
-
|
|
3
|
+
readonly status: number | null;
|
|
4
|
+
readonly retryAfterSeconds: number | null;
|
|
5
|
+
constructor(message: string, code?: string, options?: {
|
|
6
|
+
status?: number;
|
|
7
|
+
retryAfterSeconds?: number;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export declare class RateLimitError extends WebsiteError {
|
|
11
|
+
constructor(message: string, retryAfterSeconds: number);
|
|
4
12
|
}
|
|
5
13
|
export declare class NotInitializedError extends WebsiteError {
|
|
6
14
|
constructor();
|
package/graphql.cjs
CHANGED
|
@@ -206,7 +206,6 @@ var GET_PRODUCTS = (
|
|
|
206
206
|
) {
|
|
207
207
|
id
|
|
208
208
|
related_product_id
|
|
209
|
-
display_label
|
|
210
209
|
sort_order
|
|
211
210
|
related_product {
|
|
212
211
|
id
|
|
@@ -228,6 +227,52 @@ var GET_PRODUCTS = (
|
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
229
|
}
|
|
230
|
+
product_option_group_members(limit: 1) {
|
|
231
|
+
group {
|
|
232
|
+
id
|
|
233
|
+
display_title
|
|
234
|
+
members(
|
|
235
|
+
where: {
|
|
236
|
+
product: {
|
|
237
|
+
product_website_publications: {
|
|
238
|
+
website_id: { _eq: $websiteId }
|
|
239
|
+
is_visible: { _eq: true }
|
|
240
|
+
}
|
|
241
|
+
chain_products: {
|
|
242
|
+
chain_id: { _eq: $chainId }
|
|
243
|
+
is_enabled: { _eq: true }
|
|
244
|
+
status: { _eq: active }
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
order_by: { sort_order: asc }
|
|
249
|
+
) {
|
|
250
|
+
id
|
|
251
|
+
product_id
|
|
252
|
+
display_label
|
|
253
|
+
sort_order
|
|
254
|
+
product {
|
|
255
|
+
id
|
|
256
|
+
slug
|
|
257
|
+
name
|
|
258
|
+
sku
|
|
259
|
+
product_media(
|
|
260
|
+
where: { file: { mimeType: { _ilike: "image/%" } } }
|
|
261
|
+
order_by: { order: asc }
|
|
262
|
+
limit: 1
|
|
263
|
+
) {
|
|
264
|
+
id
|
|
265
|
+
file_id
|
|
266
|
+
order
|
|
267
|
+
file {
|
|
268
|
+
mimeType
|
|
269
|
+
name
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
231
276
|
product_attributes {
|
|
232
277
|
id
|
|
233
278
|
value
|
|
@@ -312,6 +357,52 @@ var GET_PRODUCT_BY_PK = (
|
|
|
312
357
|
limit: 1
|
|
313
358
|
) {
|
|
314
359
|
id
|
|
360
|
+
product_option_group_members(limit: 1) {
|
|
361
|
+
group {
|
|
362
|
+
id
|
|
363
|
+
display_title
|
|
364
|
+
members(
|
|
365
|
+
where: {
|
|
366
|
+
product: {
|
|
367
|
+
product_website_publications: {
|
|
368
|
+
website_id: { _eq: $websiteId }
|
|
369
|
+
is_visible: { _eq: true }
|
|
370
|
+
}
|
|
371
|
+
chain_products: {
|
|
372
|
+
chain_id: { _eq: $chainId }
|
|
373
|
+
is_enabled: { _eq: true }
|
|
374
|
+
status: { _eq: active }
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
order_by: { sort_order: asc }
|
|
379
|
+
) {
|
|
380
|
+
id
|
|
381
|
+
product_id
|
|
382
|
+
display_label
|
|
383
|
+
sort_order
|
|
384
|
+
product {
|
|
385
|
+
id
|
|
386
|
+
slug
|
|
387
|
+
name
|
|
388
|
+
sku
|
|
389
|
+
product_media(
|
|
390
|
+
where: { file: { mimeType: { _ilike: "image/%" } } }
|
|
391
|
+
order_by: { order: asc }
|
|
392
|
+
limit: 1
|
|
393
|
+
) {
|
|
394
|
+
id
|
|
395
|
+
file_id
|
|
396
|
+
order
|
|
397
|
+
file {
|
|
398
|
+
mimeType
|
|
399
|
+
name
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
315
406
|
name
|
|
316
407
|
description
|
|
317
408
|
long_description
|
|
@@ -398,7 +489,6 @@ var GET_PRODUCT_BY_PK = (
|
|
|
398
489
|
) {
|
|
399
490
|
id
|
|
400
491
|
related_product_id
|
|
401
|
-
display_label
|
|
402
492
|
sort_order
|
|
403
493
|
related_product {
|
|
404
494
|
id
|
|
@@ -880,14 +970,76 @@ var WEBSITE_GET_PRODUCT_CONTENT = (
|
|
|
880
970
|
var CHECK_AVAILABILITY = (
|
|
881
971
|
/* GraphQL */
|
|
882
972
|
`
|
|
883
|
-
query CheckAvailability(
|
|
973
|
+
query CheckAvailability(
|
|
974
|
+
$variantIds: [uuid!]!
|
|
975
|
+
$chainId: uuid!
|
|
976
|
+
$websiteId: uuid
|
|
977
|
+
) {
|
|
978
|
+
websiteProductAvailability(
|
|
979
|
+
product_variant_ids: $variantIds
|
|
980
|
+
chain_id: $chainId
|
|
981
|
+
website_id: $websiteId
|
|
982
|
+
) {
|
|
983
|
+
product_variant_id
|
|
984
|
+
in_stock
|
|
985
|
+
label
|
|
986
|
+
max_purchasable_quantity
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
`
|
|
990
|
+
);
|
|
991
|
+
var GET_PRODUCT_LIVE_STATE = (
|
|
992
|
+
/* GraphQL */
|
|
993
|
+
`
|
|
994
|
+
query GetProductLiveState(
|
|
995
|
+
$variantIds: [uuid!]!
|
|
996
|
+
$companyId: uuid!
|
|
997
|
+
$chainId: uuid!
|
|
998
|
+
$websiteId: uuid!
|
|
999
|
+
) {
|
|
1000
|
+
product_variants(
|
|
1001
|
+
where: {
|
|
1002
|
+
id: { _in: $variantIds }
|
|
1003
|
+
is_disabled: { _eq: false }
|
|
1004
|
+
product: {
|
|
1005
|
+
company_id: { _eq: $companyId }
|
|
1006
|
+
product_website_publications: {
|
|
1007
|
+
website_id: { _eq: $websiteId }
|
|
1008
|
+
is_visible: { _eq: true }
|
|
1009
|
+
}
|
|
1010
|
+
chain_products: {
|
|
1011
|
+
chain_id: { _eq: $chainId }
|
|
1012
|
+
is_enabled: { _eq: true }
|
|
1013
|
+
status: { _eq: active }
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
) {
|
|
1018
|
+
id
|
|
1019
|
+
product_variant_prices(
|
|
1020
|
+
where: {
|
|
1021
|
+
price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }
|
|
1022
|
+
_or: [
|
|
1023
|
+
{ chain_id: { _eq: $chainId } }
|
|
1024
|
+
{ chain_id: { _is_null: true } }
|
|
1025
|
+
]
|
|
1026
|
+
}
|
|
1027
|
+
) {
|
|
1028
|
+
id
|
|
1029
|
+
price
|
|
1030
|
+
price_type
|
|
1031
|
+
chain_id
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
884
1034
|
websiteProductAvailability(
|
|
885
1035
|
product_variant_ids: $variantIds
|
|
886
1036
|
chain_id: $chainId
|
|
1037
|
+
website_id: $websiteId
|
|
887
1038
|
) {
|
|
888
1039
|
product_variant_id
|
|
889
1040
|
in_stock
|
|
890
1041
|
label
|
|
1042
|
+
max_purchasable_quantity
|
|
891
1043
|
}
|
|
892
1044
|
}
|
|
893
1045
|
`
|
|
@@ -920,10 +1072,28 @@ var CREATE_CART = (
|
|
|
920
1072
|
total_with_discount
|
|
921
1073
|
created_at
|
|
922
1074
|
updated_at
|
|
1075
|
+
volume_pricing {
|
|
1076
|
+
enabled
|
|
1077
|
+
eligibleQuantity
|
|
1078
|
+
appliedPriceType
|
|
1079
|
+
appliedMinQuantity
|
|
1080
|
+
nextPriceType
|
|
1081
|
+
nextMinQuantity
|
|
1082
|
+
remainingQuantity
|
|
1083
|
+
totalSavings
|
|
1084
|
+
}
|
|
923
1085
|
items {
|
|
924
1086
|
id
|
|
925
1087
|
product_variant_id
|
|
926
1088
|
quantity
|
|
1089
|
+
unit_price
|
|
1090
|
+
line_total
|
|
1091
|
+
base_unit_price
|
|
1092
|
+
unit_savings
|
|
1093
|
+
line_savings
|
|
1094
|
+
volume_pricing_eligible
|
|
1095
|
+
resolved_price_type
|
|
1096
|
+
volume_pricing_min_quantity
|
|
927
1097
|
product_variant {
|
|
928
1098
|
id
|
|
929
1099
|
sku
|
|
@@ -963,10 +1133,28 @@ var GET_CART = (
|
|
|
963
1133
|
total_with_discount
|
|
964
1134
|
created_at
|
|
965
1135
|
updated_at
|
|
1136
|
+
volume_pricing {
|
|
1137
|
+
enabled
|
|
1138
|
+
eligibleQuantity
|
|
1139
|
+
appliedPriceType
|
|
1140
|
+
appliedMinQuantity
|
|
1141
|
+
nextPriceType
|
|
1142
|
+
nextMinQuantity
|
|
1143
|
+
remainingQuantity
|
|
1144
|
+
totalSavings
|
|
1145
|
+
}
|
|
966
1146
|
items {
|
|
967
1147
|
id
|
|
968
1148
|
product_variant_id
|
|
969
1149
|
quantity
|
|
1150
|
+
unit_price
|
|
1151
|
+
line_total
|
|
1152
|
+
base_unit_price
|
|
1153
|
+
unit_savings
|
|
1154
|
+
line_savings
|
|
1155
|
+
volume_pricing_eligible
|
|
1156
|
+
resolved_price_type
|
|
1157
|
+
volume_pricing_min_quantity
|
|
970
1158
|
product_variant {
|
|
971
1159
|
id
|
|
972
1160
|
sku
|
|
@@ -997,6 +1185,7 @@ var START_GUEST_CHECKOUT = (
|
|
|
997
1185
|
$contact: WebsiteGuestContactInput!
|
|
998
1186
|
$items: [WebsiteCheckoutItemInput!]!
|
|
999
1187
|
$fulfillmentFamily: String
|
|
1188
|
+
$marketingAttribution: WebsiteMarketingAttributionInput
|
|
1000
1189
|
) {
|
|
1001
1190
|
websiteStartGuestCheckout(
|
|
1002
1191
|
website_id: $websiteId
|
|
@@ -1004,6 +1193,7 @@ var START_GUEST_CHECKOUT = (
|
|
|
1004
1193
|
contact: $contact
|
|
1005
1194
|
items: $items
|
|
1006
1195
|
fulfillment_family: $fulfillmentFamily
|
|
1196
|
+
marketing_attribution: $marketingAttribution
|
|
1007
1197
|
) {
|
|
1008
1198
|
success
|
|
1009
1199
|
order_id
|
|
@@ -1018,10 +1208,28 @@ var START_GUEST_CHECKOUT = (
|
|
|
1018
1208
|
total_with_discount
|
|
1019
1209
|
created_at
|
|
1020
1210
|
updated_at
|
|
1211
|
+
volume_pricing {
|
|
1212
|
+
enabled
|
|
1213
|
+
eligibleQuantity
|
|
1214
|
+
appliedPriceType
|
|
1215
|
+
appliedMinQuantity
|
|
1216
|
+
nextPriceType
|
|
1217
|
+
nextMinQuantity
|
|
1218
|
+
remainingQuantity
|
|
1219
|
+
totalSavings
|
|
1220
|
+
}
|
|
1021
1221
|
items {
|
|
1022
1222
|
id
|
|
1023
1223
|
product_variant_id
|
|
1024
1224
|
quantity
|
|
1225
|
+
unit_price
|
|
1226
|
+
line_total
|
|
1227
|
+
base_unit_price
|
|
1228
|
+
unit_savings
|
|
1229
|
+
line_savings
|
|
1230
|
+
volume_pricing_eligible
|
|
1231
|
+
resolved_price_type
|
|
1232
|
+
volume_pricing_min_quantity
|
|
1025
1233
|
product_variant {
|
|
1026
1234
|
id
|
|
1027
1235
|
sku
|
|
@@ -1071,10 +1279,28 @@ var SET_CART_ITEM = (
|
|
|
1071
1279
|
total_with_discount
|
|
1072
1280
|
created_at
|
|
1073
1281
|
updated_at
|
|
1282
|
+
volume_pricing {
|
|
1283
|
+
enabled
|
|
1284
|
+
eligibleQuantity
|
|
1285
|
+
appliedPriceType
|
|
1286
|
+
appliedMinQuantity
|
|
1287
|
+
nextPriceType
|
|
1288
|
+
nextMinQuantity
|
|
1289
|
+
remainingQuantity
|
|
1290
|
+
totalSavings
|
|
1291
|
+
}
|
|
1074
1292
|
items {
|
|
1075
1293
|
id
|
|
1076
1294
|
product_variant_id
|
|
1077
1295
|
quantity
|
|
1296
|
+
unit_price
|
|
1297
|
+
line_total
|
|
1298
|
+
base_unit_price
|
|
1299
|
+
unit_savings
|
|
1300
|
+
line_savings
|
|
1301
|
+
volume_pricing_eligible
|
|
1302
|
+
resolved_price_type
|
|
1303
|
+
volume_pricing_min_quantity
|
|
1078
1304
|
product_variant {
|
|
1079
1305
|
id
|
|
1080
1306
|
sku
|
|
@@ -1122,10 +1348,28 @@ var REMOVE_CART_ITEM = (
|
|
|
1122
1348
|
total_with_discount
|
|
1123
1349
|
created_at
|
|
1124
1350
|
updated_at
|
|
1351
|
+
volume_pricing {
|
|
1352
|
+
enabled
|
|
1353
|
+
eligibleQuantity
|
|
1354
|
+
appliedPriceType
|
|
1355
|
+
appliedMinQuantity
|
|
1356
|
+
nextPriceType
|
|
1357
|
+
nextMinQuantity
|
|
1358
|
+
remainingQuantity
|
|
1359
|
+
totalSavings
|
|
1360
|
+
}
|
|
1125
1361
|
items {
|
|
1126
1362
|
id
|
|
1127
1363
|
product_variant_id
|
|
1128
1364
|
quantity
|
|
1365
|
+
unit_price
|
|
1366
|
+
line_total
|
|
1367
|
+
base_unit_price
|
|
1368
|
+
unit_savings
|
|
1369
|
+
line_savings
|
|
1370
|
+
volume_pricing_eligible
|
|
1371
|
+
resolved_price_type
|
|
1372
|
+
volume_pricing_min_quantity
|
|
1129
1373
|
product_variant {
|
|
1130
1374
|
id
|
|
1131
1375
|
sku
|
|
@@ -1147,6 +1391,19 @@ var REMOVE_CART_ITEM = (
|
|
|
1147
1391
|
}
|
|
1148
1392
|
`
|
|
1149
1393
|
);
|
|
1394
|
+
var DISCARD_CART = (
|
|
1395
|
+
/* GraphQL */
|
|
1396
|
+
`
|
|
1397
|
+
mutation DiscardCart($orderId: uuid!, $cartToken: String!) {
|
|
1398
|
+
websiteDiscardCart(order_id: $orderId, cart_token: $cartToken) {
|
|
1399
|
+
success
|
|
1400
|
+
order_id
|
|
1401
|
+
website_cart_status
|
|
1402
|
+
errors
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
`
|
|
1406
|
+
);
|
|
1150
1407
|
var CHECKOUT = (
|
|
1151
1408
|
/* GraphQL */
|
|
1152
1409
|
`
|
|
@@ -1161,6 +1418,8 @@ var CHECKOUT = (
|
|
|
1161
1418
|
$paymentMethodId: uuid
|
|
1162
1419
|
$buyerAccountOptIn: Boolean
|
|
1163
1420
|
$initialPayment: WebsiteInitialPaymentInput
|
|
1421
|
+
$marketingAttribution: WebsiteMarketingAttributionInput
|
|
1422
|
+
$advertisingConsent: WebsiteAdvertisingConsentInput
|
|
1164
1423
|
) {
|
|
1165
1424
|
websiteCheckout(
|
|
1166
1425
|
order_id: $orderId
|
|
@@ -1173,6 +1432,8 @@ var CHECKOUT = (
|
|
|
1173
1432
|
payment_method_id: $paymentMethodId
|
|
1174
1433
|
buyer_account_opt_in: $buyerAccountOptIn
|
|
1175
1434
|
initial_payment: $initialPayment
|
|
1435
|
+
marketing_attribution: $marketingAttribution
|
|
1436
|
+
advertising_consent: $advertisingConsent
|
|
1176
1437
|
) {
|
|
1177
1438
|
success
|
|
1178
1439
|
order_id
|
|
@@ -2028,6 +2289,7 @@ var documents = {
|
|
|
2028
2289
|
WEBSITE_GET_PRODUCT_RECOMMENDATIONS,
|
|
2029
2290
|
GET_BRANDS,
|
|
2030
2291
|
CHECK_AVAILABILITY,
|
|
2292
|
+
GET_PRODUCT_LIVE_STATE,
|
|
2031
2293
|
GET_PRODUCT_FILTERS,
|
|
2032
2294
|
GET_SEARCH_SUGGESTIONS,
|
|
2033
2295
|
WEBSITE_GET_CONTENT,
|
|
@@ -2037,6 +2299,7 @@ var documents = {
|
|
|
2037
2299
|
START_GUEST_CHECKOUT,
|
|
2038
2300
|
SET_CART_ITEM,
|
|
2039
2301
|
REMOVE_CART_ITEM,
|
|
2302
|
+
DISCARD_CART,
|
|
2040
2303
|
CHECKOUT,
|
|
2041
2304
|
GET_LOCATION_OPTIONS,
|
|
2042
2305
|
GET_DELIVERY_OPTIONS,
|
package/graphql.d.ts
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
export { createAuthHeaders } from "./modules/auth";
|
|
16
|
-
export { APPLY_COUPON, CHECK_AVAILABILITY, CHECKOUT, CREATE_CART, CREATE_PAYMENT_SESSION, documents, GET_BRANDS, GET_CART, GET_CATALOG_ATTRIBUTE_LIST, GET_CATALOG_CATEGORY_LIST, GET_CATEGORIES, GET_CONTEXTUAL_CATALOG_ATTRIBUTE_LIST, GET_DELIVERY_OPTIONS, GET_FREE_SHIPPING_PROGRESS, GET_LOCATION_OPTIONS, GET_ORDER_BY_PK, GET_ORDERS,
|
|
17
|
-
export type { AccessTokenProvider, BacanoClientConfig, BacanoClientContext, Brand, Cart, CartItem, CatalogAttributeList, CatalogAttributeListFilters, CatalogAttributeListItem, CatalogAttributeListValue, CatalogCategoryList, CatalogCategoryListItem, CatalogCategoryListItemSourceType, CheckoutResult, CheckoutSubmission, ContentEntry, ContentJson, ContentMedia, ContentTypeSummary, CustomerProfile, CustomerProfileUpdate, GetAttributeListOptions, GetCategoryListOptions, GetContentOptions, GetOrdersOptions, GetProductSeoEntriesOptions, GetProductsOptions, Order, OrderItem, Product, ProductAttribute, ProductAvailability, ProductCategory, ProductMedia, ProductMediaKind, ProductPrice, ProductPriceType, ProductSeoEntriesResult, ProductSeoEntry, ProductSubcategory, ProductVariant, ProductVariantPricing, PublicOrder, PublicOrderDeliverySummary, PublicOrderItem, PublicOrderLookupInput, PublicOrderPaymentSummary, StartGuestCheckoutInput, VariantAttribute, WebsiteCheckoutAddress, WebsiteCheckoutItem, WebsiteCouponActionResult, WebsiteDeliveryOption, WebsiteDepartmentOption, WebsiteFreeShippingProgress, WebsiteFulfillmentFamily, WebsiteGuestContact, WebsiteLocationOptions, WebsiteMunicipalityOption, WebsitePaymentMethod, WebsitePaymentSessionResult, WebsitePickupInfo,
|
|
16
|
+
export { APPLY_COUPON, CHECK_AVAILABILITY, CHECKOUT, CREATE_CART, CREATE_PAYMENT_SESSION, documents, GET_BRANDS, GET_CART, GET_CATALOG_ATTRIBUTE_LIST, GET_CATALOG_CATEGORY_LIST, GET_CATEGORIES, GET_CONTEXTUAL_CATALOG_ATTRIBUTE_LIST, GET_DELIVERY_OPTIONS, GET_FREE_SHIPPING_PROGRESS, GET_LOCATION_OPTIONS, GET_ORDER_BY_PK, GET_ORDERS, GET_PAYMENT_METHODS, GET_PRODUCT_BY_PK, GET_PRODUCT_BY_SLUG, GET_PRODUCT_SEO_ENTRIES, GET_PRODUCTS, GET_PROFILE, GET_PUBLIC_ORDER, GET_SHIPPING_POLICY, GET_SHIPPING_QUOTES, REMOVE_CART_ITEM, REMOVE_COUPON, RESOLVE_WEBSITE_BY_SLUG, SET_CART_ITEM, START_GUEST_CHECKOUT, UPDATE_PROFILE, VALIDATE_COUPON, WEBSITE_GET_CONTENT, } from "./transport/documents";
|
|
17
|
+
export type { AccessTokenProvider, BacanoClientConfig, BacanoClientContext, Brand, Cart, CartItem, CatalogAttributeList, CatalogAttributeListFilters, CatalogAttributeListItem, CatalogAttributeListValue, CatalogCategoryList, CatalogCategoryListItem, CatalogCategoryListItemSourceType, CheckoutResult, CheckoutSubmission, ContentEntry, ContentJson, ContentMedia, ContentTypeSummary, CustomerProfile, CustomerProfileUpdate, GetAttributeListOptions, GetCategoryListOptions, GetContentOptions, GetOrdersOptions, GetProductSeoEntriesOptions, GetProductsOptions, Order, OrderItem, Product, ProductAttribute, ProductAvailability, ProductCategory, ProductMedia, ProductMediaKind, ProductPrice, ProductPriceType, ProductSeoEntriesResult, ProductSeoEntry, ProductSpecification, ProductSpecificationFacet, ProductSpecificationField, ProductSpecificationFilterSelection, ProductSpecificationMeasure, ProductSpecificationOption, ProductSpecificationSection, ProductSubcategory, ProductVariant, ProductVariantPricing, PublicOrder, PublicOrderDeliverySummary, PublicOrderItem, PublicOrderLookupInput, PublicOrderPaymentSummary, StartGuestCheckoutInput, VariantAttribute, WebsiteCheckoutAddress, WebsiteCheckoutItem, WebsiteCouponActionResult, WebsiteDeliveryOption, WebsiteDepartmentOption, WebsiteFreeShippingProgress, WebsiteFulfillmentFamily, WebsiteGuestContact, WebsiteLocationOptions, WebsiteMunicipalityOption, WebsitePaymentMethod, WebsitePaymentSessionResult, WebsitePickupInfo, WebsiteShippingPolicy, WebsiteShippingQuote, } from "./types";
|