@bacano/sdk 1.0.0 → 1.1.0

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 (68) hide show
  1. package/README.md +342 -7
  2. package/STOREFRONT_CLARITY.md +140 -0
  3. package/STOREFRONT_CONSTRUCTION.md +92 -0
  4. package/STOREFRONT_LEADS.md +130 -0
  5. package/STOREFRONT_LEGAL.md +66 -0
  6. package/STOREFRONT_MARKETING.md +286 -0
  7. package/STOREFRONT_PERFORMANCE.md +265 -0
  8. package/STOREFRONT_PREVIEW.md +474 -0
  9. package/client.d.ts +7 -1
  10. package/errors.d.ts +9 -1
  11. package/graphql.cjs +63 -0
  12. package/graphql.d.ts +2 -2
  13. package/graphql.js +63 -0
  14. package/index.cjs +1542 -192
  15. package/index.d.ts +8 -6
  16. package/index.js +1542 -192
  17. package/marketing/attribution.d.ts +51 -0
  18. package/marketing/clarity.d.ts +3 -0
  19. package/marketing/domain.d.ts +1 -0
  20. package/marketing/ga4.d.ts +2 -0
  21. package/marketing/index.d.ts +5 -0
  22. package/marketing/runtime.d.ts +2 -0
  23. package/marketing/sanitize.d.ts +2 -0
  24. package/marketing/types.d.ts +109 -0
  25. package/media.d.ts +45 -2
  26. package/modules/auth.d.ts +3 -2
  27. package/modules/availability.d.ts +2 -2
  28. package/modules/cart-session.d.ts +2 -2
  29. package/modules/cart.d.ts +3 -3
  30. package/modules/catalog.d.ts +15 -3
  31. package/modules/content.d.ts +2 -2
  32. package/modules/marketing.d.ts +5 -0
  33. package/modules/orders.d.ts +2 -2
  34. package/modules/profile.d.ts +1 -1
  35. package/modules/static-catalog.d.ts +13 -0
  36. package/modules/website.d.ts +7 -1
  37. package/package.json +14 -3
  38. package/react/context-registry.d.ts +9 -0
  39. package/react/context.d.ts +1 -1
  40. package/react/hooks.d.ts +23 -2
  41. package/react/marketing-context.d.ts +3 -0
  42. package/react/marketing-provider.d.ts +10 -0
  43. package/react/preview/cache.d.ts +23 -0
  44. package/react/preview/context.d.ts +5 -0
  45. package/react/preview/navigation.d.ts +9 -0
  46. package/react/preview/provider.d.ts +3 -0
  47. package/react/preview/shell.d.ts +3 -0
  48. package/react/preview/toolbar.d.ts +3 -0
  49. package/react/preview/types.d.ts +60 -0
  50. package/react/preview.cjs +742 -0
  51. package/react/preview.d.ts +14 -0
  52. package/react/preview.js +730 -0
  53. package/react/website-gate.d.ts +22 -0
  54. package/react.cjs +3432 -1780
  55. package/react.d.ts +8 -4
  56. package/react.js +3428 -1772
  57. package/skills/bacano-web/SKILL.md +109 -0
  58. package/skills/bacano-web/agents/openai.yaml +4 -0
  59. package/skills/bacano-web/references/common.md +91 -0
  60. package/skills/bacano-web/references/informational.md +39 -0
  61. package/skills/bacano-web/references/report.md +52 -0
  62. package/skills/bacano-web/references/storefront.md +116 -0
  63. package/skills/bacano-web/scripts/audit-http.mjs +247 -0
  64. package/skills/bacano-web/scripts/cli.mjs +222 -0
  65. package/skills/bacano-web/scripts/postinstall.mjs +8 -0
  66. package/transport/documents.d.ts +8 -6
  67. package/transport/graphql.d.ts +13 -1
  68. package/types.d.ts +202 -0
package/graphql.js CHANGED
@@ -828,6 +828,62 @@ var CHECK_AVAILABILITY = (
828
828
  product_variant_id
829
829
  in_stock
830
830
  label
831
+ max_purchasable_quantity
832
+ }
833
+ }
834
+ `
835
+ );
836
+ var GET_PRODUCT_LIVE_STATE = (
837
+ /* GraphQL */
838
+ `
839
+ query GetProductLiveState(
840
+ $variantIds: [uuid!]!
841
+ $companyId: uuid!
842
+ $chainId: uuid!
843
+ $websiteId: uuid!
844
+ ) {
845
+ product_variants(
846
+ where: {
847
+ id: { _in: $variantIds }
848
+ is_disabled: { _eq: false }
849
+ product: {
850
+ company_id: { _eq: $companyId }
851
+ product_website_publications: {
852
+ website_id: { _eq: $websiteId }
853
+ is_visible: { _eq: true }
854
+ }
855
+ chain_products: {
856
+ chain_id: { _eq: $chainId }
857
+ is_enabled: { _eq: true }
858
+ status: { _eq: active }
859
+ }
860
+ }
861
+ }
862
+ ) {
863
+ id
864
+ product_variant_prices(
865
+ where: {
866
+ price_type: { _in: [CLIENT, SALE, WHOLESALE, WHOLESALE_2] }
867
+ _or: [
868
+ { chain_id: { _eq: $chainId } }
869
+ { chain_id: { _is_null: true } }
870
+ ]
871
+ }
872
+ ) {
873
+ id
874
+ price
875
+ price_type
876
+ chain_id
877
+ }
878
+ }
879
+ websiteProductAvailability(
880
+ product_variant_ids: $variantIds
881
+ chain_id: $chainId
882
+ ) {
883
+ product_variant_id
884
+ in_stock
885
+ label
886
+ max_purchasable_quantity
831
887
  }
832
888
  }
833
889
  `
@@ -937,6 +993,7 @@ var START_GUEST_CHECKOUT = (
937
993
  $contact: WebsiteGuestContactInput!
938
994
  $items: [WebsiteCheckoutItemInput!]!
939
995
  $fulfillmentFamily: String
996
+ $marketingAttribution: WebsiteMarketingAttributionInput
940
997
  ) {
941
998
  websiteStartGuestCheckout(
942
999
  website_id: $websiteId
@@ -944,6 +1001,7 @@ var START_GUEST_CHECKOUT = (
944
1001
  contact: $contact
945
1002
  items: $items
946
1003
  fulfillment_family: $fulfillmentFamily
1004
+ marketing_attribution: $marketingAttribution
947
1005
  ) {
948
1006
  success
949
1007
  order_id
@@ -1101,6 +1159,8 @@ var CHECKOUT = (
1101
1159
  $paymentMethodId: uuid
1102
1160
  $buyerAccountOptIn: Boolean
1103
1161
  $initialPayment: WebsiteInitialPaymentInput
1162
+ $marketingAttribution: WebsiteMarketingAttributionInput
1163
+ $advertisingConsent: WebsiteAdvertisingConsentInput
1104
1164
  ) {
1105
1165
  websiteCheckout(
1106
1166
  order_id: $orderId
@@ -1113,6 +1173,8 @@ var CHECKOUT = (
1113
1173
  payment_method_id: $paymentMethodId
1114
1174
  buyer_account_opt_in: $buyerAccountOptIn
1115
1175
  initial_payment: $initialPayment
1176
+ marketing_attribution: $marketingAttribution
1177
+ advertising_consent: $advertisingConsent
1116
1178
  ) {
1117
1179
  success
1118
1180
  order_id
@@ -1968,6 +2030,7 @@ var documents = {
1968
2030
  WEBSITE_GET_PRODUCT_RECOMMENDATIONS,
1969
2031
  GET_BRANDS,
1970
2032
  CHECK_AVAILABILITY,
2033
+ GET_PRODUCT_LIVE_STATE,
1971
2034
  GET_PRODUCT_FILTERS,
1972
2035
  GET_SEARCH_SUGGESTIONS,
1973
2036
  WEBSITE_GET_CONTENT,