@bacano/sdk 1.1.0 → 1.1.9
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
package/types.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export interface WebsitePublicConfig {
|
|
|
35
35
|
clerkPublishableKey: string | null;
|
|
36
36
|
customerIdentification: WebsiteCustomerIdentificationPolicy;
|
|
37
37
|
marketing: WebsiteMarketingPublicConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Optional on caller-constructed configs. `getWebsitePublicConfig()` always
|
|
40
|
+
* resolves this block, including a safe empty fallback.
|
|
41
|
+
*/
|
|
42
|
+
branding?: WebsiteBrandingPublicConfig;
|
|
38
43
|
/**
|
|
39
44
|
* Optional on caller-constructed configs for compatibility with SDK 1.0.10.
|
|
40
45
|
* `getWebsitePublicConfig()` always returns this block.
|
|
@@ -45,6 +50,28 @@ export interface WebsitePublicConfig {
|
|
|
45
50
|
* resolves this block, including a safe disabled fallback.
|
|
46
51
|
*/
|
|
47
52
|
construction?: WebsiteConstructionPublicConfig;
|
|
53
|
+
/** Public thresholds for displaying quantity-pricing guidance. */
|
|
54
|
+
volumePricing?: WebsiteVolumePricingPublicConfig;
|
|
55
|
+
}
|
|
56
|
+
export interface WebsiteVolumePricingPublicConfig {
|
|
57
|
+
schemaVersion: 1;
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
tiers: Array<{
|
|
60
|
+
priceType: "WHOLESALE" | "WHOLESALE_2";
|
|
61
|
+
minQuantity: number;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export interface WebsiteBrandingMedia {
|
|
65
|
+
fileId: string;
|
|
66
|
+
name: string | null;
|
|
67
|
+
altText: string | null;
|
|
68
|
+
width: number | null;
|
|
69
|
+
height: number | null;
|
|
70
|
+
originalUrl: string;
|
|
71
|
+
}
|
|
72
|
+
export interface WebsiteBrandingPublicConfig {
|
|
73
|
+
schemaVersion: 1;
|
|
74
|
+
favicon: WebsiteBrandingMedia | null;
|
|
48
75
|
}
|
|
49
76
|
export interface WebsiteConstructionMedia {
|
|
50
77
|
fileId: string;
|
|
@@ -123,8 +150,10 @@ export interface WebsiteCampaignCaptureResult {
|
|
|
123
150
|
message: string;
|
|
124
151
|
}
|
|
125
152
|
export type ResolvedWebsitePublicConfig = WebsitePublicConfig & {
|
|
153
|
+
branding: WebsiteBrandingPublicConfig;
|
|
126
154
|
legal: WebsiteLegalPublicConfig;
|
|
127
155
|
construction: WebsiteConstructionPublicConfig;
|
|
156
|
+
volumePricing: WebsiteVolumePricingPublicConfig;
|
|
128
157
|
};
|
|
129
158
|
export interface WebsiteMarketingPublicConfig {
|
|
130
159
|
schemaVersion: 1;
|
|
@@ -220,8 +249,60 @@ export interface Product {
|
|
|
220
249
|
media: ProductMedia[];
|
|
221
250
|
attributes: ProductAttribute[];
|
|
222
251
|
relatedProducts: ProductRelatedProduct[];
|
|
252
|
+
optionGroup: ProductOptionGroup | null;
|
|
253
|
+
/** Public, non-empty technical specification resolved by Bacano. */
|
|
254
|
+
specification: ProductSpecification | null;
|
|
255
|
+
}
|
|
256
|
+
export interface ProductSpecification {
|
|
257
|
+
contentTypeId: string;
|
|
258
|
+
key: string;
|
|
259
|
+
name: string;
|
|
260
|
+
sections: ProductSpecificationSection[];
|
|
261
|
+
}
|
|
262
|
+
export interface ProductSpecificationSection {
|
|
263
|
+
id: string | null;
|
|
264
|
+
key: string;
|
|
265
|
+
title: string;
|
|
266
|
+
description: string | null;
|
|
267
|
+
sortOrder: number;
|
|
268
|
+
fields: ProductSpecificationField[];
|
|
269
|
+
}
|
|
270
|
+
export interface ProductSpecificationField {
|
|
271
|
+
id: string;
|
|
272
|
+
key: string;
|
|
273
|
+
label: string;
|
|
274
|
+
type: "text" | "number" | "measure" | "boolean" | "date" | "select" | "component";
|
|
275
|
+
sortOrder: number;
|
|
276
|
+
value: string | number | boolean | ProductSpecificationOption | ProductSpecificationOption[] | ProductSpecificationMeasure | ProductSpecificationField[];
|
|
277
|
+
}
|
|
278
|
+
export interface ProductSpecificationOption {
|
|
279
|
+
id: string;
|
|
280
|
+
key: string;
|
|
281
|
+
label: string;
|
|
282
|
+
}
|
|
283
|
+
export interface ProductSpecificationMeasure {
|
|
284
|
+
value: number;
|
|
285
|
+
unit: {
|
|
286
|
+
code: string;
|
|
287
|
+
symbol: string;
|
|
288
|
+
name: string;
|
|
289
|
+
};
|
|
223
290
|
}
|
|
224
291
|
export interface ProductRelatedProduct {
|
|
292
|
+
id: string;
|
|
293
|
+
productId: string;
|
|
294
|
+
slug: string | null;
|
|
295
|
+
name: string;
|
|
296
|
+
sku: string | null;
|
|
297
|
+
sortOrder: number;
|
|
298
|
+
media: ProductMedia[];
|
|
299
|
+
}
|
|
300
|
+
export interface ProductOptionGroup {
|
|
301
|
+
id: string;
|
|
302
|
+
title: string | null;
|
|
303
|
+
members: ProductOptionGroupMember[];
|
|
304
|
+
}
|
|
305
|
+
export interface ProductOptionGroupMember {
|
|
225
306
|
id: string;
|
|
226
307
|
productId: string;
|
|
227
308
|
slug: string | null;
|
|
@@ -509,6 +590,40 @@ export interface ProductFilters {
|
|
|
509
590
|
};
|
|
510
591
|
/** Category-specific dynamic attributes — populated when categoryName is provided */
|
|
511
592
|
attributes: AttributeFilter[];
|
|
593
|
+
/** Public technical facets derived from Bacano's typed index. */
|
|
594
|
+
technical: ProductSpecificationFacet[];
|
|
595
|
+
}
|
|
596
|
+
export interface ProductSpecificationFacet {
|
|
597
|
+
fieldId: string;
|
|
598
|
+
fieldPath: string;
|
|
599
|
+
key: string;
|
|
600
|
+
label: string;
|
|
601
|
+
type: "number" | "measure" | "boolean" | "date" | "select";
|
|
602
|
+
sectionKey: string | null;
|
|
603
|
+
unitCode: string | null;
|
|
604
|
+
min: number | null;
|
|
605
|
+
max: number | null;
|
|
606
|
+
dateFrom: string | null;
|
|
607
|
+
dateTo: string | null;
|
|
608
|
+
booleanValues: Array<{
|
|
609
|
+
value: boolean;
|
|
610
|
+
count: number;
|
|
611
|
+
}>;
|
|
612
|
+
options: Array<{
|
|
613
|
+
id: string;
|
|
614
|
+
key: string;
|
|
615
|
+
label: string;
|
|
616
|
+
count: number;
|
|
617
|
+
sortOrder: number;
|
|
618
|
+
}>;
|
|
619
|
+
}
|
|
620
|
+
export interface ProductSpecificationFilterSelection {
|
|
621
|
+
optionIds?: string[];
|
|
622
|
+
booleanValues?: boolean[];
|
|
623
|
+
min?: number;
|
|
624
|
+
max?: number;
|
|
625
|
+
dateFrom?: string;
|
|
626
|
+
dateTo?: string;
|
|
512
627
|
}
|
|
513
628
|
export interface GetProductFiltersOptions {
|
|
514
629
|
/** When set, includes category-specific attribute facets */
|
|
@@ -542,6 +657,8 @@ export interface GetCatalogPageOptions {
|
|
|
542
657
|
minPrice?: number;
|
|
543
658
|
maxPrice?: number;
|
|
544
659
|
attributesBySlug?: Record<string, string[]>;
|
|
660
|
+
/** Technical filters keyed by the stable field ID exposed in facets. */
|
|
661
|
+
technicalByField?: Record<string, ProductSpecificationFilterSelection>;
|
|
545
662
|
sortBy?: ProductSortBy;
|
|
546
663
|
limit?: number;
|
|
547
664
|
offset?: number;
|
|
@@ -793,11 +910,30 @@ export interface Cart {
|
|
|
793
910
|
status: string;
|
|
794
911
|
createdAt: string;
|
|
795
912
|
updatedAt: string;
|
|
913
|
+
volumePricing: CartVolumePricing;
|
|
914
|
+
}
|
|
915
|
+
export interface CartVolumePricing {
|
|
916
|
+
enabled: boolean;
|
|
917
|
+
eligibleQuantity: number;
|
|
918
|
+
appliedPriceType: "WHOLESALE" | "WHOLESALE_2" | null;
|
|
919
|
+
appliedMinQuantity: number | null;
|
|
920
|
+
nextPriceType: "WHOLESALE" | "WHOLESALE_2" | null;
|
|
921
|
+
nextMinQuantity: number | null;
|
|
922
|
+
remainingQuantity: number | null;
|
|
923
|
+
totalSavings?: number;
|
|
796
924
|
}
|
|
797
925
|
export interface CartItem {
|
|
798
926
|
id: string;
|
|
799
927
|
productVariantId: string;
|
|
800
928
|
quantity: number;
|
|
929
|
+
unitPrice: number | null;
|
|
930
|
+
lineTotal: number | null;
|
|
931
|
+
baseUnitPrice?: number | null;
|
|
932
|
+
unitSavings?: number;
|
|
933
|
+
lineSavings?: number;
|
|
934
|
+
volumePricingEligible?: boolean;
|
|
935
|
+
resolvedPriceType: ProductPriceType | null;
|
|
936
|
+
volumePricingMinQuantity: number | null;
|
|
801
937
|
productVariant: {
|
|
802
938
|
sku: string;
|
|
803
939
|
product: {
|