@salesforce/commerce-sdk-react 1.0.0-preview.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 (143) hide show
  1. package/.eslintrc.js +10 -0
  2. package/CHANGELOG.md +35 -0
  3. package/LICENSE +14 -0
  4. package/README.md +327 -0
  5. package/auth/index.d.ts +220 -0
  6. package/auth/index.js +472 -0
  7. package/auth/storage.d.ts +48 -0
  8. package/auth/storage.js +122 -0
  9. package/components/ShopperExperience/Component/index.d.ts +17 -0
  10. package/components/ShopperExperience/Component/index.js +49 -0
  11. package/components/ShopperExperience/Page/index.d.ts +28 -0
  12. package/components/ShopperExperience/Page/index.js +97 -0
  13. package/components/ShopperExperience/Region/index.d.ts +41 -0
  14. package/components/ShopperExperience/Region/index.js +64 -0
  15. package/components/ShopperExperience/index.d.ts +5 -0
  16. package/components/ShopperExperience/index.js +49 -0
  17. package/components/ShopperExperience/prop-types.d.ts +39 -0
  18. package/components/ShopperExperience/prop-types.js +46 -0
  19. package/components/ShopperExperience/types.d.ts +8 -0
  20. package/components/ShopperExperience/types.js +5 -0
  21. package/components/index.d.ts +2 -0
  22. package/components/index.js +16 -0
  23. package/hooks/ShopperBaskets/cache.d.ts +5 -0
  24. package/hooks/ShopperBaskets/cache.js +351 -0
  25. package/hooks/ShopperBaskets/index.d.ts +3 -0
  26. package/hooks/ShopperBaskets/index.js +27 -0
  27. package/hooks/ShopperBaskets/mutation.d.ts +381 -0
  28. package/hooks/ShopperBaskets/mutation.js +380 -0
  29. package/hooks/ShopperBaskets/query.d.ts +55 -0
  30. package/hooks/ShopperBaskets/query.js +215 -0
  31. package/hooks/ShopperBaskets/queryKeyHelpers.d.ts +72 -0
  32. package/hooks/ShopperBaskets/queryKeyHelpers.js +49 -0
  33. package/hooks/ShopperContexts/cache.d.ts +5 -0
  34. package/hooks/ShopperContexts/cache.js +45 -0
  35. package/hooks/ShopperContexts/index.d.ts +3 -0
  36. package/hooks/ShopperContexts/index.js +27 -0
  37. package/hooks/ShopperContexts/mutation.d.ts +35 -0
  38. package/hooks/ShopperContexts/mutation.js +68 -0
  39. package/hooks/ShopperContexts/query.d.ts +15 -0
  40. package/hooks/ShopperContexts/query.js +59 -0
  41. package/hooks/ShopperContexts/queryKeyHelpers.d.ts +30 -0
  42. package/hooks/ShopperContexts/queryKeyHelpers.js +25 -0
  43. package/hooks/ShopperCustomers/cache.d.ts +5 -0
  44. package/hooks/ShopperCustomers/cache.js +387 -0
  45. package/hooks/ShopperCustomers/index.d.ts +3 -0
  46. package/hooks/ShopperCustomers/index.js +27 -0
  47. package/hooks/ShopperCustomers/mutation.d.ts +163 -0
  48. package/hooks/ShopperCustomers/mutation.js +203 -0
  49. package/hooks/ShopperCustomers/query.d.ts +115 -0
  50. package/hooks/ShopperCustomers/query.js +489 -0
  51. package/hooks/ShopperCustomers/queryKeyHelpers.d.ts +142 -0
  52. package/hooks/ShopperCustomers/queryKeyHelpers.js +91 -0
  53. package/hooks/ShopperExperience/index.d.ts +2 -0
  54. package/hooks/ShopperExperience/index.js +16 -0
  55. package/hooks/ShopperExperience/query.d.ts +31 -0
  56. package/hooks/ShopperExperience/query.js +104 -0
  57. package/hooks/ShopperExperience/queryKeyHelpers.d.ts +38 -0
  58. package/hooks/ShopperExperience/queryKeyHelpers.js +31 -0
  59. package/hooks/ShopperGiftCertificates/index.d.ts +2 -0
  60. package/hooks/ShopperGiftCertificates/index.js +16 -0
  61. package/hooks/ShopperGiftCertificates/query.d.ts +15 -0
  62. package/hooks/ShopperGiftCertificates/query.js +70 -0
  63. package/hooks/ShopperGiftCertificates/queryKeyHelpers.d.ts +29 -0
  64. package/hooks/ShopperGiftCertificates/queryKeyHelpers.js +25 -0
  65. package/hooks/ShopperLogin/cache.d.ts +3 -0
  66. package/hooks/ShopperLogin/cache.js +33 -0
  67. package/hooks/ShopperLogin/index.d.ts +3 -0
  68. package/hooks/ShopperLogin/index.js +27 -0
  69. package/hooks/ShopperLogin/mutation.d.ts +119 -0
  70. package/hooks/ShopperLogin/mutation.js +138 -0
  71. package/hooks/ShopperLogin/query.d.ts +45 -0
  72. package/hooks/ShopperLogin/query.js +176 -0
  73. package/hooks/ShopperLogin/queryKeyHelpers.d.ts +53 -0
  74. package/hooks/ShopperLogin/queryKeyHelpers.js +43 -0
  75. package/hooks/ShopperOrders/cache.d.ts +5 -0
  76. package/hooks/ShopperOrders/cache.js +54 -0
  77. package/hooks/ShopperOrders/index.d.ts +3 -0
  78. package/hooks/ShopperOrders/index.js +27 -0
  79. package/hooks/ShopperOrders/mutation.d.ts +54 -0
  80. package/hooks/ShopperOrders/mutation.js +83 -0
  81. package/hooks/ShopperOrders/query.d.ts +37 -0
  82. package/hooks/ShopperOrders/query.js +139 -0
  83. package/hooks/ShopperOrders/queryKeyHelpers.d.ts +50 -0
  84. package/hooks/ShopperOrders/queryKeyHelpers.js +37 -0
  85. package/hooks/ShopperProducts/index.d.ts +2 -0
  86. package/hooks/ShopperProducts/index.js +16 -0
  87. package/hooks/ShopperProducts/query.d.ts +47 -0
  88. package/hooks/ShopperProducts/query.js +178 -0
  89. package/hooks/ShopperProducts/queryKeyHelpers.d.ts +55 -0
  90. package/hooks/ShopperProducts/queryKeyHelpers.js +43 -0
  91. package/hooks/ShopperPromotions/index.d.ts +2 -0
  92. package/hooks/ShopperPromotions/index.js +16 -0
  93. package/hooks/ShopperPromotions/query.d.ts +29 -0
  94. package/hooks/ShopperPromotions/query.js +102 -0
  95. package/hooks/ShopperPromotions/queryKeyHelpers.d.ts +38 -0
  96. package/hooks/ShopperPromotions/queryKeyHelpers.js +31 -0
  97. package/hooks/ShopperSearch/index.d.ts +2 -0
  98. package/hooks/ShopperSearch/index.js +16 -0
  99. package/hooks/ShopperSearch/query.d.ts +26 -0
  100. package/hooks/ShopperSearch/query.js +99 -0
  101. package/hooks/ShopperSearch/queryKeyHelpers.d.ts +37 -0
  102. package/hooks/ShopperSearch/queryKeyHelpers.js +31 -0
  103. package/hooks/index.d.ts +18 -0
  104. package/hooks/index.js +188 -0
  105. package/hooks/types.d.ts +128 -0
  106. package/hooks/types.js +5 -0
  107. package/hooks/useAccessToken.d.ts +11 -0
  108. package/hooks/useAccessToken.js +43 -0
  109. package/hooks/useAuthContext.d.ts +9 -0
  110. package/hooks/useAuthContext.js +30 -0
  111. package/hooks/useAuthHelper.d.ts +23 -0
  112. package/hooks/useAuthHelper.js +66 -0
  113. package/hooks/useAuthorizationHeader.d.ts +9 -0
  114. package/hooks/useAuthorizationHeader.js +45 -0
  115. package/hooks/useCommerceApi.d.ts +9 -0
  116. package/hooks/useCommerceApi.js +26 -0
  117. package/hooks/useConfig.d.ts +7 -0
  118. package/hooks/useConfig.js +24 -0
  119. package/hooks/useCustomerId.d.ts +7 -0
  120. package/hooks/useCustomerId.js +38 -0
  121. package/hooks/useCustomerType.d.ts +21 -0
  122. package/hooks/useCustomerType.js +43 -0
  123. package/hooks/useEncUserId.d.ts +9 -0
  124. package/hooks/useEncUserId.js +36 -0
  125. package/hooks/useLocalStorage.d.ts +8 -0
  126. package/hooks/useLocalStorage.js +40 -0
  127. package/hooks/useMutation.d.ts +12 -0
  128. package/hooks/useMutation.js +38 -0
  129. package/hooks/useQuery.d.ts +15 -0
  130. package/hooks/useQuery.js +57 -0
  131. package/hooks/useUsid.d.ts +7 -0
  132. package/hooks/useUsid.js +34 -0
  133. package/hooks/utils.d.ts +32 -0
  134. package/hooks/utils.js +125 -0
  135. package/index.d.ts +5 -0
  136. package/index.js +40 -0
  137. package/package.json +88 -0
  138. package/provider.d.ts +36 -0
  139. package/provider.js +124 -0
  140. package/scripts/build-and-release-docs.js +48 -0
  141. package/scripts/version.js +22 -0
  142. package/utils.d.ts +5 -0
  143. package/utils.js +18 -0
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ShopperCustomersMutations = void 0;
7
+ exports.useShopperCustomersMutation = useShopperCustomersMutation;
8
+ var _useMutation = require("../useMutation");
9
+ var _utils = require("../utils");
10
+ var _useCommerceApi = _interopRequireDefault(require("../useCommerceApi"));
11
+ var _cache = require("./cache");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ /*
14
+ * Copyright (c) 2023, Salesforce, Inc.
15
+ * All rights reserved.
16
+ * SPDX-License-Identifier: BSD-3-Clause
17
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
18
+ */
19
+
20
+ /** Mutations available for Shopper Customers. */
21
+ const ShopperCustomersMutations = {
22
+ /**
23
+ * Registers a new customer. The mandatory data are the credentials, profile last name, and email. This requires a JSON Web Token (JWT) which needs to be obtained using the POST /customers/auth API with type \"guest\".
24
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `registerCustomer` endpoint.
25
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=registerCustomer| Salesforce Developer Center} for more information about the API endpoint.
26
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#registercustomer | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
27
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
28
+ */
29
+ RegisterCustomer: 'registerCustomer',
30
+ /**
31
+ * Reset customer password, after obtaining a reset token. This is the second step in the reset customer password flow, where a customer password is reset by providing the new credentials along with a reset token. This call should be preceded by a call to the /create-reset-token endpoint.
32
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `resetPassword` endpoint.
33
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=resetPassword| Salesforce Developer Center} for more information about the API endpoint.
34
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#resetpassword | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
35
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
36
+ */
37
+ ResetPassword: 'resetPassword',
38
+ /**
39
+ * Get reset password token. This is the first step in the reset customer password flow, where a password reset token is requested for future use to reset a customer password. This call should be followed by a call to the /reset endpoint.
40
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `getResetPasswordToken` endpoint.
41
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getResetPasswordToken| Salesforce Developer Center} for more information about the API endpoint.
42
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getresetpasswordtoken | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
43
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
44
+ */
45
+ GetResetPasswordToken: 'getResetPasswordToken',
46
+ // TODO: Re-implement (and update description from RAML spec) when the endpoint exits closed beta.
47
+ // /**
48
+ // * Registers a new external profile for a customer. This endpoint is in closed beta, available to select few customers. Please get in touch with your Account Team if you'd like to participate in the beta program
49
+ // * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `registerExternalProfile` endpoint.
50
+ // * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=registerExternalProfile| Salesforce Developer Center} for more information about the API endpoint.
51
+ // * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#registerexternalprofile | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
52
+ // * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
53
+ // */
54
+ // RegisterExternalProfile: 'registerExternalProfile',
55
+ /**
56
+ * Updates a customer.
57
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `updateCustomer` endpoint.
58
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=updateCustomer| Salesforce Developer Center} for more information about the API endpoint.
59
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#updatecustomer | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
60
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
61
+ */
62
+ UpdateCustomer: 'updateCustomer',
63
+ /**
64
+ * Creates a new address with the given name for the given customer.
65
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `createCustomerAddress` endpoint.
66
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=createCustomerAddress| Salesforce Developer Center} for more information about the API endpoint.
67
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#createcustomeraddress | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
68
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
69
+ */
70
+ CreateCustomerAddress: 'createCustomerAddress',
71
+ /**
72
+ * Deletes a customer's address by address name.
73
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `removeCustomerAddress` endpoint.
74
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=removeCustomerAddress| Salesforce Developer Center} for more information about the API endpoint.
75
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#removecustomeraddress | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
76
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
77
+ */
78
+ RemoveCustomerAddress: 'removeCustomerAddress',
79
+ /**
80
+ * Updates a customer's address by address name.
81
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `updateCustomerAddress` endpoint.
82
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=updateCustomerAddress| Salesforce Developer Center} for more information about the API endpoint.
83
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#updatecustomeraddress | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
84
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
85
+ */
86
+ UpdateCustomerAddress: 'updateCustomerAddress',
87
+ /**
88
+ * Updates the customer's password.
89
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `updateCustomerPassword` endpoint.
90
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=updateCustomerPassword| Salesforce Developer Center} for more information about the API endpoint.
91
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#updatecustomerpassword | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
92
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
93
+ */
94
+ UpdateCustomerPassword: 'updateCustomerPassword',
95
+ /**
96
+ * Adds a payment instrument to the customer information.
97
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `createCustomerPaymentInstrument` endpoint.
98
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=createCustomerPaymentInstrument| Salesforce Developer Center} for more information about the API endpoint.
99
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#createcustomerpaymentinstrument | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
100
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
101
+ */
102
+ CreateCustomerPaymentInstrument: 'createCustomerPaymentInstrument',
103
+ /**
104
+ * Deletes a customer's payment instrument.
105
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `deleteCustomerPaymentInstrument` endpoint.
106
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=deleteCustomerPaymentInstrument| Salesforce Developer Center} for more information about the API endpoint.
107
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#deletecustomerpaymentinstrument | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
108
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
109
+ */
110
+ DeleteCustomerPaymentInstrument: 'deleteCustomerPaymentInstrument',
111
+ /**
112
+ * Creates a customer product list.
113
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `createCustomerProductList` endpoint.
114
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=createCustomerProductList| Salesforce Developer Center} for more information about the API endpoint.
115
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#createcustomerproductlist | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
116
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
117
+ */
118
+ CreateCustomerProductList: 'createCustomerProductList',
119
+ /**
120
+ * Deletes a customer product list.
121
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `deleteCustomerProductList` endpoint.
122
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=deleteCustomerProductList| Salesforce Developer Center} for more information about the API endpoint.
123
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#deletecustomerproductlist | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
124
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
125
+ */
126
+ DeleteCustomerProductList: 'deleteCustomerProductList',
127
+ /**
128
+ * Changes a product list. Changeable properties are the name, description, and if the list is public.
129
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `updateCustomerProductList` endpoint.
130
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=updateCustomerProductList| Salesforce Developer Center} for more information about the API endpoint.
131
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#updatecustomerproductlist | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
132
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
133
+ */
134
+ UpdateCustomerProductList: 'updateCustomerProductList',
135
+ /**
136
+ * Adds an item to the customer's product list. Considered values from the request body are:
137
+ type: A valid type, mandatory. This is the type of the item to be added to the customer's product.
138
+ list.
139
+ priority: This is the priority of the item to be added to the customer's product list.
140
+ public: This is the flag whether the item to be added to the customer's product list is public.
141
+ product_id: A valid product ID, used for product item type only. This is the ID (SKU)
142
+ of the product related to the item to be added to the customer's product list. It is mandatory for
143
+ product item type, and it must be a valid product id, otherwise
144
+ ProductListProductIdMissingException or ProductListProductNotFoundException
145
+ will be thrown.
146
+ quantity: Used for product item type only. This is the quantity of the item to be
147
+ added to the customer's product list.
148
+ custom properties in the form c_\<CUSTOM_NAME\>: The custom property must correspond to a custom
149
+ attribute (\<CUSTOM_NAME\>) defined for ProductListItem. The value of this property must be valid for the
150
+ type of custom attribute defined for ProductListItem.
151
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `createCustomerProductListItem` endpoint.
152
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=createCustomerProductListItem| Salesforce Developer Center} for more information about the API endpoint.
153
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#createcustomerproductlistitem | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
154
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
155
+ */
156
+ CreateCustomerProductListItem: 'createCustomerProductListItem',
157
+ /**
158
+ * Removes an item from a customer product list.
159
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `deleteCustomerProductListItem` endpoint.
160
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=deleteCustomerProductListItem| Salesforce Developer Center} for more information about the API endpoint.
161
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#deletecustomerproductlistitem | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
162
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
163
+ */
164
+ DeleteCustomerProductListItem: 'deleteCustomerProductListItem',
165
+ /**
166
+ * Updates an item of a customer's product list.
167
+ Considered values from the request body are:
168
+ priority: This is the priority of the customer's product list item.
169
+ public: This is the flag whether the customer's product list item is public.
170
+ quantity: This is the quantity of
171
+ the customer's product list item. Used for product item type only.
172
+ custom properties in the form c_\<CUSTOM_NAME\>: The custom property
173
+ must correspond to a custom attribute (\<CUSTOM_NAME\>) defined for ProductListItem.
174
+ The value of this property must be valid for the type of custom attribute defined for ProductListItem.
175
+ * @returns A TanStack Query mutation hook for interacting with the Shopper Customers `updateCustomerProductListItem` endpoint.
176
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=updateCustomerProductListItem| Salesforce Developer Center} for more information about the API endpoint.
177
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#updatecustomerproductlistitem | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
178
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useMutation | TanStack Query `useMutation` reference} for more information about the return value.
179
+ */
180
+ UpdateCustomerProductListItem: 'updateCustomerProductListItem'
181
+ };
182
+
183
+ /** Mutation for Shopper Customers. */
184
+ exports.ShopperCustomersMutations = ShopperCustomersMutations;
185
+ function useShopperCustomersMutation(mutation) {
186
+ const getCacheUpdates = _cache.cacheUpdateMatrix[mutation];
187
+ // TODO: Remove this check when all mutations are implemented.
188
+ if (!getCacheUpdates) throw new _utils.NotImplementedError(`The '${mutation}' mutation`);
189
+
190
+ // The `Options` and `Data` types for each mutation are similar, but distinct, and the union
191
+ // type generated from `Client[Mutation]` seems to be too complex for TypeScript to handle.
192
+ // I'm not sure if there's a way to avoid the type assertions in here for the methods that
193
+ // use them. However, I'm fairly confident that they are safe to do, as they seem to be simply
194
+ // re-asserting what we already have.
195
+ const {
196
+ shopperCustomers: client
197
+ } = (0, _useCommerceApi.default)();
198
+ return (0, _useMutation.useMutation)({
199
+ client,
200
+ method: opts => client[mutation](opts),
201
+ getCacheUpdates: getCacheUpdates
202
+ });
203
+ }
@@ -0,0 +1,115 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { ApiClients, ApiQueryOptions, Argument, DataType, NullableParameters } from '../types';
3
+ declare type Client = ApiClients['shopperCustomers'];
4
+ /**
5
+ * Gets a customer with all existing addresses and payment instruments associated with the requested customer.
6
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
7
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
8
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomer` endpoint.
9
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomer| Salesforce Developer Center} for more information about the API endpoint.
10
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomer | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
11
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
12
+ */
13
+ export declare const useCustomer: (apiOptions: NullableParameters<Argument<Client['getCustomer']>>, queryOptions?: ApiQueryOptions<Client['getCustomer']>) => UseQueryResult<DataType<Client['getCustomer']>>;
14
+ /**
15
+ * Retrieves a customer's address by address name.
16
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
17
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
18
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerAddress` endpoint.
19
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerAddress| Salesforce Developer Center} for more information about the API endpoint.
20
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomeraddress | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
21
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
22
+ */
23
+ export declare const useCustomerAddress: (apiOptions: NullableParameters<Argument<Client['getCustomerAddress']>>, queryOptions?: ApiQueryOptions<Client['getCustomerAddress']>) => UseQueryResult<DataType<Client['getCustomerAddress']>>;
24
+ /**
25
+ * Gets the baskets of a customer.
26
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
27
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
28
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerBaskets` endpoint.
29
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerBaskets| Salesforce Developer Center} for more information about the API endpoint.
30
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomerbaskets | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
31
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
32
+ */
33
+ export declare const useCustomerBaskets: (apiOptions: NullableParameters<Argument<Client['getCustomerBaskets']>>, queryOptions?: ApiQueryOptions<Client['getCustomerBaskets']>) => UseQueryResult<DataType<Client['getCustomerBaskets']>>;
34
+ /**
35
+ * Returns a pageable list of all customer's orders. The default page size is 10.
36
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
37
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
38
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerOrders` endpoint.
39
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerOrders| Salesforce Developer Center} for more information about the API endpoint.
40
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomerorders | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
41
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
42
+ */
43
+ export declare const useCustomerOrders: (apiOptions: NullableParameters<Argument<Client['getCustomerOrders']>>, queryOptions?: ApiQueryOptions<Client['getCustomerOrders']>) => UseQueryResult<DataType<Client['getCustomerOrders']>>;
44
+ /**
45
+ * Retrieves a customer's payment instrument by its ID.
46
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
47
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
48
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerPaymentInstrument` endpoint.
49
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerPaymentInstrument| Salesforce Developer Center} for more information about the API endpoint.
50
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomerpaymentinstrument | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
51
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
52
+ */
53
+ export declare const useCustomerPaymentInstrument: (apiOptions: NullableParameters<Argument<Client['getCustomerPaymentInstrument']>>, queryOptions?: ApiQueryOptions<Client['getCustomerPaymentInstrument']>) => UseQueryResult<DataType<Client['getCustomerPaymentInstrument']>>;
54
+ /**
55
+ * Returns all customer product lists.
56
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
57
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
58
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerProductLists` endpoint.
59
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerProductLists| Salesforce Developer Center} for more information about the API endpoint.
60
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomerproductlists | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
61
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
62
+ */
63
+ export declare const useCustomerProductLists: (apiOptions: NullableParameters<Argument<Client['getCustomerProductLists']>>, queryOptions?: ApiQueryOptions<Client['getCustomerProductLists']>) => UseQueryResult<DataType<Client['getCustomerProductLists']>>;
64
+ /**
65
+ * Returns a customer product list of the given customer and the items in the list.
66
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
67
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
68
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerProductList` endpoint.
69
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerProductList| Salesforce Developer Center} for more information about the API endpoint.
70
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomerproductlist | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
71
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
72
+ */
73
+ export declare const useCustomerProductList: (apiOptions: NullableParameters<Argument<Client['getCustomerProductList']>>, queryOptions?: ApiQueryOptions<Client['getCustomerProductList']>) => UseQueryResult<DataType<Client['getCustomerProductList']>>;
74
+ /**
75
+ * Returns an item of a customer product list and the actual product details like image, availability and price.
76
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
77
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
78
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getCustomerProductListItem` endpoint.
79
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getCustomerProductListItem| Salesforce Developer Center} for more information about the API endpoint.
80
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getcustomerproductlistitem | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
81
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
82
+ */
83
+ export declare const useCustomerProductListItem: (apiOptions: NullableParameters<Argument<Client['getCustomerProductListItem']>>, queryOptions?: ApiQueryOptions<Client['getCustomerProductListItem']>) => UseQueryResult<DataType<Client['getCustomerProductListItem']>>;
84
+ /**
85
+ * Retrieves all public product lists as defined by the given search term (for example, email OR first name and last name).
86
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
87
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
88
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getPublicProductListsBySearchTerm` endpoint.
89
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getPublicProductListsBySearchTerm| Salesforce Developer Center} for more information about the API endpoint.
90
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getpublicproductlistsbysearchterm | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
91
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
92
+ */
93
+ export declare const usePublicProductListsBySearchTerm: (apiOptions: NullableParameters<Argument<Client['getPublicProductListsBySearchTerm']>>, queryOptions?: ApiQueryOptions<Client['getPublicProductListsBySearchTerm']>) => UseQueryResult<DataType<Client['getPublicProductListsBySearchTerm']>>;
94
+ /**
95
+ * Retrieves a public product list by ID and the items under that product list.
96
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
97
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
98
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getPublicProductList` endpoint.
99
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getPublicProductList| Salesforce Developer Center} for more information about the API endpoint.
100
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getpublicproductlist | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
101
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
102
+ */
103
+ export declare const usePublicProductList: (apiOptions: NullableParameters<Argument<Client['getPublicProductList']>>, queryOptions?: ApiQueryOptions<Client['getPublicProductList']>) => UseQueryResult<DataType<Client['getPublicProductList']>>;
104
+ /**
105
+ * Retrieves an item from a public product list and the actual product details like product, image, availability and price.
106
+ * @parameter apiOptions - Options to pass through to `commerce-sdk-isomorphic`, with `null` accepted for unset API parameters.
107
+ * @parameter queryOptions - TanStack Query query options, with `enabled` by default set to check that all required API parameters have been set.
108
+ * @returns A TanStack Query query hook with data from the Shopper Customers `getProductListItem` endpoint.
109
+ * @see {@link https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-customers?meta=getProductListItem| Salesforce Developer Center} for more information about the API endpoint.
110
+ * @see {@link https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/classes/shoppercustomers.shoppercustomers-1.html#getproductlistitem | `commerce-sdk-isomorphic` documentation} for more information on the parameters and returned data type.
111
+ * @see {@link https://tanstack.com/query/latest/docs/react/reference/useQuery | TanStack Query `useQuery` reference} for more information about the return value.
112
+ */
113
+ export declare const useProductListItem: (apiOptions: NullableParameters<Argument<Client['getProductListItem']>>, queryOptions?: ApiQueryOptions<Client['getProductListItem']>) => UseQueryResult<DataType<Client['getProductListItem']>>;
114
+ export {};
115
+ //# sourceMappingURL=query.d.ts.map