@sixtyninecommerce/client 0.1.0 → 0.3.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 (124) hide show
  1. package/README.md +24 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +1 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/commerce/age-verification.d.ts +8 -0
  6. package/dist/commerce/age-verification.d.ts.map +1 -0
  7. package/dist/commerce/age-verification.js +47 -0
  8. package/dist/commerce/age-verification.js.map +1 -0
  9. package/dist/commerce/customer.d.ts +21 -1
  10. package/dist/commerce/customer.d.ts.map +1 -1
  11. package/dist/commerce/customer.js +92 -15
  12. package/dist/commerce/customer.js.map +1 -1
  13. package/dist/commerce/favorites.d.ts +12 -0
  14. package/dist/commerce/favorites.d.ts.map +1 -0
  15. package/dist/commerce/favorites.js +30 -0
  16. package/dist/commerce/favorites.js.map +1 -0
  17. package/dist/commerce/index.d.ts.map +1 -1
  18. package/dist/commerce/index.js +21 -0
  19. package/dist/commerce/index.js.map +1 -1
  20. package/dist/commerce/products.d.ts +9 -7
  21. package/dist/commerce/products.d.ts.map +1 -1
  22. package/dist/commerce/products.js +29 -23
  23. package/dist/commerce/products.js.map +1 -1
  24. package/dist/commerce/queries.d.ts +25 -4
  25. package/dist/commerce/queries.d.ts.map +1 -1
  26. package/dist/commerce/queries.js +263 -0
  27. package/dist/commerce/queries.js.map +1 -1
  28. package/dist/commerce/recommendations.d.ts +6 -0
  29. package/dist/commerce/recommendations.d.ts.map +1 -0
  30. package/dist/commerce/recommendations.js +10 -0
  31. package/dist/commerce/recommendations.js.map +1 -0
  32. package/dist/commerce/reviews.d.ts +21 -0
  33. package/dist/commerce/reviews.d.ts.map +1 -0
  34. package/dist/commerce/reviews.js +159 -0
  35. package/dist/commerce/reviews.js.map +1 -0
  36. package/dist/commerce/search.d.ts +2 -2
  37. package/dist/commerce/search.d.ts.map +1 -1
  38. package/dist/commerce/search.js +6 -4
  39. package/dist/commerce/search.js.map +1 -1
  40. package/dist/commerce/shipping.d.ts +8 -0
  41. package/dist/commerce/shipping.d.ts.map +1 -0
  42. package/dist/commerce/shipping.js +109 -0
  43. package/dist/commerce/shipping.js.map +1 -0
  44. package/dist/commerce/subscriptions.d.ts +6 -0
  45. package/dist/commerce/subscriptions.d.ts.map +1 -0
  46. package/dist/commerce/subscriptions.js +26 -0
  47. package/dist/commerce/subscriptions.js.map +1 -0
  48. package/dist/commerce/vat-validation.d.ts +8 -0
  49. package/dist/commerce/vat-validation.d.ts.map +1 -0
  50. package/dist/commerce/vat-validation.js +43 -0
  51. package/dist/commerce/vat-validation.js.map +1 -0
  52. package/dist/content/assets.d.ts +4 -2
  53. package/dist/content/assets.d.ts.map +1 -1
  54. package/dist/content/assets.js +15 -11
  55. package/dist/content/assets.js.map +1 -1
  56. package/dist/content/collection-pages.d.ts +6 -0
  57. package/dist/content/collection-pages.d.ts.map +1 -0
  58. package/dist/content/collection-pages.js +12 -0
  59. package/dist/content/collection-pages.js.map +1 -0
  60. package/dist/content/filtered-products.d.ts +19 -0
  61. package/dist/content/filtered-products.d.ts.map +1 -0
  62. package/dist/content/filtered-products.js +18 -0
  63. package/dist/content/filtered-products.js.map +1 -0
  64. package/dist/content/forms.d.ts +2 -2
  65. package/dist/content/forms.d.ts.map +1 -1
  66. package/dist/content/forms.js +2 -2
  67. package/dist/content/forms.js.map +1 -1
  68. package/dist/content/index.d.ts.map +1 -1
  69. package/dist/content/index.js +4 -0
  70. package/dist/content/index.js.map +1 -1
  71. package/dist/content/items.d.ts +4 -2
  72. package/dist/content/items.d.ts.map +1 -1
  73. package/dist/content/items.js +31 -16
  74. package/dist/content/items.js.map +1 -1
  75. package/dist/content/menus.d.ts +3 -3
  76. package/dist/content/menus.d.ts.map +1 -1
  77. package/dist/content/menus.js +4 -4
  78. package/dist/content/menus.js.map +1 -1
  79. package/dist/content/resolve.d.ts +2 -2
  80. package/dist/content/resolve.d.ts.map +1 -1
  81. package/dist/content/resolve.js +2 -2
  82. package/dist/content/resolve.js.map +1 -1
  83. package/dist/content/sitemap.d.ts +6 -0
  84. package/dist/content/sitemap.d.ts.map +1 -0
  85. package/dist/content/sitemap.js +12 -0
  86. package/dist/content/sitemap.js.map +1 -0
  87. package/dist/content/strings.d.ts +2 -2
  88. package/dist/content/strings.d.ts.map +1 -1
  89. package/dist/content/strings.js +3 -3
  90. package/dist/content/strings.js.map +1 -1
  91. package/dist/core/context.d.ts.map +1 -1
  92. package/dist/core/context.js +12 -33
  93. package/dist/core/context.js.map +1 -1
  94. package/dist/core/http.d.ts +8 -4
  95. package/dist/core/http.d.ts.map +1 -1
  96. package/dist/core/http.js +259 -104
  97. package/dist/core/http.js.map +1 -1
  98. package/dist/index.d.ts +2 -1
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +1 -0
  101. package/dist/index.js.map +1 -1
  102. package/dist/media/index.d.ts +2 -1
  103. package/dist/media/index.d.ts.map +1 -1
  104. package/dist/media/index.js +35 -5
  105. package/dist/media/index.js.map +1 -1
  106. package/dist/media/urls.d.ts +3 -0
  107. package/dist/media/urls.d.ts.map +1 -1
  108. package/dist/media/urls.js +15 -1
  109. package/dist/media/urls.js.map +1 -1
  110. package/dist/media/video.d.ts +22 -0
  111. package/dist/media/video.d.ts.map +1 -0
  112. package/dist/media/video.js +90 -0
  113. package/dist/media/video.js.map +1 -0
  114. package/dist/navigation/routes.d.ts +4 -4
  115. package/dist/navigation/routes.d.ts.map +1 -1
  116. package/dist/navigation/routes.js +6 -6
  117. package/dist/navigation/routes.js.map +1 -1
  118. package/dist/pricing/validation.d.ts +0 -2
  119. package/dist/pricing/validation.d.ts.map +1 -1
  120. package/dist/pricing/validation.js +0 -10
  121. package/dist/pricing/validation.js.map +1 -1
  122. package/dist/types.d.ts +487 -30
  123. package/dist/types.d.ts.map +1 -1
  124. package/package.json +12 -2
@@ -1,9 +1,9 @@
1
- export declare const GET_PRODUCT = "\n query GetProduct($slug: String!) {\n product(slug: $slug) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n options { id code name group { id name code } }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n }\n";
2
- export declare const GET_PRODUCT_BY_ID = "\n query GetProductById($id: ID!) {\n product(id: $id) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n options { id code name group { id name code } }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n }\n";
3
- export declare const LIST_PRODUCTS = "\n query ListProducts($options: ProductListOptions) {\n products(options: $options) {\n items {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n totalItems\n }\n }\n";
1
+ export declare const GET_PRODUCT = "\n query GetProduct($slug: String!) {\n product(slug: $slug) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n options { id code name group { id name code } }\n customFields { minOrderQuantity salesUnit }\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n }\n";
2
+ export declare const GET_PRODUCT_BY_ID = "\n query GetProductById($id: ID!) {\n product(id: $id) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n options { id code name group { id name code } }\n customFields { minOrderQuantity salesUnit }\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n }\n";
3
+ export declare const LIST_PRODUCTS = "\n query ListProducts($options: ProductListOptions) {\n products(options: $options) {\n items {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n priceTiers { minQuantity price priceWithTax discountLabel }\n customFields { minOrderQuantity salesUnit }\n }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n totalItems\n }\n }\n";
4
4
  export declare const LIST_FACETS = "\n query ListFacets {\n facets {\n items {\n id name code\n values { id name code }\n }\n totalItems\n }\n }\n";
5
5
  export declare const LIST_COLLECTIONS = "\n query ListCollections($options: CollectionListOptions) {\n collections(options: $options) {\n items {\n id name slug description\n breadcrumbs { id name slug }\n featuredAsset {\n source\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n parent { id name slug }\n children { id name slug }\n }\n totalItems\n }\n }\n";
6
- export declare const GET_COLLECTION = "\n query GetCollection($slug: String!) {\n collection(slug: $slug) {\n id name slug description\n featuredAsset {\n source\n presets { l { url webpUrl } xl { url webpUrl } }\n }\n breadcrumbs { id name slug }\n children { id name slug }\n productVariants(options: { take: 20 }) {\n items {\n id\n product {\n id name slug\n featuredAsset { source presets { m { url webpUrl } } }\n }\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n }\n totalItems\n }\n }\n }\n";
6
+ export declare const GET_COLLECTION = "\n query GetCollection($slug: String!) {\n collection(slug: $slug) {\n id name slug description\n featuredAsset {\n source\n presets { l { url webpUrl } xl { url webpUrl } }\n }\n breadcrumbs { id name slug }\n children { id name slug }\n productVariants(options: { take: 20 }) {\n items {\n id\n product {\n id name slug\n featuredAsset { source presets { m { url webpUrl } } }\n }\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n customFields { minOrderQuantity salesUnit }\n }\n totalItems\n }\n }\n }\n";
7
7
  export declare const SEARCH_PRODUCTS = "\n query SearchProducts($input: SearchInput!) {\n search(input: $input) {\n items {\n productId productName slug description\n price { ... on SinglePrice { value } ... on PriceRange { min max } }\n priceWithTax { ... on SinglePrice { value } ... on PriceRange { min max } }\n currencyCode\n productAsset { preview focalPoint { x y } }\n collectionIds\n }\n totalItems\n facetValues { facetValue { id name code facet { id name code } } count }\n }\n }\n";
8
8
  export declare const ACTIVE_ORDER = "\n query ActiveOrder {\n activeOrder {\n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
9
9
  export declare const ADD_TO_CART = "\n mutation AddToCart($variantId: ID!, $quantity: Int!) {\n addItemToOrder(productVariantId: $variantId, quantity: $quantity) {\n ... on Order {\n id code state active totalQuantity\n subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode\n lines {\n id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax\n productVariant { id name sku product { id name slug } options { id name group { name } } }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n ... on OrderLimitError { errorCode message maxItems }\n ... on NegativeQuantityError { errorCode message }\n ... on InsufficientStockError { errorCode message quantityAvailable order { id } }\n }\n }\n";
@@ -24,6 +24,27 @@ export declare const REGISTER = "\n mutation Register($input: RegisterCustomerI
24
24
  export declare const GET_CURRENT_CUSTOMER = "\n query Me {\n activeCustomer {\n id firstName lastName emailAddress phoneNumber\n addresses {\n id fullName streetLine1 streetLine2 city province postalCode\n country { code name }\n defaultShippingAddress defaultBillingAddress\n }\n orders(options: { take: 10, sort: { createdAt: DESC } }) {\n items {\n id code state totalWithTax createdAt\n lines { id quantity productVariant { name } }\n }\n totalItems\n }\n }\n }\n";
25
25
  export declare const GET_CUSTOMER_ORDERS = "\n query CustomerOrders($options: OrderListOptions) {\n activeCustomer {\n orders(options: $options) {\n items {\n id code state totalWithTax createdAt\n lines { id quantity productVariant { name } }\n }\n totalItems\n }\n }\n }\n";
26
26
  export declare const LOGOUT = "\n mutation Logout {\n logout { success }\n }\n";
27
+ export declare const UPDATE_CUSTOMER = "\n mutation UpdateCustomer($input: UpdateCustomerInput!) {\n updateCustomer(input: $input) {\n id firstName lastName emailAddress phoneNumber\n }\n }\n";
28
+ export declare const UPDATE_PASSWORD = "\n mutation UpdatePassword($currentPassword: String!, $newPassword: String!) {\n updateCustomerPassword(currentPassword: $currentPassword, newPassword: $newPassword) {\n ... on Success { success }\n ... on InvalidCredentialsError { errorCode message }\n ... on PasswordValidationError { errorCode message validationErrorMessage }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
29
+ export declare const REQUEST_PASSWORD_RESET = "\n mutation RequestPasswordReset($emailAddress: String!) {\n requestPasswordReset(emailAddress: $emailAddress) {\n ... on Success { success }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
30
+ export declare const RESET_PASSWORD = "\n mutation ResetPassword($token: String!, $password: String!) {\n resetPassword(token: $token, password: $password) {\n ... on CurrentUser { id identifier }\n ... on PasswordResetTokenInvalidError { errorCode message }\n ... on PasswordResetTokenExpiredError { errorCode message }\n ... on PasswordValidationError { errorCode message validationErrorMessage }\n ... on NativeAuthStrategyError { errorCode message }\n ... on NotVerifiedError { errorCode message }\n }\n }\n";
31
+ export declare const REQUEST_EMAIL_UPDATE = "\n mutation RequestEmailUpdate($password: String!, $newEmailAddress: String!) {\n requestUpdateCustomerEmailAddress(password: $password, newEmailAddress: $newEmailAddress) {\n ... on Success { success }\n ... on InvalidCredentialsError { errorCode message }\n ... on EmailAddressConflictError { errorCode message }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
32
+ export declare const UPDATE_EMAIL = "\n mutation UpdateEmail($token: String!) {\n updateCustomerEmailAddress(token: $token) {\n ... on Success { success }\n ... on IdentifierChangeTokenInvalidError { errorCode message }\n ... on IdentifierChangeTokenExpiredError { errorCode message }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
33
+ export declare const VERIFY_ACCOUNT = "\n mutation VerifyAccount($token: String!, $password: String) {\n verifyCustomerAccount(token: $token, password: $password) {\n ... on CurrentUser { id identifier }\n ... on VerificationTokenInvalidError { errorCode message }\n ... on VerificationTokenExpiredError { errorCode message }\n ... on MissingPasswordError { errorCode message }\n ... on PasswordAlreadySetError { errorCode message }\n ... on PasswordValidationError { errorCode message validationErrorMessage }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
34
+ export declare const REFRESH_VERIFICATION = "\n mutation RefreshVerification($emailAddress: String!) {\n refreshCustomerVerification(emailAddress: $emailAddress) {\n ... on Success { success }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
35
+ export declare const CREATE_ADDRESS = "\n mutation CreateAddress($input: CreateAddressInput!) {\n createCustomerAddress(input: $input) {\n id fullName streetLine1 streetLine2 city province postalCode\n country { code name }\n defaultShippingAddress defaultBillingAddress\n }\n }\n";
36
+ export declare const UPDATE_ADDRESS = "\n mutation UpdateAddress($input: UpdateAddressInput!) {\n updateCustomerAddress(input: $input) {\n id fullName streetLine1 streetLine2 city province postalCode\n country { code name }\n defaultShippingAddress defaultBillingAddress\n }\n }\n";
37
+ export declare const DELETE_ADDRESS = "\n mutation DeleteAddress($id: ID!) {\n deleteCustomerAddress(id: $id) {\n success\n }\n }\n";
38
+ export declare const AVAILABLE_COUNTRIES = "\n query AvailableCountries {\n availableCountries {\n id code name\n }\n }\n";
39
+ export declare const ORDER_BY_CODE = "\n query OrderByCode($code: String!) {\n orderByCode(code: $code) {\n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
40
+ export declare const FAVORITE_VARIANT_IDS = "\n query FavoriteVariantIds {\n favoriteProductVariantIds\n }\n";
41
+ export declare const MY_FAVORITES = "\n query MyFavorites($options: FavoriteListOptions) {\n myFavorites(options: $options) {\n items {\n id\n productVariantId\n createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n product {\n id name slug\n featuredAsset {\n source\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit }\n }\n }\n totalItems\n }\n }\n";
42
+ export declare const TOGGLE_FAVORITE = "\n mutation ToggleFavorite($productVariantId: ID!) {\n toggleFavorite(productVariantId: $productVariantId)\n }\n";
43
+ export declare const REMOVE_FAVORITE = "\n mutation RemoveFavorite($productVariantId: ID!) {\n removeFavorite(productVariantId: $productVariantId)\n }\n";
44
+ export declare const GET_ACTIVE_CHANNEL = "\n query ActiveChannel {\n activeChannel {\n id code\n defaultLanguageCode\n availableLanguageCodes\n defaultCurrencyCode\n availableCurrencyCodes\n customFields\n }\n }\n";
45
+ export declare const PROPERTY_GROUPS = "\n query PropertyGroups {\n productPropertyGroups {\n id position\n translations { id languageCode name }\n properties {\n id slug fieldType isFilterable isRequired position\n config { options { value label } min max maxLength allowedCollectionIds filterableFieldSlugs }\n facetId\n fieldFacets { fieldSlug fieldType facetId }\n translations { id languageCode name helpText }\n }\n }\n }\n";
46
+ export declare const PRODUCT_PROPERTIES = "\n query ProductProperties($productId: ID!) {\n productPropertyValues(productId: $productId) {\n group {\n id position\n translations { id languageCode name }\n properties {\n id slug fieldType isFilterable isRequired position\n config { options { value label } min max maxLength }\n facetId\n fieldFacets { fieldSlug fieldType facetId }\n translations { id languageCode name helpText }\n }\n }\n values { id propertyId languageCode value }\n }\n }\n";
47
+ export declare const GET_PRODUCT_RECOMMENDATIONS = "\n query ProductRecommendations($productId: ID!, $groupSlug: String) {\n productRecommendations(productId: $productId, groupSlug: $groupSlug) {\n groupName\n groupSlug\n products {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n customFields { minOrderQuantity salesUnit }\n }\n }\n }\n }\n";
27
48
  export declare const GET_EXCHANGE_RATES = "\n query ExchangeRates {\n exchangeRates {\n baseCurrency targetCurrency rate inverseRate rateDate\n }\n }\n";
28
49
  export declare const CONVERT_CURRENCY = "\n query ConvertCurrency($amount: String!, $from: String!, $to: String!) {\n convertCurrency(amount: $amount, fromCurrency: $from, toCurrency: $to) {\n amount fromCurrency toCurrency rate result\n }\n }\n";
29
50
  //# sourceMappingURL=queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,ipCAsCvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,2oCAsC7B,CAAC;AAEF,eAAO,MAAM,aAAa,mrBAsBzB,CAAC;AAEF,eAAO,MAAM,WAAW,wJAUvB,CAAC;AAIF,eAAO,MAAM,gBAAgB,6ZAgB5B,CAAC;AAEF,eAAO,MAAM,cAAc,+oBAwB1B,CAAC;AAIF,eAAO,MAAM,eAAe,+gBAe3B,CAAC;AAIF,eAAO,MAAM,YAAY,2sBAyBxB,CAAC;AAEF,eAAO,MAAM,W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yEAIhC,CAAC;AAEF,eAAO,MAAM,YAAY,gyBA2BxB,CAAC;AAEF,eAAO,MAAM,eAAe,0HAI3B,CAAC;AAEF,eAAO,MAAM,eAAe,0HAI3B,CAAC;AAEF,eAAO,MAAM,kBAAkB,sNAW9B,CAAC;AAIF,eAAO,MAAM,eAAe,ycAc3B,CAAC;AAEF,eAAO,MAAM,kBAAkB,uiBAiB9B,CAAC;AAIF,eAAO,MAAM,2BAA2B,otBAsBvC,CAAC;AAIF,eAAO,MAAM,kBAAkB,8HAM9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,8NAM5B,CAAC"}
@@ -25,6 +25,12 @@ export const GET_PRODUCT = `
25
25
  priceListName retailPrice retailPriceWithTax
26
26
  priceTiers { minQuantity price priceWithTax discountLabel }
27
27
  options { id code name group { id name code } }
28
+ customFields { minOrderQuantity salesUnit }
29
+ featuredAsset {
30
+ source name
31
+ customFields { altText }
32
+ presets { xs { url webpUrl } m { url webpUrl } }
33
+ }
28
34
  assets {
29
35
  source name
30
36
  customFields { altText }
@@ -64,6 +70,12 @@ export const GET_PRODUCT_BY_ID = `
64
70
  priceListName retailPrice retailPriceWithTax
65
71
  priceTiers { minQuantity price priceWithTax discountLabel }
66
72
  options { id code name group { id name code } }
73
+ customFields { minOrderQuantity salesUnit }
74
+ featuredAsset {
75
+ source name
76
+ customFields { altText }
77
+ presets { xs { url webpUrl } m { url webpUrl } }
78
+ }
67
79
  assets {
68
80
  source name
69
81
  customFields { altText }
@@ -90,7 +102,9 @@ export const LIST_PRODUCTS = `
90
102
  id name sku
91
103
  price priceWithTax currencyCode stockLevel
92
104
  priceListName retailPrice retailPriceWithTax
105
+ priceTiers { minQuantity price priceWithTax discountLabel }
93
106
  priceTiers { minQuantity price priceWithTax discountLabel }
107
+ customFields { minOrderQuantity salesUnit }
94
108
  }
95
109
  facetValues { id name code facet { id name code } }
96
110
  collections { id name slug }
@@ -146,6 +160,8 @@ export const GET_COLLECTION = `
146
160
  }
147
161
  price priceWithTax currencyCode stockLevel
148
162
  priceListName retailPrice retailPriceWithTax
163
+ priceTiers { minQuantity price priceWithTax discountLabel }
164
+ customFields { minOrderQuantity salesUnit }
149
165
  }
150
166
  totalItems
151
167
  }
@@ -427,6 +443,253 @@ export const LOGOUT = `
427
443
  logout { success }
428
444
  }
429
445
  `;
446
+ export const UPDATE_CUSTOMER = `
447
+ mutation UpdateCustomer($input: UpdateCustomerInput!) {
448
+ updateCustomer(input: $input) {
449
+ id firstName lastName emailAddress phoneNumber
450
+ }
451
+ }
452
+ `;
453
+ export const UPDATE_PASSWORD = `
454
+ mutation UpdatePassword($currentPassword: String!, $newPassword: String!) {
455
+ updateCustomerPassword(currentPassword: $currentPassword, newPassword: $newPassword) {
456
+ ... on Success { success }
457
+ ... on InvalidCredentialsError { errorCode message }
458
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
459
+ ... on NativeAuthStrategyError { errorCode message }
460
+ }
461
+ }
462
+ `;
463
+ export const REQUEST_PASSWORD_RESET = `
464
+ mutation RequestPasswordReset($emailAddress: String!) {
465
+ requestPasswordReset(emailAddress: $emailAddress) {
466
+ ... on Success { success }
467
+ ... on NativeAuthStrategyError { errorCode message }
468
+ }
469
+ }
470
+ `;
471
+ export const RESET_PASSWORD = `
472
+ mutation ResetPassword($token: String!, $password: String!) {
473
+ resetPassword(token: $token, password: $password) {
474
+ ... on CurrentUser { id identifier }
475
+ ... on PasswordResetTokenInvalidError { errorCode message }
476
+ ... on PasswordResetTokenExpiredError { errorCode message }
477
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
478
+ ... on NativeAuthStrategyError { errorCode message }
479
+ ... on NotVerifiedError { errorCode message }
480
+ }
481
+ }
482
+ `;
483
+ export const REQUEST_EMAIL_UPDATE = `
484
+ mutation RequestEmailUpdate($password: String!, $newEmailAddress: String!) {
485
+ requestUpdateCustomerEmailAddress(password: $password, newEmailAddress: $newEmailAddress) {
486
+ ... on Success { success }
487
+ ... on InvalidCredentialsError { errorCode message }
488
+ ... on EmailAddressConflictError { errorCode message }
489
+ ... on NativeAuthStrategyError { errorCode message }
490
+ }
491
+ }
492
+ `;
493
+ export const UPDATE_EMAIL = `
494
+ mutation UpdateEmail($token: String!) {
495
+ updateCustomerEmailAddress(token: $token) {
496
+ ... on Success { success }
497
+ ... on IdentifierChangeTokenInvalidError { errorCode message }
498
+ ... on IdentifierChangeTokenExpiredError { errorCode message }
499
+ ... on NativeAuthStrategyError { errorCode message }
500
+ }
501
+ }
502
+ `;
503
+ export const VERIFY_ACCOUNT = `
504
+ mutation VerifyAccount($token: String!, $password: String) {
505
+ verifyCustomerAccount(token: $token, password: $password) {
506
+ ... on CurrentUser { id identifier }
507
+ ... on VerificationTokenInvalidError { errorCode message }
508
+ ... on VerificationTokenExpiredError { errorCode message }
509
+ ... on MissingPasswordError { errorCode message }
510
+ ... on PasswordAlreadySetError { errorCode message }
511
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
512
+ ... on NativeAuthStrategyError { errorCode message }
513
+ }
514
+ }
515
+ `;
516
+ export const REFRESH_VERIFICATION = `
517
+ mutation RefreshVerification($emailAddress: String!) {
518
+ refreshCustomerVerification(emailAddress: $emailAddress) {
519
+ ... on Success { success }
520
+ ... on NativeAuthStrategyError { errorCode message }
521
+ }
522
+ }
523
+ `;
524
+ export const CREATE_ADDRESS = `
525
+ mutation CreateAddress($input: CreateAddressInput!) {
526
+ createCustomerAddress(input: $input) {
527
+ id fullName streetLine1 streetLine2 city province postalCode
528
+ country { code name }
529
+ defaultShippingAddress defaultBillingAddress
530
+ }
531
+ }
532
+ `;
533
+ export const UPDATE_ADDRESS = `
534
+ mutation UpdateAddress($input: UpdateAddressInput!) {
535
+ updateCustomerAddress(input: $input) {
536
+ id fullName streetLine1 streetLine2 city province postalCode
537
+ country { code name }
538
+ defaultShippingAddress defaultBillingAddress
539
+ }
540
+ }
541
+ `;
542
+ export const DELETE_ADDRESS = `
543
+ mutation DeleteAddress($id: ID!) {
544
+ deleteCustomerAddress(id: $id) {
545
+ success
546
+ }
547
+ }
548
+ `;
549
+ export const AVAILABLE_COUNTRIES = `
550
+ query AvailableCountries {
551
+ availableCountries {
552
+ id code name
553
+ }
554
+ }
555
+ `;
556
+ export const ORDER_BY_CODE = `
557
+ query OrderByCode($code: String!) {
558
+ orderByCode(code: $code) {
559
+ id code state active
560
+ totalQuantity
561
+ subTotal subTotalWithTax
562
+ shipping shippingWithTax
563
+ total totalWithTax
564
+ currencyCode
565
+ lines {
566
+ id quantity
567
+ unitPrice unitPriceWithTax
568
+ linePrice linePriceWithTax
569
+ productVariant {
570
+ id name sku
571
+ product { id name slug }
572
+ options { id name group { name } }
573
+ }
574
+ featuredAsset { source presets { xs { url webpUrl } } }
575
+ }
576
+ shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
577
+ customer { id firstName lastName emailAddress }
578
+ couponCodes
579
+ }
580
+ }
581
+ `;
582
+ export const FAVORITE_VARIANT_IDS = `
583
+ query FavoriteVariantIds {
584
+ favoriteProductVariantIds
585
+ }
586
+ `;
587
+ export const MY_FAVORITES = `
588
+ query MyFavorites($options: FavoriteListOptions) {
589
+ myFavorites(options: $options) {
590
+ items {
591
+ id
592
+ productVariantId
593
+ createdAt
594
+ productVariant {
595
+ id name sku
596
+ price priceWithTax currencyCode stockLevel
597
+ priceListName retailPrice retailPriceWithTax
598
+ priceTiers { minQuantity price priceWithTax discountLabel }
599
+ product {
600
+ id name slug
601
+ featuredAsset {
602
+ source
603
+ customFields { altText }
604
+ presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }
605
+ }
606
+ }
607
+ options { id name group { name } }
608
+ customFields { minOrderQuantity salesUnit }
609
+ }
610
+ }
611
+ totalItems
612
+ }
613
+ }
614
+ `;
615
+ export const TOGGLE_FAVORITE = `
616
+ mutation ToggleFavorite($productVariantId: ID!) {
617
+ toggleFavorite(productVariantId: $productVariantId)
618
+ }
619
+ `;
620
+ export const REMOVE_FAVORITE = `
621
+ mutation RemoveFavorite($productVariantId: ID!) {
622
+ removeFavorite(productVariantId: $productVariantId)
623
+ }
624
+ `;
625
+ export const GET_ACTIVE_CHANNEL = `
626
+ query ActiveChannel {
627
+ activeChannel {
628
+ id code
629
+ defaultLanguageCode
630
+ availableLanguageCodes
631
+ defaultCurrencyCode
632
+ availableCurrencyCodes
633
+ customFields
634
+ }
635
+ }
636
+ `;
637
+ export const PROPERTY_GROUPS = `
638
+ query PropertyGroups {
639
+ productPropertyGroups {
640
+ id position
641
+ translations { id languageCode name }
642
+ properties {
643
+ id slug fieldType isFilterable isRequired position
644
+ config { options { value label } min max maxLength allowedCollectionIds filterableFieldSlugs }
645
+ facetId
646
+ fieldFacets { fieldSlug fieldType facetId }
647
+ translations { id languageCode name helpText }
648
+ }
649
+ }
650
+ }
651
+ `;
652
+ export const PRODUCT_PROPERTIES = `
653
+ query ProductProperties($productId: ID!) {
654
+ productPropertyValues(productId: $productId) {
655
+ group {
656
+ id position
657
+ translations { id languageCode name }
658
+ properties {
659
+ id slug fieldType isFilterable isRequired position
660
+ config { options { value label } min max maxLength }
661
+ facetId
662
+ fieldFacets { fieldSlug fieldType facetId }
663
+ translations { id languageCode name helpText }
664
+ }
665
+ }
666
+ values { id propertyId languageCode value }
667
+ }
668
+ }
669
+ `;
670
+ export const GET_PRODUCT_RECOMMENDATIONS = `
671
+ query ProductRecommendations($productId: ID!, $groupSlug: String) {
672
+ productRecommendations(productId: $productId, groupSlug: $groupSlug) {
673
+ groupName
674
+ groupSlug
675
+ products {
676
+ id name slug description
677
+ featuredAsset {
678
+ source name
679
+ customFields { altText }
680
+ presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }
681
+ }
682
+ variants {
683
+ id name sku
684
+ price priceWithTax currencyCode stockLevel
685
+ priceListName retailPrice retailPriceWithTax
686
+ priceTiers { minQuantity price priceWithTax discountLabel }
687
+ customFields { minOrderQuantity salesUnit }
688
+ }
689
+ }
690
+ }
691
+ }
692
+ `;
430
693
  export const GET_EXCHANGE_RATES = `
431
694
  query Exch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;;;;;;;;;CAWjC,CAAC;AAIF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;CAc9B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;CAiBjC,CAAC;AAIF,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB1C,CAAC;AAIF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;CAMjC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;CAM/B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { RecommendedProductGroup } from '../types.js';
3
+ export declare function createRecommendationsMethods(http: HttpClient): {
4
+ getProductRecommendations(productId: string, groupSlug?: string): Promise<RecommendedProductGroup[]>;
5
+ };
6
+ //# sourceMappingURL=recommendations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendations.d.ts","sourceRoot":"","sources":["../../src/commerce/recommendations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAG3D,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU;yCAG5C,MAAM,cACL,MAAM,GACjB,OAAO,CAAC,uBAAuB,EAAE,CAAC;EAOxC"}
@@ -0,0 +1,10 @@
1
+ import { GET_PRODUCT_RECOMMENDATIONS } from './queries.js';
2
+ export function createRecommendationsMethods(http) {
3
+ return {
4
+ async getProductRecommendations(productId, groupSlug) {
5
+ const data = await http.graphql(GET_PRODUCT_RECOMMENDATIONS, { productId, groupSlug });
6
+ return data.productRecommendations;
7
+ },
8
+ };
9
+ }
10
+ //# sourceMappingURL=recommendations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendations.js","sourceRoot":"","sources":["../../src/commerce/recommendations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,UAAU,4BAA4B,CAAC,IAAgB;IAC3D,OAAO;QACL,KAAK,CAAC,yBAAyB,CAC7B,SAAiB,EACjB,SAAkB;YAElB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAE5B,2BAA2B,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;YAC1D,OAAO,IAAI,CAAC,sBAAsB,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { CreateReviewInput, CreateReviewResult, ProductReview, ReviewAttribute, ReviewAttributeAggregation, ReviewChannelConfig, ReviewListOptions, ReviewMediaUploadResult, ReviewRatingSummary, UpdateReviewInput } from '../types.js';
3
+ export declare function createReviewMethods(http: HttpClient): {
4
+ getProductReviews(productId: string, options?: ReviewListOptions): Promise<{
5
+ items: ProductReview[];
6
+ totalItems: number;
7
+ nextCursor: string | null;
8
+ }>;
9
+ getReviewRatingSummary(productId: string): Promise<ReviewRatingSummary>;
10
+ getReviewAttributeAggregations(productId: string): Promise<ReviewAttributeAggregation[]>;
11
+ getReviewAttributes(productId?: string): Promise<ReviewAttribute[]>;
12
+ getMyReview(productId: string): Promise<ProductReview | null>;
13
+ getReviewChannelConfig(): Promise<ReviewChannelConfig>;
14
+ createReview(input: CreateReviewInput): Promise<CreateReviewResult>;
15
+ updateReview(id: string, input: UpdateReviewInput): Promise<ProductReview>;
16
+ deleteReview(id: string): Promise<boolean>;
17
+ voteReview(reviewId: string, isHelpful: boolean): Promise<boolean>;
18
+ reportReview(reviewId: string, reason: string): Promise<boolean>;
19
+ uploadReviewMedia(files: File[]): Promise<ReviewMediaUploadResult[]>;
20
+ };
21
+ //# sourceMappingURL=reviews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../src/commerce/reviews.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAuGrB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;iCAGnC,MAAM,YACP,iBAAiB,GAC1B,OAAO,CAAC;QAAE,KAAK,EAAE,aAAa,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;sCAO7C,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;8CAQ7B,MAAM,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;oCAOxD,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;2BAQ5C,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;8BAOnC,OAAO,CAAC,mBAAmB,CAAC;wBAOlC,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;qBAOlD,MAAM,SAAS,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;qBAQzD,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;yBAKrB,MAAM,aAAa,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;2BAQ3C,MAAM,UAAU,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;6BAQvC,IAAI,EAAE,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;EAc7E"}
@@ -0,0 +1,159 @@
1
+ const REVIEW_FRAGMENT = `
2
+ id rating title body status variantId
3
+ isVerifiedPurchase isEdited customerDisplayName
4
+ imageAssetIds videoAssetIds attributeValues
5
+ helpfulCount notHelpfulCount
6
+ merchantReply merchantReplyAt myVote
7
+ createdAt updatedAt
8
+ `;
9
+ const GET_PRODUCT_REVIEWS = `
10
+ query ProductReviews($productId: ID!, $options: ProductReviewListOptions) {
11
+ productReviews(productId: $productId, options: $options) {
12
+ items { ${REVIEW_FRAGMENT} }
13
+ totalItems
14
+ nextCursor
15
+ }
16
+ }
17
+ `;
18
+ const GET_RATING_SUMMARY = `
19
+ query ProductRatingSummary($productId: ID!) {
20
+ productRatingSummary(productId: $productId) {
21
+ averageRating reviewCount ratingCount
22
+ distribution { one two three four five }
23
+ }
24
+ }
25
+ `;
26
+ const GET_ATTRIBUTE_AGGREGATIONS = `
27
+ query ProductReviewAttributeAggregations($productId: ID!) {
28
+ productReviewAttributeAggregations(productId: $productId) {
29
+ attributeId label inputType averageRating distribution
30
+ }
31
+ }
32
+ `;
33
+ const GET_REVIEW_ATTRIBUTES = `
34
+ query ReviewAttributes($productId: ID) {
35
+ reviewAttributes(productId: $productId) {
36
+ id slug label inputType options isRequired section
37
+ }
38
+ }
39
+ `;
40
+ const GET_MY_REVIEW = `
41
+ query MyProductReview($productId: ID!) {
42
+ myProductReview(productId: $productId) { ${REVIEW_FRAGMENT} }
43
+ }
44
+ `;
45
+ const GET_CHANNEL_CONFIG = `
46
+ query ReviewChannelConfig {
47
+ reviewChannelConfig {
48
+ reviewsEnabled reviewsRequireText reviewsAllowMedia
49
+ reviewsAllowVoting reviewsAllowRating
50
+ reviewMinBodyLength reviewMaxTitleLength reviewMaxImages reviewMaxVideos
51
+ }
52
+ }
53
+ `;
54
+ const CREATE_REVIEW = `
55
+ mutation CreateProductReview($input: CreateProductReviewInput!) {
56
+ createProductReview(input: $input) {
57
+ review { ${REVIEW_FRAGMENT} }
58
+ requiresModeration
59
+ }
60
+ }
61
+ `;
62
+ const UPDATE_REVIEW = `
63
+ mutation UpdateProductReview($id: ID!, $input: UpdateProductReviewInput!) {
64
+ updateProductReview(id: $id, input: $input) { ${REVIEW_FRAGMENT} }
65
+ }
66
+ `;
67
+ const DELETE_REVIEW = `
68
+ mutation DeleteProductReview($id: ID!) {
69
+ deleteProductReview(id: $id)
70
+ }
71
+ `;
72
+ const VOTE_REVIEW = `
73
+ mutation VoteProductReview($reviewId: ID!, $isHelpful: Boolean!) {
74
+ voteProductReview(reviewId: $reviewId, isHelpful: $isHelpful)
75
+ }
76
+ `;
77
+ const REPORT_REVIEW = `
78
+ mutation ReportProductReview($reviewId: ID!, $reason: String!) {
79
+ reportProductReview(reviewId: $reviewId, reason: $reason)
80
+ }
81
+ `;
82
+ const UPLOAD_REVIEW_MEDIA = `
83
+ mutation UploadReviewMedia($files: [Upload!]!) {
84
+ uploadReviewMedia(files: $files) {
85
+ id preview mimeType
86
+ }
87
+ }
88
+ `;
89
+ export function createReviewMethods(http) {
90
+ return {
91
+ async getProductReviews(productId, options) {
92
+ const data = await http.graphql(GET_PRODUCT_REVIEWS, { productId, options });
93
+ return data.productReviews;
94
+ },
95
+ async getReviewRatingSummary(productId) {
96
+ const data = await http.graphql(GET_RATING_SUMMARY, { productId });
97
+ return data.productRatingSummary;
98
+ },
99
+ async getReviewAttributeAggregations(productId) {
100
+ const data = await http.graphql(GET_ATTRIBUTE_AGGREGATIONS, { productId });
101
+ return data.productReviewAttributeAggregations;
102
+ },
103
+ async getReviewAttributes(productId) {
104
+ const data = await http.graphql(GET_REVIEW_ATTRIBUTES, { productId });
105
+ return data.reviewAttributes;
106
+ },
107
+ async getMyReview(productId) {
108
+ const data = await http.graphql(GET_MY_REVIEW, {
109
+ productId,
110
+ });
111
+ return data.myProductReview;
112
+ },
113
+ async getReviewChannelConfig() {
114
+ const data = await http.graphql(GET_CHANNEL_CONFIG);
115
+ return data.reviewChannelConfig;
116
+ },
117
+ async createReview(input) {
118
+ const data = await http.graphql(CREATE_REVIEW, {
119
+ input,
120
+ });
121
+ return data.createProductReview;
122
+ },
123
+ async updateReview(id, input) {
124
+ const data = await http.graphql(UPDATE_REVIEW, {
125
+ id,
126
+ input,
127
+ });
128
+ return data.updateProductReview;
129
+ },
130
+ async deleteReview(id) {
131
+ const data = await http.graphql(DELETE_REVIEW, { id });
132
+ return data.deleteProductReview;
133
+ },
134
+ async voteReview(reviewId, isHelpful) {
135
+ const data = await http.graphql(VOTE_REVIEW, {
136
+ reviewId,
137
+ isHelpful,
138
+ });
139
+ return data.voteProductReview;
140
+ },
141
+ async reportReview(reviewId, reason) {
142
+ const data = await http.graphql(REPORT_REVIEW, {
143
+ reviewId,
144
+ reason,
145
+ });
146
+ return data.reportProductReview;
147
+ },
148
+ async uploadReviewMedia(files) {
149
+ const fileMap = new Map();
150
+ files.forEach((file, index) => {
151
+ fileMap.set(`variables.files.${String(index)}`, file);
152
+ });
153
+ const variables = { files: files.map(() => null) };
154
+ const data = await http.graphqlUpload(UPLOAD_REVIEW_MEDIA, variables, fileMap);
155
+ return data.uploadReviewMedia;
156
+ },
157
+ };
158
+ }
159
+ //# sourceMappingURL=reviews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviews.js","sourceRoot":"","sources":["../../src/commerce/reviews.ts"],"names":[],"mappings":"AAcA,MAAM,eAAe,GAAG;;;;;;;CAOvB,CAAC;AAEF,MAAM,mBAAmB,GAAG;;;gBAGZ,eAAe;;;;;CAK9B,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;;;;;CAO1B,CAAC;AAEF,MAAM,0BAA0B,GAAG;;;;;;CAMlC,CAAC;AAEF,MAAM,qBAAqB,GAAG;;;;;;CAM7B,CAAC;AAEF,MAAM,aAAa,GAAG;;+CAEyB,eAAe;;CAE7D,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;;;;;;CAQ1B,CAAC;AAEF,MAAM,aAAa,GAAG;;;iBAGL,eAAe;;;;CAI/B,CAAC;AAEF,MAAM,aAAa,GAAG;;oDAE8B,eAAe;;CAElE,CAAC;AAEF,MAAM,aAAa,GAAG;;;;CAIrB,CAAC;AAEF,MAAM,WAAW,GAAG;;;;CAInB,CAAC;AAEF,MAAM,aAAa,GAAG;;;;CAIrB,CAAC;AAEF,MAAM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AC;YAEH,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAEnD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAElC,mBAAmB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC,iBAAiB,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { HttpClient } from '../core/http.js';
2
- import type { SearchInput, SearchResult } from '../types.js';
2
+ import type { RequestOptions, SearchInput, SearchResult } from '../types.js';
3
3
  export declare function createSearchMethods(http: HttpClient): {
4
- searchProducts(input: SearchInput): Promise<SearchResult>;
4
+ searchProducts(input: SearchInput, options?: RequestOptions): Promise<SearchResult>;
5
5
  };
6
6
  //# sourceMappingURL=search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commerce/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG7D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;0BAEpB,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EAclE"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commerce/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG7E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;0BAEpB,WAAW,YAAY,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;EAkB5F"}
@@ -1,21 +1,23 @@
1
1
  import { SEARCH_PRODUCTS } from './queries.js';
2
2
  export function createSearchMethods(http) {
3
3
  return {
4
- async searchProducts(input) {
4
+ async searchProducts(input, options) {
5
5
  const vars = { term: input.term };
6
6
  if (input.collectionSlug)
7
7
  vars.collectionSlug = input.collectionSlug;
8
+ if (input.collectionId)
9
+ vars.collectionId = input.collectionId;
8
10
  if (input.facetValueIds?.length)
9
11
  vars.facetValueIds = input.facetValueIds;
12
+ if (input.facetValueFilters?.length)
13
+ vars.facetValueFilters = input.facetValueFilters;
10
14
  if (input.take != null)
11
15
  vars.take = input.take;
12
16
  if (input.skip != null)
13
17
  vars.skip = input.skip;
14
18
  if (input.sort)
15
19
  vars.sort = input.sort;
16
- const data = await http.graphql(SEARCH_PRODUCTS, {
17
- input: vars,
18
- });
20
+ const data = await http.graphql(SEARCH_PRODUCTS, { input: vars }, options);
19
21
  return data.search;
20
22
  },
21
23
  };