@wix/auto_sdk_ecom_current-cart 1.0.132 → 1.0.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +3 -3
- package/build/cjs/index.js +9 -9
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +3 -3
- package/build/cjs/index.typings.js +6 -6
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js +6 -6
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +3 -3
- package/build/es/index.mjs +9 -9
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +3 -3
- package/build/es/index.typings.mjs +6 -6
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.mjs +6 -6
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +3 -3
- package/build/internal/cjs/index.js +9 -9
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +3 -3
- package/build/internal/cjs/index.typings.js +6 -6
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.js +6 -6
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +3 -3
- package/build/internal/es/index.mjs +9 -9
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +3 -3
- package/build/internal/es/index.typings.mjs +6 -6
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.mjs +6 -6
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface GetCurrentCartSignature {
|
|
|
8
8
|
* Retrieves the current site visitor's cart.
|
|
9
9
|
*
|
|
10
10
|
* >**Note:**
|
|
11
|
-
* >This method requires [visitor or member authentication](https://dev.wix.com/docs/
|
|
11
|
+
* >This method requires [visitor or member authentication](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities).
|
|
12
12
|
* @returns Current session's active cart.
|
|
13
13
|
*/
|
|
14
14
|
(): Promise<NonNullablePaths<Cart, `lineItems` | `lineItems.${number}.quantity` | `lineItems.${number}.catalogReference.catalogItemId` | `lineItems.${number}.catalogReference.appId` | `lineItems.${number}.productName.original` | `lineItems.${number}.price.amount` | `lineItems.${number}.price.convertedAmount` | `lineItems.${number}.price.formattedAmount` | `lineItems.${number}.price.formattedConvertedAmount` | `lineItems.${number}.availability.status` | `lineItems.${number}.physicalProperties.shippable` | `lineItems.${number}.itemType.preset` | `lineItems.${number}.itemType.custom` | `lineItems.${number}.subscriptionOptionInfo.subscriptionSettings.frequency` | `lineItems.${number}.subscriptionOptionInfo.subscriptionSettings.autoRenewal` | `lineItems.${number}.subscriptionOptionInfo.subscriptionSettings.enableCustomerCancellation` | `lineItems.${number}.subscriptionOptionInfo.title.original` | `lineItems.${number}.subscriptionOptionInfo.description.original` | `lineItems.${number}.paymentOption` | `lineItems.${number}.priceDescription.original` | `lineItems.${number}.selectedMembership._id` | `lineItems.${number}.selectedMembership.appId` | `lineItems.${number}.customLineItem` | `lineItems.${number}.priceUndetermined` | `lineItems.${number}.fixedQuantity` | `lineItems.${number}.catalogOverrideFields.paymentOption.value` | `lineItems.${number}.savePaymentMethod` | `lineItems.${number}.taxableAddress.addressType` | `lineItems.${number}.membersOnly` | `buyerInfo.visitorId` | `buyerInfo.memberId` | `buyerInfo.userId` | `currency` | `conversionCurrency` | `weightUnit` | `appliedDiscounts` | `appliedDiscounts.${number}.coupon._id` | `appliedDiscounts.${number}.coupon.code` | `contactInfo.address.streetAddress.number` | `contactInfo.address.streetAddress.name` | `contactInfo.contactDetails.vatId._id` | `contactInfo.contactDetails.vatId.type` | `selectedShippingOption.code` | `paymentCurrency`, 6>>;
|
|
@@ -20,7 +20,7 @@ interface UpdateCurrentCartSignature {
|
|
|
20
20
|
*
|
|
21
21
|
* >**Notes:**
|
|
22
22
|
* >+ When adding catalog line items, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
|
|
23
|
-
* >+ This method requires [visitor or member authentication](https://dev.wix.com/docs/
|
|
23
|
+
* >+ This method requires [visitor or member authentication](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities).
|
|
24
24
|
* >+ After a cart is updated, call [Refresh Cart](https://dev.wix.com/docs/sdk/frontend-modules/ecom/refresh-cart) to update the cart's UI elements and trigger the Cart Updated event.
|
|
25
25
|
* @param - Current cart update options.
|
|
26
26
|
* @returns Updated Cart.
|
|
@@ -34,7 +34,7 @@ interface AddToCurrentCartSignature {
|
|
|
34
34
|
*
|
|
35
35
|
* >**Notes:**
|
|
36
36
|
* >+ When adding catalog line items, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
|
|
37
|
-
* >+ This method requires [visitor or member authentication](https://dev.wix.com/docs/
|
|
37
|
+
* >+ This method requires [visitor or member authentication](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities).
|
|
38
38
|
* >+ After a cart is updated, call [Refresh Cart](https://dev.wix.com/docs/sdk/frontend-modules/ecom/refresh-cart) to update the cart's UI elements and trigger the Cart Updated event.
|
|
39
39
|
* @param - Items to be added to the current cart.
|
|
40
40
|
*/
|
package/build/cjs/index.js
CHANGED
|
@@ -51,7 +51,7 @@ __export(index_exports, {
|
|
|
51
51
|
createCheckoutFromCurrentCart: () => createCheckoutFromCurrentCart4,
|
|
52
52
|
deleteCurrentCart: () => deleteCurrentCart4,
|
|
53
53
|
estimateCurrentCartTotals: () => estimateCurrentCartTotals4,
|
|
54
|
-
getCurrentCart: () =>
|
|
54
|
+
getCurrentCart: () => getCurrentCart3,
|
|
55
55
|
onCartCreated: () => onCartCreated2,
|
|
56
56
|
onCartDeleted: () => onCartDeleted2,
|
|
57
57
|
onCartUpdated: () => onCartUpdated2,
|
|
@@ -195,8 +195,8 @@ function resolveComWixEcomCartApiV1CurrentCartServiceUrl(opts) {
|
|
|
195
195
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
196
196
|
}
|
|
197
197
|
var PACKAGE_NAME = "@wix/auto_sdk_ecom_current-cart";
|
|
198
|
-
function
|
|
199
|
-
function
|
|
198
|
+
function currentCartGetCurrentCart(payload) {
|
|
199
|
+
function __currentCartGetCurrentCart({ host }) {
|
|
200
200
|
const metadata = {
|
|
201
201
|
entityFqdn: "wix.ecom.v1.cart",
|
|
202
202
|
method: "GET",
|
|
@@ -242,7 +242,7 @@ function getCurrentCart(payload) {
|
|
|
242
242
|
};
|
|
243
243
|
return metadata;
|
|
244
244
|
}
|
|
245
|
-
return
|
|
245
|
+
return __currentCartGetCurrentCart;
|
|
246
246
|
}
|
|
247
247
|
function updateCurrentCart(payload) {
|
|
248
248
|
function __updateCurrentCart({ host }) {
|
|
@@ -921,10 +921,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
921
921
|
WebhookIdentityType2["APP"] = "APP";
|
|
922
922
|
return WebhookIdentityType2;
|
|
923
923
|
})(WebhookIdentityType || {});
|
|
924
|
-
async function
|
|
924
|
+
async function getCurrentCart() {
|
|
925
925
|
const { httpClient, sideEffects } = arguments[0];
|
|
926
926
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
927
|
-
const reqOpts =
|
|
927
|
+
const reqOpts = currentCartGetCurrentCart(payload);
|
|
928
928
|
sideEffects?.onSiteCall?.();
|
|
929
929
|
try {
|
|
930
930
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1373,8 +1373,8 @@ async function deleteCurrentCart2() {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
1375
|
// src/ecom-v1-cart-current-cart.public.ts
|
|
1376
|
-
function
|
|
1377
|
-
return () =>
|
|
1376
|
+
function getCurrentCart2(httpClient) {
|
|
1377
|
+
return () => getCurrentCart(
|
|
1378
1378
|
// @ts-ignore
|
|
1379
1379
|
{ httpClient }
|
|
1380
1380
|
);
|
|
@@ -1593,7 +1593,7 @@ var onCartCreated = (0, import_sdk_types.EventDefinition)(
|
|
|
1593
1593
|
// src/ecom-v1-cart-current-cart.context.ts
|
|
1594
1594
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
1595
1595
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
1596
|
-
var
|
|
1596
|
+
var getCurrentCart3 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCurrentCart2);
|
|
1597
1597
|
var updateCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateCurrentCart3);
|
|
1598
1598
|
var addToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addToCurrentCart3);
|
|
1599
1599
|
var removeLineItemsFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeLineItemsFromCurrentCart3);
|