hey-pharmacist-ecommerce 1.1.25 → 1.1.26
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/dist/index.d.mts +1 -206
- package/dist/index.d.ts +1 -206
- package/dist/index.js +47 -233
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -233
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/CartItem.tsx +0 -10
- package/src/components/ProductCard.tsx +4 -5
- package/src/lib/Apis/api.ts +0 -8
- package/src/lib/Apis/apis/product-variants-api.ts +0 -96
- package/src/lib/Apis/apis/products-api.ts +7 -15
- package/src/lib/Apis/apis/shipping-api.ts +12 -214
- package/src/lib/Apis/models/category-filters.ts +0 -6
- package/src/lib/Apis/models/create-variant-dto.ts +0 -6
- package/src/lib/Apis/models/discounts-insights-dto.ts +0 -6
- package/src/lib/Apis/models/index.ts +0 -29
- package/src/lib/Apis/models/orders-insights-dto.ts +0 -6
- package/src/lib/Apis/models/payment.ts +0 -7
- package/src/lib/Apis/models/product-variant.ts +0 -6
- package/src/lib/Apis/models/products-insights-dto.ts +0 -6
- package/src/lib/Apis/models/rate-dto.ts +0 -6
- package/src/lib/Apis/models/update-product-variant-dto.ts +0 -6
- package/src/providers/WishlistProvider.tsx +2 -3
- package/src/screens/CheckoutScreen.tsx +25 -73
- package/src/lib/Apis/apis/chats-api.ts +0 -1101
- package/src/lib/Apis/apis/drafts-api.ts +0 -448
- package/src/lib/Apis/apis/open-aiapi.ts +0 -513
- package/src/lib/Apis/apis/payment-methods-api.ts +0 -411
- package/src/lib/Apis/apis/product-attributes-api.ts +0 -538
- package/src/lib/Apis/apis/product-favorite-list-api.ts +0 -321
- package/src/lib/Apis/apis/roles-api.ts +0 -614
- package/src/lib/Apis/apis/statistics-api.ts +0 -234
- package/src/lib/Apis/models/add-message-dto.ts +0 -56
- package/src/lib/Apis/models/chat.ts +0 -33
- package/src/lib/Apis/models/create-chat-dto.ts +0 -39
- package/src/lib/Apis/models/create-draft-dto.ts +0 -67
- package/src/lib/Apis/models/create-product-attribute-dto.ts +0 -33
- package/src/lib/Apis/models/create-role-dto.ts +0 -57
- package/src/lib/Apis/models/create-zone-dto.ts +0 -82
- package/src/lib/Apis/models/default-payment-method-request-dto.ts +0 -27
- package/src/lib/Apis/models/draft.ts +0 -79
- package/src/lib/Apis/models/google-analytics-request-dto.ts +0 -55
- package/src/lib/Apis/models/google-analytics-response-dto.ts +0 -39
- package/src/lib/Apis/models/my-favorite-list-dto.ts +0 -52
- package/src/lib/Apis/models/open-api.ts +0 -33
- package/src/lib/Apis/models/payment-method-data.ts +0 -34
- package/src/lib/Apis/models/payment-method.ts +0 -51
- package/src/lib/Apis/models/populated-chat-dto.ts +0 -95
- package/src/lib/Apis/models/product-attribute.ts +0 -57
- package/src/lib/Apis/models/product.ts +0 -142
- package/src/lib/Apis/models/role.ts +0 -69
- package/src/lib/Apis/models/single-message-populated.ts +0 -59
- package/src/lib/Apis/models/single-suggest-attribute.ts +0 -33
- package/src/lib/Apis/models/statistic-dto.ts +0 -171
- package/src/lib/Apis/models/suggest-attributes.ts +0 -28
- package/src/lib/Apis/models/update-product-attribute-dto.ts +0 -33
- package/src/lib/Apis/models/update-role-dto.ts +0 -57
- package/src/lib/Apis/models/update-zone-dto.ts +0 -82
- package/src/lib/Apis/models/user.ts +0 -232
- package/src/lib/Apis/models/zone-single-size.ts +0 -51
- package/src/lib/Apis/models/zone.ts +0 -106
package/dist/index.js
CHANGED
|
@@ -5037,7 +5037,6 @@ var ProductsApiAxiosParamCreator = function(configuration) {
|
|
|
5037
5037
|
* @summary Get all products of a specific category
|
|
5038
5038
|
* @param {string} categoryId Category ID
|
|
5039
5039
|
* @param {string} [searchTerm] OpenAI Search Query
|
|
5040
|
-
* @param {any} [attributes] Send any key-value pairs as query parameters (value is comma separated string)
|
|
5041
5040
|
* @param {number} [maxPrice] highest price to filter with
|
|
5042
5041
|
* @param {number} [minPrice] lowest price to filter with
|
|
5043
5042
|
* @param {string} [brandFilter] brands to filter with (comma separated string)
|
|
@@ -5050,7 +5049,7 @@ var ProductsApiAxiosParamCreator = function(configuration) {
|
|
|
5050
5049
|
* @param {*} [options] Override http request option.
|
|
5051
5050
|
* @throws {RequiredError}
|
|
5052
5051
|
*/
|
|
5053
|
-
getAllCategoryProducts: async (categoryId, searchTerm,
|
|
5052
|
+
getAllCategoryProducts: async (categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options = {}) => {
|
|
5054
5053
|
if (categoryId === null || categoryId === void 0) {
|
|
5055
5054
|
throw new RequiredError("categoryId", "Required parameter categoryId was null or undefined when calling getAllCategoryProducts.");
|
|
5056
5055
|
}
|
|
@@ -5074,9 +5073,6 @@ var ProductsApiAxiosParamCreator = function(configuration) {
|
|
|
5074
5073
|
if (searchTerm !== void 0) {
|
|
5075
5074
|
localVarQueryParameter["searchTerm"] = searchTerm;
|
|
5076
5075
|
}
|
|
5077
|
-
if (attributes !== void 0) {
|
|
5078
|
-
localVarQueryParameter["attributes"] = attributes;
|
|
5079
|
-
}
|
|
5080
5076
|
if (maxPrice !== void 0) {
|
|
5081
5077
|
localVarQueryParameter["maxPrice"] = maxPrice;
|
|
5082
5078
|
}
|
|
@@ -5648,7 +5644,6 @@ var ProductsApiFp = function(configuration) {
|
|
|
5648
5644
|
* @summary Get all products of a specific category
|
|
5649
5645
|
* @param {string} categoryId Category ID
|
|
5650
5646
|
* @param {string} [searchTerm] OpenAI Search Query
|
|
5651
|
-
* @param {any} [attributes] Send any key-value pairs as query parameters (value is comma separated string)
|
|
5652
5647
|
* @param {number} [maxPrice] highest price to filter with
|
|
5653
5648
|
* @param {number} [minPrice] lowest price to filter with
|
|
5654
5649
|
* @param {string} [brandFilter] brands to filter with (comma separated string)
|
|
@@ -5661,8 +5656,8 @@ var ProductsApiFp = function(configuration) {
|
|
|
5661
5656
|
* @param {*} [options] Override http request option.
|
|
5662
5657
|
* @throws {RequiredError}
|
|
5663
5658
|
*/
|
|
5664
|
-
async getAllCategoryProducts(categoryId, searchTerm,
|
|
5665
|
-
const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllCategoryProducts(categoryId, searchTerm,
|
|
5659
|
+
async getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options) {
|
|
5660
|
+
const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options);
|
|
5666
5661
|
return (axios = globalAxios4__default.default, basePath = BASE_PATH) => {
|
|
5667
5662
|
const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
|
|
5668
5663
|
return axios.request(axiosRequestArgs);
|
|
@@ -5857,7 +5852,6 @@ var ProductsApi = class extends BaseAPI {
|
|
|
5857
5852
|
* @summary Get all products of a specific category
|
|
5858
5853
|
* @param {string} categoryId Category ID
|
|
5859
5854
|
* @param {string} [searchTerm] OpenAI Search Query
|
|
5860
|
-
* @param {any} [attributes] Send any key-value pairs as query parameters (value is comma separated string)
|
|
5861
5855
|
* @param {number} [maxPrice] highest price to filter with
|
|
5862
5856
|
* @param {number} [minPrice] lowest price to filter with
|
|
5863
5857
|
* @param {string} [brandFilter] brands to filter with (comma separated string)
|
|
@@ -5871,8 +5865,8 @@ var ProductsApi = class extends BaseAPI {
|
|
|
5871
5865
|
* @throws {RequiredError}
|
|
5872
5866
|
* @memberof ProductsApi
|
|
5873
5867
|
*/
|
|
5874
|
-
async getAllCategoryProducts(categoryId, searchTerm,
|
|
5875
|
-
return ProductsApiFp(this.configuration).getAllCategoryProducts(categoryId, searchTerm,
|
|
5868
|
+
async getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options) {
|
|
5869
|
+
return ProductsApiFp(this.configuration).getAllCategoryProducts(categoryId, searchTerm, maxPrice, minPrice, brandFilter, availability, sort, includeNoVariantProducts, isActive, limit, page, options).then((request) => request(this.axios, this.basePath));
|
|
5876
5870
|
}
|
|
5877
5871
|
/**
|
|
5878
5872
|
*
|
|
@@ -5998,52 +5992,6 @@ var ProductsApi = class extends BaseAPI {
|
|
|
5998
5992
|
};
|
|
5999
5993
|
var ShippingApiAxiosParamCreator = function(configuration) {
|
|
6000
5994
|
return {
|
|
6001
|
-
/**
|
|
6002
|
-
*
|
|
6003
|
-
* @summary Create zone
|
|
6004
|
-
* @param {CreateZoneDto} body
|
|
6005
|
-
* @param {*} [options] Override http request option.
|
|
6006
|
-
* @throws {RequiredError}
|
|
6007
|
-
*/
|
|
6008
|
-
createZone: async (body, options = {}) => {
|
|
6009
|
-
if (body === null || body === void 0) {
|
|
6010
|
-
throw new RequiredError("body", "Required parameter body was null or undefined when calling createZone.");
|
|
6011
|
-
}
|
|
6012
|
-
const localVarPath = `/shipping/zones/create`;
|
|
6013
|
-
const localVarUrlObj = new URL(localVarPath, "https://example.com");
|
|
6014
|
-
let baseOptions;
|
|
6015
|
-
if (configuration) {
|
|
6016
|
-
baseOptions = configuration.baseOptions;
|
|
6017
|
-
}
|
|
6018
|
-
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
6019
|
-
const localVarHeaderParameter = {};
|
|
6020
|
-
const localVarQueryParameter = {};
|
|
6021
|
-
if (configuration && configuration.accessToken) {
|
|
6022
|
-
const accessToken = typeof configuration.accessToken === "function" ? await configuration.accessToken() : await configuration.accessToken;
|
|
6023
|
-
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
6024
|
-
}
|
|
6025
|
-
if (configuration && configuration.apiKey) {
|
|
6026
|
-
const localVarApiKeyValue = typeof configuration.apiKey === "function" ? await configuration.apiKey("x-store-key") : await configuration.apiKey;
|
|
6027
|
-
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
6028
|
-
}
|
|
6029
|
-
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
6030
|
-
const query = new URLSearchParams(localVarUrlObj.search);
|
|
6031
|
-
for (const key in localVarQueryParameter) {
|
|
6032
|
-
query.set(key, localVarQueryParameter[key]);
|
|
6033
|
-
}
|
|
6034
|
-
for (const key in options.params) {
|
|
6035
|
-
query.set(key, options.params[key]);
|
|
6036
|
-
}
|
|
6037
|
-
localVarUrlObj.search = new URLSearchParams(query).toString();
|
|
6038
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6039
|
-
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
6040
|
-
const needsSerialization = typeof body !== "string" || (localVarRequestOptions.headers || (localVarRequestOptions.headers = {}))["Content-Type"] === "application/json";
|
|
6041
|
-
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== void 0 ? body : {}) : body || "";
|
|
6042
|
-
return {
|
|
6043
|
-
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
6044
|
-
options: localVarRequestOptions
|
|
6045
|
-
};
|
|
6046
|
-
},
|
|
6047
5995
|
/**
|
|
6048
5996
|
*
|
|
6049
5997
|
* @summary Get all shipments
|
|
@@ -6217,12 +6165,12 @@ var ShippingApiAxiosParamCreator = function(configuration) {
|
|
|
6217
6165
|
},
|
|
6218
6166
|
/**
|
|
6219
6167
|
*
|
|
6220
|
-
* @summary Get
|
|
6168
|
+
* @summary Get store address
|
|
6221
6169
|
* @param {*} [options] Override http request option.
|
|
6222
6170
|
* @throws {RequiredError}
|
|
6223
6171
|
*/
|
|
6224
|
-
|
|
6225
|
-
const localVarPath = `/shipping/
|
|
6172
|
+
getStoreAddress: async (options = {}) => {
|
|
6173
|
+
const localVarPath = `/shipping/store/address`;
|
|
6226
6174
|
const localVarUrlObj = new URL(localVarPath, "https://example.com");
|
|
6227
6175
|
let baseOptions;
|
|
6228
6176
|
if (configuration) {
|
|
@@ -6253,75 +6201,11 @@ var ShippingApiAxiosParamCreator = function(configuration) {
|
|
|
6253
6201
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
6254
6202
|
options: localVarRequestOptions
|
|
6255
6203
|
};
|
|
6256
|
-
},
|
|
6257
|
-
/**
|
|
6258
|
-
*
|
|
6259
|
-
* @summary Update zone
|
|
6260
|
-
* @param {UpdateZoneDto} body
|
|
6261
|
-
* @param {string} zoneId
|
|
6262
|
-
* @param {*} [options] Override http request option.
|
|
6263
|
-
* @throws {RequiredError}
|
|
6264
|
-
*/
|
|
6265
|
-
updateZone: async (body, zoneId, options = {}) => {
|
|
6266
|
-
if (body === null || body === void 0) {
|
|
6267
|
-
throw new RequiredError("body", "Required parameter body was null or undefined when calling updateZone.");
|
|
6268
|
-
}
|
|
6269
|
-
if (zoneId === null || zoneId === void 0) {
|
|
6270
|
-
throw new RequiredError("zoneId", "Required parameter zoneId was null or undefined when calling updateZone.");
|
|
6271
|
-
}
|
|
6272
|
-
const localVarPath = `/shipping/zones/{zoneId}`.replace(`{${"zoneId"}}`, encodeURIComponent(String(zoneId)));
|
|
6273
|
-
const localVarUrlObj = new URL(localVarPath, "https://example.com");
|
|
6274
|
-
let baseOptions;
|
|
6275
|
-
if (configuration) {
|
|
6276
|
-
baseOptions = configuration.baseOptions;
|
|
6277
|
-
}
|
|
6278
|
-
const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
|
|
6279
|
-
const localVarHeaderParameter = {};
|
|
6280
|
-
const localVarQueryParameter = {};
|
|
6281
|
-
if (configuration && configuration.accessToken) {
|
|
6282
|
-
const accessToken = typeof configuration.accessToken === "function" ? await configuration.accessToken() : await configuration.accessToken;
|
|
6283
|
-
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
6284
|
-
}
|
|
6285
|
-
if (configuration && configuration.apiKey) {
|
|
6286
|
-
const localVarApiKeyValue = typeof configuration.apiKey === "function" ? await configuration.apiKey("x-store-key") : await configuration.apiKey;
|
|
6287
|
-
localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
|
|
6288
|
-
}
|
|
6289
|
-
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
6290
|
-
const query = new URLSearchParams(localVarUrlObj.search);
|
|
6291
|
-
for (const key in localVarQueryParameter) {
|
|
6292
|
-
query.set(key, localVarQueryParameter[key]);
|
|
6293
|
-
}
|
|
6294
|
-
for (const key in options.params) {
|
|
6295
|
-
query.set(key, options.params[key]);
|
|
6296
|
-
}
|
|
6297
|
-
localVarUrlObj.search = new URLSearchParams(query).toString();
|
|
6298
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6299
|
-
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
6300
|
-
const needsSerialization = typeof body !== "string" || (localVarRequestOptions.headers || (localVarRequestOptions.headers = {}))["Content-Type"] === "application/json";
|
|
6301
|
-
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== void 0 ? body : {}) : body || "";
|
|
6302
|
-
return {
|
|
6303
|
-
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
6304
|
-
options: localVarRequestOptions
|
|
6305
|
-
};
|
|
6306
6204
|
}
|
|
6307
6205
|
};
|
|
6308
6206
|
};
|
|
6309
6207
|
var ShippingApiFp = function(configuration) {
|
|
6310
6208
|
return {
|
|
6311
|
-
/**
|
|
6312
|
-
*
|
|
6313
|
-
* @summary Create zone
|
|
6314
|
-
* @param {CreateZoneDto} body
|
|
6315
|
-
* @param {*} [options] Override http request option.
|
|
6316
|
-
* @throws {RequiredError}
|
|
6317
|
-
*/
|
|
6318
|
-
async createZone(body, options) {
|
|
6319
|
-
const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).createZone(body, options);
|
|
6320
|
-
return (axios = globalAxios4__default.default, basePath = BASE_PATH) => {
|
|
6321
|
-
const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
|
|
6322
|
-
return axios.request(axiosRequestArgs);
|
|
6323
|
-
};
|
|
6324
|
-
},
|
|
6325
6209
|
/**
|
|
6326
6210
|
*
|
|
6327
6211
|
* @summary Get all shipments
|
|
@@ -6379,27 +6263,12 @@ var ShippingApiFp = function(configuration) {
|
|
|
6379
6263
|
},
|
|
6380
6264
|
/**
|
|
6381
6265
|
*
|
|
6382
|
-
* @summary Get
|
|
6383
|
-
* @param {*} [options] Override http request option.
|
|
6384
|
-
* @throws {RequiredError}
|
|
6385
|
-
*/
|
|
6386
|
-
async getZones(options) {
|
|
6387
|
-
const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).getZones(options);
|
|
6388
|
-
return (axios = globalAxios4__default.default, basePath = BASE_PATH) => {
|
|
6389
|
-
const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
|
|
6390
|
-
return axios.request(axiosRequestArgs);
|
|
6391
|
-
};
|
|
6392
|
-
},
|
|
6393
|
-
/**
|
|
6394
|
-
*
|
|
6395
|
-
* @summary Update zone
|
|
6396
|
-
* @param {UpdateZoneDto} body
|
|
6397
|
-
* @param {string} zoneId
|
|
6266
|
+
* @summary Get store address
|
|
6398
6267
|
* @param {*} [options] Override http request option.
|
|
6399
6268
|
* @throws {RequiredError}
|
|
6400
6269
|
*/
|
|
6401
|
-
async
|
|
6402
|
-
const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).
|
|
6270
|
+
async getStoreAddress(options) {
|
|
6271
|
+
const localVarAxiosArgs = await ShippingApiAxiosParamCreator(configuration).getStoreAddress(options);
|
|
6403
6272
|
return (axios = globalAxios4__default.default, basePath = BASE_PATH) => {
|
|
6404
6273
|
const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
|
|
6405
6274
|
return axios.request(axiosRequestArgs);
|
|
@@ -6408,17 +6277,6 @@ var ShippingApiFp = function(configuration) {
|
|
|
6408
6277
|
};
|
|
6409
6278
|
};
|
|
6410
6279
|
var ShippingApi = class extends BaseAPI {
|
|
6411
|
-
/**
|
|
6412
|
-
*
|
|
6413
|
-
* @summary Create zone
|
|
6414
|
-
* @param {CreateZoneDto} body
|
|
6415
|
-
* @param {*} [options] Override http request option.
|
|
6416
|
-
* @throws {RequiredError}
|
|
6417
|
-
* @memberof ShippingApi
|
|
6418
|
-
*/
|
|
6419
|
-
async createZone(body, options) {
|
|
6420
|
-
return ShippingApiFp(this.configuration).createZone(body, options).then((request) => request(this.axios, this.basePath));
|
|
6421
|
-
}
|
|
6422
6280
|
/**
|
|
6423
6281
|
*
|
|
6424
6282
|
* @summary Get all shipments
|
|
@@ -6464,25 +6322,13 @@ var ShippingApi = class extends BaseAPI {
|
|
|
6464
6322
|
}
|
|
6465
6323
|
/**
|
|
6466
6324
|
*
|
|
6467
|
-
* @summary Get
|
|
6468
|
-
* @param {*} [options] Override http request option.
|
|
6469
|
-
* @throws {RequiredError}
|
|
6470
|
-
* @memberof ShippingApi
|
|
6471
|
-
*/
|
|
6472
|
-
async getZones(options) {
|
|
6473
|
-
return ShippingApiFp(this.configuration).getZones(options).then((request) => request(this.axios, this.basePath));
|
|
6474
|
-
}
|
|
6475
|
-
/**
|
|
6476
|
-
*
|
|
6477
|
-
* @summary Update zone
|
|
6478
|
-
* @param {UpdateZoneDto} body
|
|
6479
|
-
* @param {string} zoneId
|
|
6325
|
+
* @summary Get store address
|
|
6480
6326
|
* @param {*} [options] Override http request option.
|
|
6481
6327
|
* @throws {RequiredError}
|
|
6482
6328
|
* @memberof ShippingApi
|
|
6483
6329
|
*/
|
|
6484
|
-
async
|
|
6485
|
-
return ShippingApiFp(this.configuration).
|
|
6330
|
+
async getStoreAddress(options) {
|
|
6331
|
+
return ShippingApiFp(this.configuration).getStoreAddress(options).then((request) => request(this.axios, this.basePath));
|
|
6486
6332
|
}
|
|
6487
6333
|
};
|
|
6488
6334
|
var WishlistApiAxiosParamCreator = function(configuration) {
|
|
@@ -7724,8 +7570,7 @@ function ProductCard({
|
|
|
7724
7570
|
return product.productVariants.filter((variant) => variant.productMedia && variant.productMedia.length > 0).map((variant) => ({
|
|
7725
7571
|
variantId: variant.id || variant._id,
|
|
7726
7572
|
variantName: variant.name,
|
|
7727
|
-
image: variant.productMedia[0].file
|
|
7728
|
-
color: variant.attribute?.color || variant.attribute?.Color || null
|
|
7573
|
+
image: variant.productMedia[0].file
|
|
7729
7574
|
}));
|
|
7730
7575
|
}, [product.productVariants]);
|
|
7731
7576
|
const selectedVariant = React8.useMemo(() => {
|
|
@@ -7860,12 +7705,12 @@ function ProductCard({
|
|
|
7860
7705
|
setIsImageLoaded(false);
|
|
7861
7706
|
},
|
|
7862
7707
|
className: `relative w-8 h-8 rounded-full overflow-hidden border-2 transition-all ${selectedVariantId === variant.variantId ? "border-primary-500 ring-2 ring-primary-200" : "border-gray-200 hover:border-primary-300"}`,
|
|
7863
|
-
"aria-label": `Select ${variant.
|
|
7708
|
+
"aria-label": `Select ${variant.variantName || "variant"}`,
|
|
7864
7709
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7865
7710
|
Image4__default.default,
|
|
7866
7711
|
{
|
|
7867
7712
|
src: variant.image,
|
|
7868
|
-
alt: variant.
|
|
7713
|
+
alt: variant.variantName || `Variant ${index + 1}`,
|
|
7869
7714
|
fill: true,
|
|
7870
7715
|
className: "object-cover",
|
|
7871
7716
|
sizes: "32px"
|
|
@@ -9661,15 +9506,6 @@ function CartItem({ item }) {
|
|
|
9661
9506
|
};
|
|
9662
9507
|
const itemTotal = item.productVariantData.finalPrice * item.quantity;
|
|
9663
9508
|
const unitPrice = item.productVariantData.finalPrice;
|
|
9664
|
-
const attributes = [];
|
|
9665
|
-
if (item.productVariantData.attribute) {
|
|
9666
|
-
if (item.productVariantData.attribute.color) {
|
|
9667
|
-
attributes.push(`Color: ${item.productVariantData.attribute.color}`);
|
|
9668
|
-
}
|
|
9669
|
-
if (item.productVariantData.attribute.size) {
|
|
9670
|
-
attributes.push(`Size: ${item.productVariantData.attribute.size}`);
|
|
9671
|
-
}
|
|
9672
|
-
}
|
|
9673
9509
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9674
9510
|
framerMotion.motion.div,
|
|
9675
9511
|
{
|
|
@@ -10233,15 +10069,15 @@ var PAYMENT_METHODS = [
|
|
|
10233
10069
|
description: "Pay with cash on delivery or at pickup",
|
|
10234
10070
|
className: "border-amber-500 hover:bg-amber-50",
|
|
10235
10071
|
activeClass: "bg-amber-50 border-amber-500 text-amber-700"
|
|
10236
|
-
},
|
|
10237
|
-
{
|
|
10238
|
-
label: "Credit",
|
|
10239
|
-
value: "Credit",
|
|
10240
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "w-5 h-5" }),
|
|
10241
|
-
description: "Use your account credit",
|
|
10242
|
-
className: "border-emerald-500 hover:bg-emerald-50",
|
|
10243
|
-
activeClass: "bg-emerald-50 border-emerald-500 text-emerald-700"
|
|
10244
10072
|
}
|
|
10073
|
+
// {
|
|
10074
|
+
// label: 'Credit',
|
|
10075
|
+
// value: 'Credit',
|
|
10076
|
+
// icon: <ShieldCheck className="w-5 h-5" />,
|
|
10077
|
+
// description: 'Use your account credit',
|
|
10078
|
+
// className: 'border-emerald-500 hover:bg-emerald-50',
|
|
10079
|
+
// activeClass: 'bg-emerald-50 border-emerald-500 text-emerald-700',
|
|
10080
|
+
// },
|
|
10245
10081
|
];
|
|
10246
10082
|
function CheckoutScreen() {
|
|
10247
10083
|
const router = navigation.useRouter();
|
|
@@ -10253,7 +10089,6 @@ function CheckoutScreen() {
|
|
|
10253
10089
|
const [paymentMethod, setPaymentMethod] = React8.useState("Card");
|
|
10254
10090
|
const [error, setError] = React8.useState(null);
|
|
10255
10091
|
const [selectedAddressId, setSelectedAddressId] = React8.useState(null);
|
|
10256
|
-
const [selectedStoreAddressId, setSelectedStoreAddressId] = React8.useState(null);
|
|
10257
10092
|
const [storeAddresses, setStoreAddresses] = React8.useState([]);
|
|
10258
10093
|
const [isAddressModalOpen, setIsAddressModalOpen] = React8.useState(false);
|
|
10259
10094
|
const [editingAddress, setEditingAddress] = React8.useState(null);
|
|
@@ -10373,16 +10208,14 @@ function CheckoutScreen() {
|
|
|
10373
10208
|
}, [isDelivery, selectedAddressId, cart]);
|
|
10374
10209
|
React8.useEffect(() => {
|
|
10375
10210
|
if (!isDelivery) {
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
setStoreAddresses([]);
|
|
10385
|
-
setSelectedStoreAddressId(null);
|
|
10211
|
+
(async () => {
|
|
10212
|
+
const api = new ShippingApi(AXIOS_CONFIG);
|
|
10213
|
+
const res = await api.getStoreAddress();
|
|
10214
|
+
if (res.data) {
|
|
10215
|
+
setStoreAddresses([res.data]);
|
|
10216
|
+
setShippingPrice(0);
|
|
10217
|
+
}
|
|
10218
|
+
})();
|
|
10386
10219
|
}
|
|
10387
10220
|
}, [isDelivery]);
|
|
10388
10221
|
const onSubmit = async (data) => {
|
|
@@ -10420,10 +10253,6 @@ function CheckoutScreen() {
|
|
|
10420
10253
|
}
|
|
10421
10254
|
}
|
|
10422
10255
|
} else {
|
|
10423
|
-
if (!selectedStoreAddressId) {
|
|
10424
|
-
setError("Please select a pickup location.");
|
|
10425
|
-
return;
|
|
10426
|
-
}
|
|
10427
10256
|
if (storeAddresses.length === 0) {
|
|
10428
10257
|
setError("Store pickup location is not available.");
|
|
10429
10258
|
return;
|
|
@@ -10465,8 +10294,7 @@ function CheckoutScreen() {
|
|
|
10465
10294
|
chargeTax: true,
|
|
10466
10295
|
orderRemindingDates: [],
|
|
10467
10296
|
shippingAddress: data.shipping,
|
|
10468
|
-
billingAddress: sameAsShipping ? data.shipping : data.billing
|
|
10469
|
-
pickupStoreId: !isDelivery ? selectedStoreAddressId : void 0
|
|
10297
|
+
billingAddress: sameAsShipping ? data.shipping : data.billing
|
|
10470
10298
|
};
|
|
10471
10299
|
const api = new OrdersApi(AXIOS_CONFIG);
|
|
10472
10300
|
const response = await api.createCheckout(
|
|
@@ -10682,27 +10510,23 @@ function CheckoutScreen() {
|
|
|
10682
10510
|
] }),
|
|
10683
10511
|
!isDelivery && storeAddresses.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-2", children: [
|
|
10684
10512
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block mb-2 font-semibold", children: "Select Pickup Location" }),
|
|
10685
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
addr.city
|
|
10697
|
-
] }, addr.id))
|
|
10698
|
-
}
|
|
10699
|
-
)
|
|
10513
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: storeAddresses.map((addr) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full border rounded-sm p-2", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
10514
|
+
addr.name,
|
|
10515
|
+
" - ",
|
|
10516
|
+
addr.street1,
|
|
10517
|
+
", ",
|
|
10518
|
+
addr.city,
|
|
10519
|
+
", ",
|
|
10520
|
+
addr.state,
|
|
10521
|
+
" ",
|
|
10522
|
+
addr.zip
|
|
10523
|
+
] }) }, addr.id)) })
|
|
10700
10524
|
] })
|
|
10701
10525
|
] })
|
|
10702
10526
|
] }),
|
|
10703
10527
|
isDelivery && selectedAddressId && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white border-2 border-gray-100 rounded-[24px] p-8 text-[#2B4B7C]", children: [
|
|
10704
10528
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 text-xl font-semibold text-gray-900 pb-4 mb-8 border-b", children: [
|
|
10705
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Truck, { className: "
|
|
10529
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Truck, { className: "w-8 h-8 flex items-center justify-center text-[#2B4B7C]" }),
|
|
10706
10530
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-['Poppins',sans-serif] font-semibold text-[#2B4B7C] text-2xl", children: "Shipping Options" })
|
|
10707
10531
|
] }),
|
|
10708
10532
|
shippingRatesLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center py-12", children: [
|
|
@@ -10715,7 +10539,6 @@ function CheckoutScreen() {
|
|
|
10715
10539
|
] }) : shippingRates && shippingRates.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: shippingRates.map((rate) => {
|
|
10716
10540
|
const isSelected = !!selectedShippingRateId && selectedShippingRateId === rate.objectId;
|
|
10717
10541
|
const isTest = rate.test;
|
|
10718
|
-
const hasAttributes = rate.attributes && rate.attributes.length > 0;
|
|
10719
10542
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10720
10543
|
"div",
|
|
10721
10544
|
{
|
|
@@ -10750,14 +10573,6 @@ function CheckoutScreen() {
|
|
|
10750
10573
|
] }),
|
|
10751
10574
|
isTest && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 text-xs font-medium bg-primary-100 text-primary-800 rounded-full", children: "TEST" })
|
|
10752
10575
|
] }),
|
|
10753
|
-
hasAttributes && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2 mb-3", children: rate.attributes.map((attr) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10754
|
-
"span",
|
|
10755
|
-
{
|
|
10756
|
-
className: `px-2 py-1 text-xs font-medium rounded-full ${attr === "FASTEST" ? "bg-green-100 text-green-800" : attr === "BESTVALUE" ? "bg-blue-100 text-blue-800" : attr === "CHEAPEST" ? "bg-purple-100 text-purple-800" : "bg-gray-100 text-gray-800"}`,
|
|
10757
|
-
children: attr
|
|
10758
|
-
},
|
|
10759
|
-
attr
|
|
10760
|
-
)) }),
|
|
10761
10576
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 text-sm text-gray-600", children: [
|
|
10762
10577
|
rate.durationTerms && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10763
10578
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
@@ -10905,8 +10720,7 @@ function CheckoutScreen() {
|
|
|
10905
10720
|
}) }),
|
|
10906
10721
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-500 mt-4", children: [
|
|
10907
10722
|
paymentMethod === "Card" && "You will be redirected to a secure payment page.",
|
|
10908
|
-
paymentMethod === "Cash" && "Pay with cash at the time of delivery or pickup."
|
|
10909
|
-
paymentMethod === "Credit" && "Use your available account credit for this order."
|
|
10723
|
+
paymentMethod === "Cash" && "Pay with cash at the time of delivery or pickup."
|
|
10910
10724
|
] })
|
|
10911
10725
|
] })
|
|
10912
10726
|
] })
|