@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.
Files changed (72) hide show
  1. package/README.md +439 -18
  2. package/STOREFRONT_CLARITY.md +140 -0
  3. package/STOREFRONT_CONSTRUCTION.md +105 -0
  4. package/STOREFRONT_LEADS.md +130 -0
  5. package/STOREFRONT_LEGAL.md +66 -0
  6. package/STOREFRONT_MARKETING.md +291 -0
  7. package/STOREFRONT_PERFORMANCE.md +304 -0
  8. package/STOREFRONT_PREVIEW.md +499 -0
  9. package/STOREFRONT_PRODUCT_SPECIFICATIONS.md +127 -0
  10. package/STOREFRONT_VOLUME_PRICING.md +131 -0
  11. package/client.d.ts +8 -1
  12. package/errors.d.ts +9 -1
  13. package/graphql.cjs +266 -3
  14. package/graphql.d.ts +2 -2
  15. package/graphql.js +266 -3
  16. package/index.cjs +2035 -255
  17. package/index.d.ts +8 -6
  18. package/index.js +2035 -255
  19. package/marketing/attribution.d.ts +53 -0
  20. package/marketing/clarity.d.ts +3 -0
  21. package/marketing/domain.d.ts +1 -0
  22. package/marketing/ga4.d.ts +2 -0
  23. package/marketing/index.d.ts +5 -0
  24. package/marketing/runtime.d.ts +2 -0
  25. package/marketing/sanitize.d.ts +2 -0
  26. package/marketing/types.d.ts +111 -0
  27. package/media.d.ts +45 -2
  28. package/modules/auth.d.ts +3 -2
  29. package/modules/availability.d.ts +2 -2
  30. package/modules/cart-errors.d.ts +2 -0
  31. package/modules/cart-session.d.ts +2 -2
  32. package/modules/cart.d.ts +4 -3
  33. package/modules/catalog.d.ts +15 -3
  34. package/modules/content.d.ts +2 -2
  35. package/modules/marketing.d.ts +5 -0
  36. package/modules/orders.d.ts +2 -2
  37. package/modules/profile.d.ts +1 -1
  38. package/modules/static-catalog.d.ts +13 -0
  39. package/modules/website.d.ts +7 -1
  40. package/package.json +14 -3
  41. package/react/context-registry.d.ts +9 -0
  42. package/react/context.d.ts +1 -1
  43. package/react/hooks.d.ts +24 -2
  44. package/react/marketing-context.d.ts +3 -0
  45. package/react/marketing-provider.d.ts +10 -0
  46. package/react/preview/cache.d.ts +23 -0
  47. package/react/preview/context.d.ts +5 -0
  48. package/react/preview/navigation.d.ts +9 -0
  49. package/react/preview/provider.d.ts +3 -0
  50. package/react/preview/shell.d.ts +3 -0
  51. package/react/preview/toolbar.d.ts +3 -0
  52. package/react/preview/types.d.ts +60 -0
  53. package/react/preview.cjs +742 -0
  54. package/react/preview.d.ts +14 -0
  55. package/react/preview.js +730 -0
  56. package/react/website-gate.d.ts +22 -0
  57. package/react.cjs +3893 -1795
  58. package/react.d.ts +8 -4
  59. package/react.js +3891 -1789
  60. package/skills/bacano-web/SKILL.md +116 -0
  61. package/skills/bacano-web/agents/openai.yaml +4 -0
  62. package/skills/bacano-web/references/architecture-runtime.md +109 -0
  63. package/skills/bacano-web/references/common.md +92 -0
  64. package/skills/bacano-web/references/informational.md +39 -0
  65. package/skills/bacano-web/references/report.md +70 -0
  66. package/skills/bacano-web/references/storefront.md +116 -0
  67. package/skills/bacano-web/scripts/audit-http.mjs +284 -0
  68. package/skills/bacano-web/scripts/cli.mjs +222 -0
  69. package/skills/bacano-web/scripts/postinstall.mjs +8 -0
  70. package/transport/documents.d.ts +23 -18
  71. package/transport/graphql.d.ts +13 -1
  72. package/types.d.ts +338 -0
package/graphql.js CHANGED
@@ -146,7 +146,6 @@ var GET_PRODUCTS = (
146
146
  ) {
147
147
  id
148
148
  related_product_id
149
- display_label
150
149
  sort_order
151
150
  related_product {
152
151
  id
@@ -168,6 +167,52 @@ var GET_PRODUCTS = (
168
167
  }
169
168
  }
170
169
  }
170
+ product_option_group_members(limit: 1) {
171
+ group {
172
+ id
173
+ display_title
174
+ members(
175
+ where: {
176
+ product: {
177
+ product_website_publications: {
178
+ website_id: { _eq: $websiteId }
179
+ is_visible: { _eq: true }
180
+ }
181
+ chain_products: {
182
+ chain_id: { _eq: $chainId }
183
+ is_enabled: { _eq: true }
184
+ status: { _eq: active }
185
+ }
186
+ }
187
+ }
188
+ order_by: { sort_order: asc }
189
+ ) {
190
+ id
191
+ product_id
192
+ display_label
193
+ sort_order
194
+ product {
195
+ id
196
+ slug
197
+ name
198
+ sku
199
+ product_media(
200
+ where: { file: { mimeType: { _ilike: "image/%" } } }
201
+ order_by: { order: asc }
202
+ limit: 1
203
+ ) {
204
+ id
205
+ file_id
206
+ order
207
+ file {
208
+ mimeType
209
+ name
210
+ }
211
+ }
212
+ }
213
+ }
214
+ }
215
+ }
171
216
  product_attributes {
172
217
  id
173
218
  value
@@ -252,6 +297,52 @@ var GET_PRODUCT_BY_PK = (
252
297
  limit: 1
253
298
  ) {
254
299
  id
300
+ product_option_group_members(limit: 1) {
301
+ group {
302
+ id
303
+ display_title
304
+ members(
305
+ where: {
306
+ product: {
307
+ product_website_publications: {
308
+ website_id: { _eq: $websiteId }
309
+ is_visible: { _eq: true }
310
+ }
311
+ chain_products: {
312
+ chain_id: { _eq: $chainId }
313
+ is_enabled: { _eq: true }
314
+ status: { _eq: active }
315
+ }
316
+ }
317
+ }
318
+ order_by: { sort_order: asc }
319
+ ) {
320
+ id
321
+ product_id
322
+ display_label
323
+ sort_order
324
+ product {
325
+ id
326
+ slug
327
+ name
328
+ sku
329
+ product_media(
330
+ where: { file: { mimeType: { _ilike: "image/%" } } }
331
+ order_by: { order: asc }
332
+ limit: 1
333
+ ) {
334
+ id
335
+ file_id
336
+ order
337
+ file {
338
+ mimeType
339
+ name
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
345
+ }
255
346
  name
256
347
  description
257
348
  long_description
@@ -338,7 +429,6 @@ var GET_PRODUCT_BY_PK = (
338
429
  ) {
339
430
  id
340
431
  related_product_id
341
- display_label
342
432
  sort_order
343
433
  related_product {
344
434
  id
@@ -820,14 +910,76 @@ var WEBSITE_GET_PRODUCT_CONTENT = (
820
910
  var CHECK_AVAILABILITY = (
821
911
  /* GraphQL */
822
912
  `
823
- query CheckAvailability($variantIds: [uuid!]!, $chainId: uuid!) {
913
+ query CheckAvailability(
914
+ $variantIds: [uuid!]!
915
+ $chainId: uuid!
916
+ $websiteId: uuid
917
+ ) {
918
+ websiteProductAvailability(
919
+ product_variant_ids: $variantIds
920
+ chain_id: $chainId
921
+ website_id: $websiteId
922
+ ) {
923
+ product_variant_id
924
+ in_stock
925
+ label
926
+ max_purchasable_quantity
927
+ }
928
+ }
929
+ `
930
+ );
931
+ var GET_PRODUCT_LIVE_STATE = (
932
+ /* GraphQL */
933
+ `
934
+ query GetProductLiveState(
935
+ $variantIds: [uuid!]!
936
+ $companyId: uuid!
937
+ $chainId: uuid!
938
+ $websiteId: uuid!
939
+ ) {
940
+ product_variants(
941
+ where: {
942
+ id: { _in: $variantIds }
943
+ is_disabled: { _eq: false }
944
+ product: {
945
+ company_id: { _eq: $companyId }
946
+ product_website_publications: {
947
+ website_id: { _eq: $websiteId }
948
+ is_visible: { _eq: true }
949
+ }
950
+ chain_products: {
951
+ chain_id: { _eq: $chainId }
952
+ is_enabled: { _eq: true }
953
+ status: { _eq: active }
954
+ }
955
+ }
956
+ }
957
+ ) {
958
+ id
959
+ product_variant_prices(
960
+ where: {
961
+ price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }
962
+ _or: [
963
+ { chain_id: { _eq: $chainId } }
964
+ { chain_id: { _is_null: true } }
965
+ ]
966
+ }
967
+ ) {
968
+ id
969
+ price
970
+ price_type
971
+ chain_id
972
+ }
973
+ }
824
974
  websiteProductAvailability(
825
975
  product_variant_ids: $variantIds
826
976
  chain_id: $chainId
977
+ website_id: $websiteId
827
978
  ) {
828
979
  product_variant_id
829
980
  in_stock
830
981
  label
982
+ max_purchasable_quantity
831
983
  }
832
984
  }
833
985
  `
@@ -860,10 +1012,28 @@ var CREATE_CART = (
860
1012
  total_with_discount
861
1013
  created_at
862
1014
  updated_at
1015
+ volume_pricing {
1016
+ enabled
1017
+ eligibleQuantity
1018
+ appliedPriceType
1019
+ appliedMinQuantity
1020
+ nextPriceType
1021
+ nextMinQuantity
1022
+ remainingQuantity
1023
+ totalSavings
1024
+ }
863
1025
  items {
864
1026
  id
865
1027
  product_variant_id
866
1028
  quantity
1029
+ unit_price
1030
+ line_total
1031
+ base_unit_price
1032
+ unit_savings
1033
+ line_savings
1034
+ volume_pricing_eligible
1035
+ resolved_price_type
1036
+ volume_pricing_min_quantity
867
1037
  product_variant {
868
1038
  id
869
1039
  sku
@@ -903,10 +1073,28 @@ var GET_CART = (
903
1073
  total_with_discount
904
1074
  created_at
905
1075
  updated_at
1076
+ volume_pricing {
1077
+ enabled
1078
+ eligibleQuantity
1079
+ appliedPriceType
1080
+ appliedMinQuantity
1081
+ nextPriceType
1082
+ nextMinQuantity
1083
+ remainingQuantity
1084
+ totalSavings
1085
+ }
906
1086
  items {
907
1087
  id
908
1088
  product_variant_id
909
1089
  quantity
1090
+ unit_price
1091
+ line_total
1092
+ base_unit_price
1093
+ unit_savings
1094
+ line_savings
1095
+ volume_pricing_eligible
1096
+ resolved_price_type
1097
+ volume_pricing_min_quantity
910
1098
  product_variant {
911
1099
  id
912
1100
  sku
@@ -937,6 +1125,7 @@ var START_GUEST_CHECKOUT = (
937
1125
  $contact: WebsiteGuestContactInput!
938
1126
  $items: [WebsiteCheckoutItemInput!]!
939
1127
  $fulfillmentFamily: String
1128
+ $marketingAttribution: WebsiteMarketingAttributionInput
940
1129
  ) {
941
1130
  websiteStartGuestCheckout(
942
1131
  website_id: $websiteId
@@ -944,6 +1133,7 @@ var START_GUEST_CHECKOUT = (
944
1133
  contact: $contact
945
1134
  items: $items
946
1135
  fulfillment_family: $fulfillmentFamily
1136
+ marketing_attribution: $marketingAttribution
947
1137
  ) {
948
1138
  success
949
1139
  order_id
@@ -958,10 +1148,28 @@ var START_GUEST_CHECKOUT = (
958
1148
  total_with_discount
959
1149
  created_at
960
1150
  updated_at
1151
+ volume_pricing {
1152
+ enabled
1153
+ eligibleQuantity
1154
+ appliedPriceType
1155
+ appliedMinQuantity
1156
+ nextPriceType
1157
+ nextMinQuantity
1158
+ remainingQuantity
1159
+ totalSavings
1160
+ }
961
1161
  items {
962
1162
  id
963
1163
  product_variant_id
964
1164
  quantity
1165
+ unit_price
1166
+ line_total
1167
+ base_unit_price
1168
+ unit_savings
1169
+ line_savings
1170
+ volume_pricing_eligible
1171
+ resolved_price_type
1172
+ volume_pricing_min_quantity
965
1173
  product_variant {
966
1174
  id
967
1175
  sku
@@ -1011,10 +1219,28 @@ var SET_CART_ITEM = (
1011
1219
  total_with_discount
1012
1220
  created_at
1013
1221
  updated_at
1222
+ volume_pricing {
1223
+ enabled
1224
+ eligibleQuantity
1225
+ appliedPriceType
1226
+ appliedMinQuantity
1227
+ nextPriceType
1228
+ nextMinQuantity
1229
+ remainingQuantity
1230
+ totalSavings
1231
+ }
1014
1232
  items {
1015
1233
  id
1016
1234
  product_variant_id
1017
1235
  quantity
1236
+ unit_price
1237
+ line_total
1238
+ base_unit_price
1239
+ unit_savings
1240
+ line_savings
1241
+ volume_pricing_eligible
1242
+ resolved_price_type
1243
+ volume_pricing_min_quantity
1018
1244
  product_variant {
1019
1245
  id
1020
1246
  sku
@@ -1062,10 +1288,28 @@ var REMOVE_CART_ITEM = (
1062
1288
  total_with_discount
1063
1289
  created_at
1064
1290
  updated_at
1291
+ volume_pricing {
1292
+ enabled
1293
+ eligibleQuantity
1294
+ appliedPriceType
1295
+ appliedMinQuantity
1296
+ nextPriceType
1297
+ nextMinQuantity
1298
+ remainingQuantity
1299
+ totalSavings
1300
+ }
1065
1301
  items {
1066
1302
  id
1067
1303
  product_variant_id
1068
1304
  quantity
1305
+ unit_price
1306
+ line_total
1307
+ base_unit_price
1308
+ unit_savings
1309
+ line_savings
1310
+ volume_pricing_eligible
1311
+ resolved_price_type
1312
+ volume_pricing_min_quantity
1069
1313
  product_variant {
1070
1314
  id
1071
1315
  sku
@@ -1087,6 +1331,19 @@ var REMOVE_CART_ITEM = (
1087
1331
  }
1088
1332
  `
1089
1333
  );
1334
+ var DISCARD_CART = (
1335
+ /* GraphQL */
1336
+ `
1337
+ mutation DiscardCart($orderId: uuid!, $cartToken: String!) {
1338
+ websiteDiscardCart(order_id: $orderId, cart_token: $cartToken) {
1339
+ success
1340
+ order_id
1341
+ website_cart_status
1342
+ errors
1343
+ }
1344
+ }
1345
+ `
1346
+ );
1090
1347
  var CHECKOUT = (
1091
1348
  /* GraphQL */
1092
1349
  `
@@ -1101,6 +1358,8 @@ var CHECKOUT = (
1101
1358
  $paymentMethodId: uuid
1102
1359
  $buyerAccountOptIn: Boolean
1103
1360
  $initialPayment: WebsiteInitialPaymentInput
1361
+ $marketingAttribution: WebsiteMarketingAttributionInput
1362
+ $advertisingConsent: WebsiteAdvertisingConsentInput
1104
1363
  ) {
1105
1364
  websiteCheckout(
1106
1365
  order_id: $orderId
@@ -1113,6 +1372,8 @@ var CHECKOUT = (
1113
1372
  payment_method_id: $paymentMethodId
1114
1373
  buyer_account_opt_in: $buyerAccountOptIn
1115
1374
  initial_payment: $initialPayment
1375
+ marketing_attribution: $marketingAttribution
1376
+ advertising_consent: $advertisingConsent
1116
1377
  ) {
1117
1378
  success
1118
1379
  order_id
@@ -1968,6 +2229,7 @@ var documents = {
1968
2229
  WEBSITE_GET_PRODUCT_RECOMMENDATIONS,
1969
2230
  GET_BRANDS,
1970
2231
  CHECK_AVAILABILITY,
2232
+ GET_PRODUCT_LIVE_STATE,
1971
2233
  GET_PRODUCT_FILTERS,
1972
2234
  GET_SEARCH_SUGGESTIONS,
1973
2235
  WEBSITE_GET_CONTENT,
@@ -1977,6 +2239,7 @@ var documents = {
1977
2239
  START_GUEST_CHECKOUT,
1978
2240
  SET_CART_ITEM,
1979
2241
  REMOVE_CART_ITEM,
2242
+ DISCARD_CART,
1980
2243
  CHECKOUT,
1981
2244
  GET_LOCATION_OPTIONS,
1982
2245
  GET_DELIVERY_OPTIONS,