@ikas/storefront-model-functions 5.0.0-beta.3 → 5.0.0-beta.30
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/functions/blog/category/index.d.ts +2 -2
- package/build/functions/blog/category/index.js +1 -1
- package/build/functions/blog/index.d.ts +2 -2
- package/build/functions/blog/index.js +1 -1
- package/build/functions/brand/index.d.ts +2 -2
- package/build/functions/brand/index.js +1 -1
- package/build/functions/category/index.d.ts +2 -2
- package/build/functions/category/index.js +1 -1
- package/build/functions/category/path-item/index.d.ts +3 -3
- package/build/functions/category/path-item/index.js +1 -1
- package/build/functions/checkout/index.d.ts +3 -3
- package/build/functions/checkout/index.js +1 -1
- package/build/functions/customer/address/index.d.ts +17 -17
- package/build/functions/customer/address/index.js +1 -1
- package/build/functions/customer/attribute/index.d.ts +3 -3
- package/build/functions/customer/attribute/index.js +1 -1
- package/build/functions/customer/index.d.ts +13 -9
- package/build/functions/customer/index.js +1 -1
- package/build/functions/filter-category/index.d.ts +2 -2
- package/build/functions/filter-category/index.js +1 -1
- package/build/functions/image/index.d.ts +5 -4
- package/build/functions/image/index.js +1 -1
- package/build/functions/order/address/index.d.ts +17 -17
- package/build/functions/order/address/index.js +1 -1
- package/build/functions/order/index.d.ts +14 -13
- package/build/functions/order/index.js +1 -1
- package/build/functions/order/line-item/index.d.ts +6 -6
- package/build/functions/order/line-item/index.js +1 -1
- package/build/functions/order/line-item/variant/index.d.ts +2 -2
- package/build/functions/order/line-item/variant/index.js +1 -1
- package/build/functions/order/line-item/variant/value/index.d.ts +3 -3
- package/build/functions/payment-gateway/index.d.ts +6 -6
- package/build/functions/payment-gateway/index.js +1 -1
- package/build/functions/product/attribute-value/index.d.ts +2 -2
- package/build/functions/product/filter/index.d.ts +22 -21
- package/build/functions/product/filter/index.js +1 -1
- package/build/functions/product/index.d.ts +9 -9
- package/build/functions/product/index.js +1 -1
- package/build/functions/product/option-set/index.d.ts +4 -4
- package/build/functions/product/option-set/index.js +1 -1
- package/build/functions/product/option-set/option/index.d.ts +5 -5
- package/build/functions/product/option-set/option/index.js +1 -1
- package/build/functions/product/variant/index.d.ts +3 -3
- package/build/functions/product/variant/index.js +1 -1
- package/build/functions/product/variant/price/index.d.ts +5 -5
- package/build/functions/raffle/index.d.ts +2 -2
- package/build/functions/raffle/index.js +1 -1
- package/build/functions/variant-type/index.d.ts +3 -3
- package/build/functions/variant-type/variant-value/index.d.ts +3 -3
- package/build/index.d.ts +54 -54
- package/build/utils/helper.d.ts +4 -4
- package/build/utils/helper.js +1 -1
- package/package.json +15 -16
- package/build/ext/tslib/tslib.es6.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasBlogCategory } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasBlogCategoryHref(blogCategory: IkasBlogCategory): string;
|
|
1
|
+
import { IkasBlogCategory } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasBlogCategoryHref(blogCategory: IkasBlogCategory): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t){return t.metadata?.slug?`/blog/${t.metadata.slug}`:""}export{t as getIkasBlogCategoryHref};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasBlog } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasBlogHref(blog: IkasBlog): string;
|
|
1
|
+
import { IkasBlog } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasBlogHref(blog: IkasBlog): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t){return t.metadata?.slug?`/blog/${t.metadata.slug}`:""}export{t as getIkasBlogHref};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasBrand } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasBrandHref(brand: IkasBrand): string;
|
|
1
|
+
import { IkasBrand } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasBrandHref(brand: IkasBrand): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t){return t.metaData?.slug?`/${t.metaData.slug}`:""}export{t as getIkasBrandHref};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasCategory } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasCategoryHref(category: IkasCategory): string;
|
|
1
|
+
import { IkasCategory } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasCategoryHref(category: IkasCategory): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t){return t.metaData?.slug?`/${t.metaData.slug}`:""}export{t as getIkasCategoryHref};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasCategoryPathItem } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasCategoryPathItemSlug(categoryPathItem: IkasCategoryPathItem): string | undefined;
|
|
3
|
-
export declare function getIkasCategoryPathItemHref(categoryPathItem: IkasCategoryPathItem): string;
|
|
1
|
+
import { IkasCategoryPathItem } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasCategoryPathItemSlug(categoryPathItem: IkasCategoryPathItem): string | undefined;
|
|
3
|
+
export declare function getIkasCategoryPathItemHref(categoryPathItem: IkasCategoryPathItem): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t){return t.metaData?.slug}function n(n){const r=t(n);return r?`/${r}`:""}export{n as getIkasCategoryPathItemHref,t as getIkasCategoryPathItemSlug};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasCheckout, IkasPaymentGateway } from "@ikas/storefront-models";
|
|
2
|
-
export declare function isComplete(checkout: IkasCheckout): boolean;
|
|
3
|
-
export declare function getTotalFinalPrice(checkout: IkasCheckout, selectedPaymentGateway: IkasPaymentGateway): number;
|
|
1
|
+
import { IkasCheckout, IkasPaymentGateway } from "@ikas/storefront-models";
|
|
2
|
+
export declare function isComplete(checkout: IkasCheckout): boolean;
|
|
3
|
+
export declare function getTotalFinalPrice(checkout: IkasCheckout, selectedPaymentGateway: IkasPaymentGateway): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasCartCreatedBy as t,IkasOrderPaymentStatus as r,IkasPaymentGatewayAdditionalPriceType as
|
|
1
|
+
import{IkasCartCreatedBy as t,IkasOrderPaymentStatus as r,IkasPaymentGatewayAdditionalPriceType as e}from"@ikas/storefront-models";import{getCalculatedAdditionalPrices as o}from"../payment-gateway/index.js";function n(e){return e.createdBy===t.ADMIN?e.orderPaymentStatus===r.PAID:!!e.orderNumber}function a(t,r){const n=r?o(r,t.totalFinalPrice||0,t.shippingLines||null):void 0;let a=t.totalFinalPrice||0;return n?.forEach((t=>{t.type===e.DECREMENT?a-=t.amount:a+=t.amount})),a}export{a as getTotalFinalPrice,n as isComplete};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IkasCheckoutSettings, IkasCustomerAddress } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getAddressText(address: IkasCustomerAddress): string;
|
|
3
|
-
export declare function getValidationResult(address: IkasCustomerAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): IkasCustomerAddressValidationResult;
|
|
4
|
-
export declare function isValidAddress(address: IkasCustomerAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): boolean;
|
|
5
|
-
export
|
|
6
|
-
firstName: boolean;
|
|
7
|
-
lastName: boolean;
|
|
8
|
-
addressLine1: boolean;
|
|
9
|
-
country: boolean;
|
|
10
|
-
state: boolean;
|
|
11
|
-
city: boolean;
|
|
12
|
-
district: boolean;
|
|
13
|
-
phone: boolean;
|
|
14
|
-
postalCode: boolean;
|
|
15
|
-
identityNumber: boolean;
|
|
16
|
-
title: boolean;
|
|
17
|
-
};
|
|
1
|
+
import { IkasCheckoutSettings, IkasCustomerAddress } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getAddressText(address: IkasCustomerAddress): string;
|
|
3
|
+
export declare function getValidationResult(address: IkasCustomerAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): IkasCustomerAddressValidationResult;
|
|
4
|
+
export declare function isValidAddress(address: IkasCustomerAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): boolean;
|
|
5
|
+
export type IkasCustomerAddressValidationResult = {
|
|
6
|
+
firstName: boolean;
|
|
7
|
+
lastName: boolean;
|
|
8
|
+
addressLine1: boolean;
|
|
9
|
+
country: boolean;
|
|
10
|
+
state: boolean;
|
|
11
|
+
city: boolean;
|
|
12
|
+
district: boolean;
|
|
13
|
+
phone: boolean;
|
|
14
|
+
postalCode: boolean;
|
|
15
|
+
identityNumber: boolean;
|
|
16
|
+
title: boolean;
|
|
17
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasCheckoutRequirement as e}from"@ikas/storefront-models";import{validatePhoneNumber as t}from"../../../utils/helper.js";function n(e){
|
|
1
|
+
import{IkasCheckoutRequirement as e}from"@ikas/storefront-models";import{validatePhoneNumber as t}from"../../../utils/helper.js";function n(e){const t=[];return e.addressLine1&&t.push(e.addressLine1),e.addressLine2&&t.push(e.addressLine2),e.postalCode&&t.push(e.postalCode),e.region&&e.region.name&&t.push(e.region.name),e.district&&e.district.name&&t.push(e.district.name),e.city&&e.city.name&&t.push(e.city.name),e.state&&e.state.name&&"Default"!==e.state.name&&t.push(e.state.name),e.country&&e.country.name&&t.push(e.country.name),t.join(", ")}function s(n,s,i){const r=!!n.phone&&n.phone.length>=10&&t(n.phone);return{firstName:!!n.firstName,lastName:!!n.lastName,addressLine1:!!n.addressLine1,country:!!n.country?.name,state:!!n.state,city:!!n.city?.name,district:!i||!!n.district?.id,phone:!(s.phoneRequirement===e.MANDATORY||s.phoneRequirement===e.OPTIONAL&&n.phone)||r,postalCode:s.postalCodeRequirement!==e.MANDATORY||!!n.postalCode,identityNumber:s.identityNumberRequirement!==e.MANDATORY||!!n.identityNumber,title:!!n.title}}function i(e,t,n){const i=s(e,t,n);return Object.values(i).every((e=>e))}export{n as getAddressText,s as getValidationResult,i as isValidAddress};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasCustomerAttribute } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getAccountPagePermission(attribute: IkasCustomerAttribute): import("@ikas/storefront-models").IkasCustomerAttributePermission | undefined;
|
|
3
|
-
export declare function getRegisterPageRequirement(attribute: IkasCustomerAttribute): import("@ikas/storefront-models").IkasCustomerAttributeRegisterPageRequirement | undefined;
|
|
1
|
+
import { IkasCustomerAttribute } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getAccountPagePermission(attribute: IkasCustomerAttribute): import("@ikas/storefront-models").IkasCustomerAttributePermission | undefined;
|
|
3
|
+
export declare function getRegisterPageRequirement(attribute: IkasCustomerAttribute): import("@ikas/storefront-models").IkasCustomerAttributeRegisterPageRequirement | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasStorefrontConfig as n}from"@ikas/storefront-config";function e(e){
|
|
1
|
+
import{IkasStorefrontConfig as n}from"@ikas/storefront-config";function e(e){const s=n.getSalesChannelId();return e.salesChannels?.find((n=>n.salesChannelId===s))?.permission}function s(e){const s=n.getSalesChannelId();return e.salesChannels?.find((n=>n.salesChannelId===s))?.registerPageRequirement}export{e as getAccountPagePermission,s as getRegisterPageRequirement};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { IkasCustomer } from "@ikas/storefront-models";
|
|
2
|
-
export declare function isSubscribed(customer: IkasCustomer): boolean;
|
|
3
|
-
export declare function getBasicInfo(customer: IkasCustomer): {
|
|
4
|
-
id: string;
|
|
5
|
-
firstName: string;
|
|
6
|
-
lastName: string | null;
|
|
7
|
-
email: string | null;
|
|
8
|
-
phone: string | null;
|
|
9
|
-
|
|
1
|
+
import { IkasCustomer, IkasCustomerEmailSubscriptionStatus } from "@ikas/storefront-models";
|
|
2
|
+
export declare function isSubscribed(customer: IkasCustomer): boolean;
|
|
3
|
+
export declare function getBasicInfo(customer: IkasCustomer): {
|
|
4
|
+
id: string;
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string | null;
|
|
7
|
+
email: string | null;
|
|
8
|
+
phone: string | null;
|
|
9
|
+
isEmailVerified: boolean | null;
|
|
10
|
+
isPhoneVerified: boolean | null;
|
|
11
|
+
orderCount: number | null;
|
|
12
|
+
subscriptionStatus: IkasCustomerEmailSubscriptionStatus | null;
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasCustomerEmailSubscriptionStatus as
|
|
1
|
+
import{IkasCustomerEmailSubscriptionStatus as i}from"@ikas/storefront-models";function t(t){return t.subscriptionStatus===i.SUBSCRIBED||t.subscriptionStatus===i.PENDING_CONFIRMATION}function e(i){return{id:i.id,firstName:i.firstName,lastName:i.lastName,email:i.email,phone:i.phone,isEmailVerified:i.isEmailVerified,isPhoneVerified:i.isPhoneVerified,orderCount:i.orderCount,subscriptionStatus:i.subscriptionStatus}}export{e as getBasicInfo,t as isSubscribed};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasFilterCategory } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasFilterCategoryHref(filterCategory: IkasFilterCategory): string;
|
|
1
|
+
import { IkasFilterCategory } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasFilterCategoryHref(filterCategory: IkasFilterCategory): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){return t.metaData
|
|
1
|
+
function t(t){return t.metaData?`/${t.metaData.slug}`:""}export{t as getIkasFilterCategoryHref};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IkasImage } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getDefaultSrc(image: IkasImage): string;
|
|
3
|
-
export declare function getThumbnailSrc(image: IkasImage): string;
|
|
4
|
-
export declare function getSrc(image: IkasImage, size: number): string;
|
|
1
|
+
import { IkasImage } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getDefaultSrc(image: IkasImage): string;
|
|
3
|
+
export declare function getThumbnailSrc(image: IkasImage): string;
|
|
4
|
+
export declare function getSrc(image: IkasImage, size: number): string;
|
|
5
|
+
export declare function generateSrcSet(image: IkasImage): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasStorefrontConfig as
|
|
1
|
+
import{IkasStorefrontConfig as e}from"@ikas/storefront-config";const i=[180,360,540,720,900,1080,1296,1512,1728,1950,2560,3840];function $(e){return t(e,1080)}function n(e){return t(e,180)}function t(i,$){const n=e.getCdnUrl();if(i.id.includes("/"))return i.isVideo?`${n}videos/${i.id}/original.mp4`:i.fileName?`${n}images/${i.id}/${$}/${i.fileName}.webp`:`${n}images/${i.id}/image_${$}.webp`;const t=e.getMerchantSettings()?.merchantId;return i.isVideo?`${n}videos/${t}/${i.id}/original.mp4`:i.fileName?`${n}images/${t}/${i.id}/${$}/${i.fileName}.webp`:`${n}images/${t}/${i.id}/image_${$}.webp`}function r($){if($.isVideo)return"";const n=e.getCdnUrl();return i.map((i=>{if($.id.includes("/"))return $.fileName?`${n}images/${$.id}/${i}/${$.fileName}.webp ${i}w`:`${n}images/${$.id}/image_${i}.webp ${i}w`;{const t=e.getMerchantSettings()?.merchantId;return $.fileName?`${n}images/${t}/${$.id}/${i}/${$.fileName}.webp ${i}w`:`${n}images/${t}/${$.id}/image_${i}.webp ${i}w`}})).join(", ")}export{r as generateSrcSet,$ as getDefaultSrc,t as getSrc,n as getThumbnailSrc};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IkasCheckoutSettings, IkasOrderAddress } from "@ikas/storefront-models";
|
|
2
|
-
export declare function createOrderAddress(): IkasOrderAddress;
|
|
3
|
-
export declare function getAddressText(address: IkasOrderAddress): string;
|
|
4
|
-
export declare function getValidationResult(address: IkasOrderAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): IkasOrderAddressValidationResult;
|
|
5
|
-
export declare function isValidAddress(address: IkasOrderAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): boolean;
|
|
6
|
-
export
|
|
7
|
-
firstName: boolean;
|
|
8
|
-
lastName: boolean;
|
|
9
|
-
addressLine1: boolean;
|
|
10
|
-
country: boolean;
|
|
11
|
-
state: boolean;
|
|
12
|
-
city: boolean;
|
|
13
|
-
district: boolean;
|
|
14
|
-
phone: boolean;
|
|
15
|
-
postalCode: boolean;
|
|
16
|
-
identityNumber: boolean;
|
|
17
|
-
};
|
|
1
|
+
import { IkasCheckoutSettings, IkasOrderAddress } from "@ikas/storefront-models";
|
|
2
|
+
export declare function createOrderAddress(): IkasOrderAddress;
|
|
3
|
+
export declare function getAddressText(address: IkasOrderAddress): string;
|
|
4
|
+
export declare function getValidationResult(address: IkasOrderAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): IkasOrderAddressValidationResult;
|
|
5
|
+
export declare function isValidAddress(address: IkasOrderAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): boolean;
|
|
6
|
+
export type IkasOrderAddressValidationResult = {
|
|
7
|
+
firstName: boolean;
|
|
8
|
+
lastName: boolean;
|
|
9
|
+
addressLine1: boolean;
|
|
10
|
+
country: boolean;
|
|
11
|
+
state: boolean;
|
|
12
|
+
city: boolean;
|
|
13
|
+
district: boolean;
|
|
14
|
+
phone: boolean;
|
|
15
|
+
postalCode: boolean;
|
|
16
|
+
identityNumber: boolean;
|
|
17
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasCheckoutRequirement as e}from"@ikas/storefront-models";import{validatePhoneNumber as t}from"../../../utils/helper.js";function n(){return{addressLine1:"",addressLine2:null,company:null,firstName:"",id:null,identityNumber:null,isDefault:!1,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,country:null,state:null,city:null,district:null}}function
|
|
1
|
+
import{IkasCheckoutRequirement as e}from"@ikas/storefront-models";import{validatePhoneNumber as t}from"../../../utils/helper.js";function n(){return{addressLine1:"",addressLine2:null,company:null,firstName:"",id:null,identityNumber:null,isDefault:!1,lastName:"",phone:null,postalCode:null,taxNumber:null,taxOffice:null,country:null,state:null,city:null,district:null,region:null}}function s(e){const t=[];return e.addressLine1&&t.push(e.addressLine1),e.addressLine2&&t.push(e.addressLine2),e.postalCode&&t.push(e.postalCode),e.region&&e.region.name&&t.push(e.region.name),e.district&&e.district.name&&t.push(e.district.name),e.city&&e.city.name&&t.push(e.city.name),e.state&&e.state.name&&"Default"!==e.state.name&&t.push(e.state.name),e.country&&e.country.name&&t.push(e.country.name),t.join(", ")}function i(n,s,i){const r=!!n.phone&&n.phone.length>=10&&t(n.phone);return{firstName:!!n.firstName,lastName:!!n.lastName,addressLine1:!!n.addressLine1,country:!!n.country?.name,state:!!n.state,city:!!n.city?.name,district:!i||!!n.district?.name,phone:!(s.phoneRequirement===e.MANDATORY||s.phoneRequirement===e.OPTIONAL&&n.phone)||r,postalCode:s.postalCodeRequirement!==e.MANDATORY||!!n.postalCode,identityNumber:s.identityNumberRequirement!==e.MANDATORY||!!n.identityNumber}}function r(e,t,n){const s=i(e,t,n);return Object.values(s).every((e=>e))}export{n as createOrderAddress,s as getAddressText,i as getValidationResult,r as isValidAddress};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { IkasOrder, IkasOrderPackage, IkasOrderRefundSettings } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getDisplayedPackages(order: IkasOrder): IkasOrderPackage[];
|
|
3
|
-
export declare function getRefundableItems(order: IkasOrder, refundSettings: IkasOrderRefundSettings): import("@ikas/storefront-models").IkasOrderLineItem[];
|
|
4
|
-
export declare function getUnfullfilledItems(order: IkasOrder): import("@ikas/storefront-models").IkasOrderLineItem[];
|
|
5
|
-
export declare function getRefundedItems(order: IkasOrder): import("@ikas/storefront-models").IkasOrderLineItem[];
|
|
6
|
-
export declare function getTotalTax(order: IkasOrder): number;
|
|
7
|
-
export declare function getShippingTotal(order: IkasOrder): number;
|
|
8
|
-
export declare function hasCustomer(order: IkasOrder): boolean;
|
|
9
|
-
export declare function hasValidCustomerEmail(order: IkasOrder): boolean;
|
|
10
|
-
export declare function getCustomerFullName(order: IkasOrder): string;
|
|
11
|
-
export declare function getFormattedDate(order: IkasOrder): string;
|
|
12
|
-
export declare function getCouponAdjustment(order: IkasOrder): import("@ikas/storefront-models").IkasOrderAdjustment | undefined;
|
|
13
|
-
export declare function getNonCouponAdjustments(order: IkasOrder): import("@ikas/storefront-models").IkasOrderAdjustment[] | undefined;
|
|
1
|
+
import { IkasOrder, IkasOrderPackage, IkasOrderRefundSettings } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getDisplayedPackages(order: IkasOrder): IkasOrderPackage[];
|
|
3
|
+
export declare function getRefundableItems(order: IkasOrder, refundSettings: IkasOrderRefundSettings): import("@ikas/storefront-models").IkasOrderLineItem[];
|
|
4
|
+
export declare function getUnfullfilledItems(order: IkasOrder): import("@ikas/storefront-models").IkasOrderLineItem[];
|
|
5
|
+
export declare function getRefundedItems(order: IkasOrder): import("@ikas/storefront-models").IkasOrderLineItem[];
|
|
6
|
+
export declare function getTotalTax(order: IkasOrder): number;
|
|
7
|
+
export declare function getShippingTotal(order: IkasOrder): number;
|
|
8
|
+
export declare function hasCustomer(order: IkasOrder): boolean;
|
|
9
|
+
export declare function hasValidCustomerEmail(order: IkasOrder): boolean;
|
|
10
|
+
export declare function getCustomerFullName(order: IkasOrder): string;
|
|
11
|
+
export declare function getFormattedDate(order: IkasOrder): string;
|
|
12
|
+
export declare function getCouponAdjustment(order: IkasOrder): import("@ikas/storefront-models").IkasOrderAdjustment | undefined;
|
|
13
|
+
export declare function getNonCouponAdjustments(order: IkasOrder): import("@ikas/storefront-models").IkasOrderAdjustment[] | undefined;
|
|
14
|
+
export declare function getOrderProductFiles(order: IkasOrder): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{IkasOrderPackageFullfillStatus as e,IkasOrderLineItemStatus as t}from"@ikas/storefront-models";import{validateEmail as r,formatDate as n}from"../../utils/helper.js";function o(r){const n=i(r),o=r.orderPackages?.filter((t=>!t.deleted&&![e.REFUNDED,e.REFUND_REQUESTED,e.REFUND_REQUEST_ACCEPTED,e.REFUND_REJECTED].includes(t.orderPackageFulfillStatus))),u=r.orderLineItems.filter((e=>!e.deleted&&(e.status===t.CANCELLED||e.status===t.CANCEL_REJECTED||e.status===t.CANCEL_REQUESTED))),a=s(r),d=[];return n.length&&d.push({id:r.id+"-u",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItemIds:n.map((e=>e.id)),orderPackageFulfillStatus:e.UNFULFILLED,orderPackageNumber:r.orderNumber?r.orderNumber+"-u":"u",stockLocationId:n[0].stockLocationId||"",trackingInfo:null}),o&&d.push(...o),u.length&&d.push({id:r.id+"-c",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItemIds:u.map((e=>e.id)),orderPackageFulfillStatus:e.CANCELLED,orderPackageNumber:r.orderNumber?r.orderNumber+"-c":"c",stockLocationId:u[0].stockLocationId||"",trackingInfo:null}),a.length&&d.push({id:r.id+"-r",createdAt:Date.now(),updatedAt:Date.now(),errorMessage:null,note:null,orderLineItemIds:a.map((e=>e.id)),orderPackageFulfillStatus:e.REFUNDED,orderPackageNumber:r.orderNumber?r.orderNumber+"-r":"r",stockLocationId:a[0].stockLocationId||"",trackingInfo:null}),d}function u(e,r){if(r&&!r.isActiveRefundSection)return[];const n=function(e){const t=e.orderedAt,r=Date.now();return Math.abs(r-t)/864e5}(e);return e.orderLineItems.filter((e=>[t.FULFILLED,t.UNFULFILLED,t.DELIVERED].includes(e.status)&&(!r.orderRefundDayLimit||r.orderRefundDayLimit>=n)))}function i(e){return e.orderLineItems.filter((e=>e.status===t.UNFULFILLED))}function s(e){return e.orderLineItems.filter((e=>e.status===t.REFUNDED||e.status===t.REFUND_REQUESTED||e.status===t.REFUND_REQUEST_ACCEPTED||e.status===t.REFUND_REJECTED))}function a(e){return e.taxLines?.reduce(((e,t)=>e+t.price),0)||0}function d(e){return e.shippingLines?.reduce(((e,t)=>e+t.finalPrice),0)||0}function c(e){return!!e.customer?.id&&!e.customer.isGuestCheckout}function l(e){return!!e.customer?.email&&r(e.customer.email)}function E(e){return`${e.customer?.firstName||""} ${e.customer?.lastName||""}`}function m(e){const t=new Date;return t.setTime(e.updatedAt),n(t)}function f(e){return e.orderAdjustments?.find((e=>!!e.couponId))}function D(e){return e.orderAdjustments?.filter((e=>!e.couponId))}function L(e){return e.orderLineItems.filter((e=>!!e.variant.fileId&&e.status!==t.REFUNDED)).map((e=>e.variant.fileId))}export{f as getCouponAdjustment,E as getCustomerFullName,o as getDisplayedPackages,m as getFormattedDate,D as getNonCouponAdjustments,L as getOrderProductFiles,u as getRefundableItems,s as getRefundedItems,d as getShippingTotal,a as getTotalTax,i as getUnfullfilledItems,c as hasCustomer,l as hasValidCustomerEmail};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IkasOrderLineItem } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getPriceWithQuantity(item: IkasOrderLineItem): number;
|
|
3
|
-
export declare function getOverridenPriceWithQuantity(item: IkasOrderLineItem): number;
|
|
4
|
-
export declare function getFinalPriceWithQuantity(item: IkasOrderLineItem): number;
|
|
5
|
-
export declare function getTax(item: IkasOrderLineItem): number;
|
|
6
|
-
export declare function hasDiscount(item: IkasOrderLineItem): boolean;
|
|
1
|
+
import { IkasOrderLineItem } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getPriceWithQuantity(item: IkasOrderLineItem): number;
|
|
3
|
+
export declare function getOverridenPriceWithQuantity(item: IkasOrderLineItem): number;
|
|
4
|
+
export declare function getFinalPriceWithQuantity(item: IkasOrderLineItem): number;
|
|
5
|
+
export declare function getTax(item: IkasOrderLineItem): number;
|
|
6
|
+
export declare function hasDiscount(item: IkasOrderLineItem): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){return n.price*n.quantity}function
|
|
1
|
+
function n(n){return n.price*n.quantity}function t(n){return n.price!==n.finalPrice?n.price*n.quantity:0}function i(n){return(n.finalPrice??n.price)*n.quantity}function r(n){const t=n.taxValue||0;return(n.finalPrice||0)*n.quantity/(100+t)*t}function u(n){return null!==n.discountPrice}export{i as getFinalPriceWithQuantity,t as getOverridenPriceWithQuantity,n as getPriceWithQuantity,r as getTax,u as hasDiscount};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasOrderLineVariant } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasOrderLineVariantHref(variant: IkasOrderLineVariant): string | undefined;
|
|
1
|
+
import { IkasOrderLineVariant } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasOrderLineVariantHref(variant: IkasOrderLineVariant): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getIkasVariantTypeSlug as n,getIkasVariantNameSlug as
|
|
1
|
+
import{getIkasVariantTypeSlug as n,getIkasVariantNameSlug as r}from"./value/index.js";function u(u){if(!u.slug)return;const t=u.variantValues?.map((u=>`${n(u)}=${r(u)}`)).join("&");return t?`/${u.slug}?${t}`:`/${u.slug}`}export{u as getIkasOrderLineVariantHref};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasOrderLineVariantVariantValue } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasVariantTypeSlug(variantValue: IkasOrderLineVariantVariantValue): string;
|
|
3
|
-
export declare function getIkasVariantNameSlug(variantValue: IkasOrderLineVariantVariantValue): string;
|
|
1
|
+
import { IkasOrderLineVariantVariantValue } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasVariantTypeSlug(variantValue: IkasOrderLineVariantVariantValue): string;
|
|
3
|
+
export declare function getIkasVariantNameSlug(variantValue: IkasOrderLineVariantVariantValue): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IkasOrderShippingLine, IkasPaymentGateway, IkasPaymentGatewayAdditionalPriceType } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getCalculatedAdditionalPrices(paymentGateway: IkasPaymentGateway, totalFinalPrice: number, shippingLines: IkasOrderShippingLine[] | null): {
|
|
3
|
-
name: string;
|
|
4
|
-
amount: number;
|
|
5
|
-
type: IkasPaymentGatewayAdditionalPriceType;
|
|
6
|
-
}[] | undefined;
|
|
1
|
+
import { IkasOrderShippingLine, IkasPaymentGateway, IkasPaymentGatewayAdditionalPriceType } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getCalculatedAdditionalPrices(paymentGateway: IkasPaymentGateway, totalFinalPrice: number, shippingLines: IkasOrderShippingLine[] | null): {
|
|
3
|
+
name: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
type: IkasPaymentGatewayAdditionalPriceType;
|
|
6
|
+
}[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasPaymentGatewayTransactionFeeType as
|
|
1
|
+
import{IkasPaymentGatewayTransactionFeeType as e,IkasPaymentGatewayAdditionalPriceType as t}from"@ikas/storefront-models";function n(n,o,a){if(n.additionalPrices){const r=a?.reduce(((e,t)=>e+t.price),0)||0;return o-=r,n.additionalPrices.map((a=>{let r=0;return r=a.amountType===e.RATIO?(o||0)*a.amount/100:a.amount,a.type===t.DECREMENT?o-=r:o+=r,{name:a.name||n.name,amount:r,type:a.type}}))}}export{n as getCalculatedAdditionalPrices};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasAttributeTableCellValue } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getTableValue(value: string | null): IkasAttributeTableCellValue[] | undefined;
|
|
1
|
+
import { IkasAttributeTableCellValue } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getTableValue(value: string | null): IkasAttributeTableCellValue[] | undefined;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { IkasApplicableProductFilterValue, IkasFilterRangeValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterNumberRangeListOption, IkasProductFilterType } from "@ikas/storefront-models";
|
|
2
|
-
export declare function isCustomValueFilter(filter: IkasProductFilter): boolean;
|
|
3
|
-
export declare function isStockFilter(filter: IkasProductFilter): boolean;
|
|
4
|
-
export declare function getValueList(filter: IkasProductFilter): string[];
|
|
5
|
-
export declare function getKeyList(filter: IkasProductFilter): string[];
|
|
6
|
-
export declare function getDisplayedValues(filter: IkasProductFilter): IkasApplicableProductFilterValue[];
|
|
7
|
-
export declare function onFilterValueClick(filter: IkasProductFilter, filterValue: IkasApplicableProductFilterValue): void;
|
|
8
|
-
export declare function onNumberRangeClick(filter: IkasProductFilter, option: IkasProductFilterNumberRangeListOption): void;
|
|
9
|
-
export declare function onNumberRangeChange(filter: IkasProductFilter, numberRange: IkasFilterRangeValue | null): void;
|
|
10
|
-
export declare function clear(filter: IkasProductFilter): void;
|
|
11
|
-
export declare function toInput(filter: IkasProductFilter): IkasSearchInputFilterListInput;
|
|
12
|
-
export declare function applyQueryParam(filter: IkasProductFilter, value: string): void;
|
|
13
|
-
export declare function rangeToId(range: IkasFilterRangeValue): string;
|
|
14
|
-
export declare function parseRangeStr(rangeStr: string): IkasFilterRangeValue;
|
|
15
|
-
export declare
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { IkasApplicableProductFilterValue, IkasFilterRangeValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterNumberRangeListOption, IkasProductFilterType } from "@ikas/storefront-models";
|
|
2
|
+
export declare function isCustomValueFilter(filter: IkasProductFilter): boolean;
|
|
3
|
+
export declare function isStockFilter(filter: IkasProductFilter): boolean;
|
|
4
|
+
export declare function getValueList(filter: IkasProductFilter): string[];
|
|
5
|
+
export declare function getKeyList(filter: IkasProductFilter): string[];
|
|
6
|
+
export declare function getDisplayedValues(filter: IkasProductFilter): IkasApplicableProductFilterValue[];
|
|
7
|
+
export declare function onFilterValueClick(filter: IkasProductFilter, filterValue: IkasApplicableProductFilterValue): void;
|
|
8
|
+
export declare function onNumberRangeClick(filter: IkasProductFilter, option: IkasProductFilterNumberRangeListOption): void;
|
|
9
|
+
export declare function onNumberRangeChange(filter: IkasProductFilter, numberRange: IkasFilterRangeValue | null): void;
|
|
10
|
+
export declare function clear(filter: IkasProductFilter): void;
|
|
11
|
+
export declare function toInput(filter: IkasProductFilter): IkasSearchInputFilterListInput;
|
|
12
|
+
export declare function applyQueryParam(filter: IkasProductFilter, value: string): void;
|
|
13
|
+
export declare function rangeToId(range: IkasFilterRangeValue): string;
|
|
14
|
+
export declare function parseRangeStr(rangeStr: string): IkasFilterRangeValue;
|
|
15
|
+
export declare function getIkasFilterHref(value: IkasApplicableProductFilterValue): string;
|
|
16
|
+
export type IkasSearchInputFilterListInput = {
|
|
17
|
+
displayType?: IkasProductFilterDisplayType | null;
|
|
18
|
+
id: string;
|
|
19
|
+
type: IkasProductFilterType;
|
|
20
|
+
useAndFilter?: boolean | null;
|
|
21
|
+
valueList: string[];
|
|
22
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasProductFilterDisplayType as e,IkasProductFilterType as
|
|
1
|
+
import{IkasProductFilterDisplayType as e,IkasProductFilterType as t,IkasProductFilterSortType as n}from"@ikas/storefront-models";import i from"lodash/sortBy";import r from"lodash/cloneDeep";function s(t){return[e.NUMBER_RANGE_LIST,e.NUMBER_RANGE].includes(t.displayType)}function o(e){return e.type===t.STOCK_STATUS}function u(e){return e.numberRange?[p(e.numberRange)]:e.numberRangeListOptions?e.numberRangeListOptions.filter((e=>e.isSelected)).map((e=>p(e))):e.values?.filter((e=>e.isSelected)).map((e=>e.id))||[]}function l(e){return e.numberRange?[p(e.numberRange)]:e.numberRangeListOptions?e.numberRangeListOptions.filter((e=>e.isSelected)).map((e=>p(e))):e.values?.filter((e=>e.isSelected)).map((e=>e.key))||[]}function c(e){const t=e.settings?.sortType||n.ALPHABETICAL_ASC,r=[n.ALPHABETICAL_DESC,n.PRODUCT_COUNT_DESC].includes(t),s=[n.ALPHABETICAL_ASC,n.ALPHABETICAL_DESC].includes(t),o=t===n.CUSTOM_SORT;let u=e.values?.filter((e=>0!==e.resultCount||e.isSelected));if(u=i(u,s?"key":"resultCount"),r&&(u=u?.reverse()),o){const t=e.settings?.customSortedValues||[];u=u.sort((function(e,n){return t.indexOf(e.id)-t.indexOf(n.id)}))}return u}function a(e,t){if(s(e))throw new Error("onFilterValueClick cannot be used with NUMBER_RANGE | NUMBER_RANGE_LIST types!");t.isSelected=!t.isSelected,!e.isMultiSelect&&t.isSelected&&e.values?.forEach((e=>{e.id!==t.id&&(e.isSelected=!1)}))}function d(t,n){if(t.displayType!==e.NUMBER_RANGE_LIST)throw new Error("onNumberRangeClick can only be used with NUMBER_RANGE filters!");n.isSelected=!n.isSelected,!t.isMultiSelect&&n.isSelected&&t.numberRangeListOptions?.forEach((e=>{e.key!==n.key&&(e.isSelected=!1)}))}function f(t,n){if(t.displayType!==e.NUMBER_RANGE)throw new Error("onNumberRangeChange can only be used with NUMBER_RANGE filters!");if(!n)return void(t.numberRange=null);const i=r(n);i.from<t.numberRangeLimit.from&&(i.from=t.numberRange.from),i.to&&t.numberRangeLimit?.to&&i.to>t.numberRangeLimit.to&&(i.to=t.numberRangeLimit.to),t.numberRange=i}function m(e){e.numberRange=null,e.numberRangeListOptions?.forEach((e=>e.isSelected=!1)),e.values?.forEach((e=>e.isSelected=!1))}function R(e){return{id:e.key,type:e.type,valueList:u(e),useAndFilter:e.settings?.useAndFilter}}function E(t,n){const i=n.split(",");t.displayType===e.NUMBER_RANGE?t.numberRange=S(n):t.displayType===e.NUMBER_RANGE_LIST?t.numberRangeListOptions?.forEach((e=>{i.includes(e.key)&&(e.isSelected=!0)})):t.values?.forEach((e=>{i.includes(e.key)&&0!==e.resultCount&&(e.isSelected=!0)}))}function p(e){return`${e.from}:${e.to||""}`}function S(e){try{const t=e.split(":").map((e=>parseInt(e)));return{from:isNaN(t[0])?0:t[0],to:isNaN(t[1])?void 0:t[1]}}catch(e){return console.log(e),{from:0,to:0}}}function g(e){return e.slug?`/${e.slug}`:""}export{E as applyQueryParam,m as clear,c as getDisplayedValues,g as getIkasFilterHref,l as getKeyList,u as getValueList,s as isCustomValueFilter,o as isStockFilter,a as onFilterValueClick,f as onNumberRangeChange,d as onNumberRangeClick,S as parseRangeStr,p as rangeToId,R as toInput};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IkasDisplayedVariantType, IkasProduct, IkasProductOptionSet, IkasProductVariant, IkasVariantValue } from "@ikas/storefront-models";
|
|
2
|
-
export declare function hasVariant(product: IkasProduct): boolean;
|
|
3
|
-
export declare function hasStock(product: IkasProduct): boolean;
|
|
4
|
-
export declare function getMainVariantValue(selectedVariantValues: IkasVariantValue[]): IkasVariantValue | undefined;
|
|
5
|
-
export declare function getMainVariantType(product: IkasProduct): import("@ikas/storefront-models").IkasVariantType | undefined;
|
|
6
|
-
export declare function getSelectedVariantHref(product: IkasProduct, selectedVariantValues: IkasVariantValue[]): string;
|
|
7
|
-
export declare function getProductHref(product: IkasProduct): string;
|
|
8
|
-
export declare function getDisplayedVariantTypes(product: IkasProduct, selectedVariantValues: IkasVariantValue[]): IkasDisplayedVariantType[];
|
|
9
|
-
export declare function isAddToCartEnabled(selectedVariant: IkasProductVariant, productOptionSet?: IkasProductOptionSet): boolean;
|
|
1
|
+
import { IkasDisplayedVariantType, IkasProduct, IkasProductOptionSet, IkasProductVariant, IkasVariantValue } from "@ikas/storefront-models";
|
|
2
|
+
export declare function hasVariant(product: IkasProduct): boolean;
|
|
3
|
+
export declare function hasStock(product: IkasProduct): boolean;
|
|
4
|
+
export declare function getMainVariantValue(selectedVariantValues: IkasVariantValue[]): IkasVariantValue | undefined;
|
|
5
|
+
export declare function getMainVariantType(product: IkasProduct): import("@ikas/storefront-models").IkasVariantType | undefined;
|
|
6
|
+
export declare function getSelectedVariantHref(product: IkasProduct, selectedVariantValues: IkasVariantValue[]): string;
|
|
7
|
+
export declare function getProductHref(product: IkasProduct): string;
|
|
8
|
+
export declare function getDisplayedVariantTypes(product: IkasProduct, selectedVariantValues: IkasVariantValue[]): IkasDisplayedVariantType[];
|
|
9
|
+
export declare function isAddToCartEnabled(selectedVariant: IkasProductVariant, productOptionSet?: IkasProductOptionSet): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getIkasVariantTypeSlug as t}from"../variant-type/index.js";import{getIkasVariantValueSlug as a}from"../variant-type/variant-value/index.js";import{hasValidValues as i}from"./option-set/index.js";import{hasStock as n}from"./variant/index.js";function e(t){return t.productGroup?t.variants.length>1:!!t.variantTypes.length}function r(t){if(t.groupVariantsByVariantTypeId){const a=t.variants[0].variantValues.find((a=>a.variantTypeId==t.groupVariantsByVariantTypeId));if(a)return t.variants.filter((t=>t.variantValues.find((t=>t.id==a.id)))).some((t=>t.stock>0||t.sellIfOutOfStock))}return t.variants.some((t=>t.stock>0||t.sellIfOutOfStock))}function s(t){return t.length?t[0]:void 0}function o(t){if(e(t))return t.variantTypes[0].variantType}function u(i,n){const e=i.metaData;if(!e?.slug)return"";const r=i.variantTypes.map((i=>{const e=i.variantType,r=e.values.find((t=>n.some((a=>a.id===t.id))));if(r)return`${t(e)}=${a(r)}`})).filter((t=>!!t)).join("&");return r?`/${e.slug}?${r}`:`/${e.slug}`}function l(t){const a=t.metaData;return a?.slug?`/${a.slug}`:""}function v(t,a){const i=t.variantTypes.map(((i,e)=>{const r=i.variantType,s=[],o=e>0?t.variantTypes.slice(0,e):null;let u=[];return o&&(u=a.filter((t=>o.some((a=>a.variantType.id===t.variantTypeId))))),r.values.forEach((i=>{const e=[...u,i],r=t.variants.find((t=>t.isActive&&e.every((a=>t.variantValues.some((t=>t.id===a.id)))))),o=t.variants.find((t=>t.isActive&&n(t)&&e.every((a=>t.variantValues.some((t=>t.id===a.id)))))),l=a.some((t=>t.id===i.id));r&&s.push({variant:r,variantValue:i,hasStock:!!o,isSelected:l})})),{variantType:r,displayedVariantValues:s}}));return 1===i.length&&(i[0].displayedVariantValues=i[0].displayedVariantValues.filter((t=>t.variant.isActive))),i}function d(t,a){return(!a||i(a))&&(n(t)||t.sellIfOutOfStock)}export{v as getDisplayedVariantTypes,o as getMainVariantType,s as getMainVariantValue,l as getProductHref,u as getSelectedVariantHref,r as hasStock,e as hasVariant,d as isAddToCartEnabled};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IkasProductOptionSet } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getDisplayedOptions(optionSet: IkasProductOptionSet): import("@ikas/storefront-models").IkasProductOption[];
|
|
3
|
-
export declare function initOptionValues(optionSet: IkasProductOptionSet): void;
|
|
4
|
-
export declare function hasValidValues(optionSet: IkasProductOptionSet): boolean;
|
|
1
|
+
import { IkasProductOptionSet } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getDisplayedOptions(optionSet: IkasProductOptionSet): import("@ikas/storefront-models").IkasProductOption[];
|
|
3
|
+
export declare function initOptionValues(optionSet: IkasProductOptionSet): void;
|
|
4
|
+
export declare function hasValidValues(optionSet: IkasProductOptionSet): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"lodash/sortBy";import{initValues as r,hasValidValues as
|
|
1
|
+
import o from"lodash/sortBy";import{initValues as r,hasValidValues as t}from"./option/index.js";function i(r){return o(r.options.filter((o=>!o.requiredOptionId)),"order")}function n(o){o.options.forEach((o=>r(o)))}function e(o){return i(o).every(t)}export{i as getDisplayedOptions,e as hasValidValues,n as initOptionValues};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IkasProductOption } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getDisplayedChildOptions(option: IkasProductOption): IkasProductOption[];
|
|
3
|
-
export declare function hasValidValues(option: IkasProductOption): boolean;
|
|
4
|
-
export declare function setValues(option: IkasProductOption, values: string[]): void;
|
|
5
|
-
export declare function initValues(option: IkasProductOption): void;
|
|
1
|
+
import { IkasProductOption } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getDisplayedChildOptions(option: IkasProductOption): IkasProductOption[];
|
|
3
|
+
export declare function hasValidValues(option: IkasProductOption): boolean;
|
|
4
|
+
export declare function setValues(option: IkasProductOption, values: string[]): void;
|
|
5
|
+
export declare function initValues(option: IkasProductOption): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasProductOptionType as e}from"@ikas/storefront-models";import t from"lodash/sortBy";function n(n){return t(n.childOptions.filter((
|
|
1
|
+
import{IkasProductOptionType as e}from"@ikas/storefront-models";import t from"lodash/sortBy";function n(n){return t(n.childOptions.filter((t=>t.requiredOptionValueIds?.length?t.requiredOptionValueIds.some((e=>n.values.includes(e))):n.type===e.CHECKBOX?!!n.values.length&&"true"===n.values[0]:!!n.values.length)),"order")}function a(t){if(!t.values.length&&!t.isOptional)return!1;let i=!1;switch(t.type){case e.TEXT:case e.TEXT_AREA:i=function(e){const t=e.values.length?e.values[0]:null;if(!t)return!!e.isOptional;return!!e.textSettings&&(null===e.textSettings.min||t.length>=e.textSettings.min)&&(null===e.textSettings.max||t.length<=e.textSettings.max)}(t);break;case e.CHECKBOX:case e.COLOR_PICKER:i=!0;break;case e.CHOICE:i=function(e){if(!e.values.length)return!!e.isOptional;return!!e.selectSettings&&(null===e.selectSettings.minSelect||e.values.length>=e.selectSettings.minSelect)&&(null===e.selectSettings.maxSelect||e.values.length<=e.selectSettings.maxSelect)}(t);break;case e.DATE_PICKER:i=function(e){if(!e.values.length)return!!e.isOptional;if(e.dateSettings){let t=null,n=null;null!==e.dateSettings.minRelativeNextDate&&(t=new Date,t=e.dateSettings.minRelativeNextDate<0?new Date(t.setDate(t.getDate()-Math.abs(e.dateSettings.minRelativeNextDate))):new Date(t.setDate(t.getDate()+Math.abs(e.dateSettings.minRelativeNextDate))),t=new Date(t.setHours(23,59,0))),null!==e.dateSettings.maxRelativeNextDate&&(n=new Date,n=e.dateSettings.maxRelativeNextDate<0?new Date(n.setDate(n.getDate()-Math.abs(e.dateSettings.maxRelativeNextDate))):new Date(n.setDate(n.getDate()+Math.abs(e.dateSettings.maxRelativeNextDate))),n=new Date(n.setHours(23,59,59)));const a=new Date(new Date(e.values[0]).setHours(23,59,59));return(!t||a.getTime()>=t.getTime())&&(!n||a.getTime()<=n.getTime())}return!0}(t);break;case e.FILE:i=function(e){if(!e.values.length)return!!e.isOptional;return!!e.fileSettings&&(null===e.fileSettings.minQuantity||e.values.length>=e.fileSettings.minQuantity)&&(null===e.fileSettings.maxQuantity||e.values.length<=e.fileSettings.maxQuantity)}(t)}return i&&n(t).every((e=>a(e)))}function i(e,t){e.values=t,t.length||e.childOptions.forEach((e=>e.values=[]))}function l(e){e.isOptional||(e.values=[],e.childOptions&&e.childOptions.forEach((e=>l(e))))}export{n as getDisplayedChildOptions,a as hasValidValues,l as initValues,i as setValues};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasProductVariant } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getMainImage(variant: IkasProductVariant): import("@ikas/storefront-models").IkasProductImage | undefined;
|
|
3
|
-
export declare function hasStock(variant: IkasProductVariant): boolean;
|
|
1
|
+
import { IkasProductVariant } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getMainImage(variant: IkasProductVariant): import("@ikas/storefront-models").IkasProductImage | undefined;
|
|
3
|
+
export declare function hasStock(variant: IkasProductVariant): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){
|
|
1
|
+
function t(t){return t.images?.length?t.images[0]:void 0}function e(t){return t.stock>0||t.sellIfOutOfStock}export{t as getMainImage,e as hasStock};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IkasProductPrice } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getFinalPrice(price: IkasProductPrice): number;
|
|
3
|
-
export declare function hasDiscount(price: IkasProductPrice): boolean;
|
|
4
|
-
export declare function getDiscountAmount(price: IkasProductPrice): number;
|
|
5
|
-
export declare function getDiscountPercentage(price: IkasProductPrice): string | 0;
|
|
1
|
+
import { IkasProductPrice } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getFinalPrice(price: IkasProductPrice): number;
|
|
3
|
+
export declare function hasDiscount(price: IkasProductPrice): boolean;
|
|
4
|
+
export declare function getDiscountAmount(price: IkasProductPrice): number;
|
|
5
|
+
export declare function getDiscountPercentage(price: IkasProductPrice): string | 0;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IkasRaffle } from "@ikas/storefront-models";
|
|
2
|
-
export declare function isRaffleAvailable(raffle: IkasRaffle): boolean | 0 | null | undefined;
|
|
1
|
+
import { IkasRaffle } from "@ikas/storefront-models";
|
|
2
|
+
export declare function isRaffleAvailable(raffle: IkasRaffle): boolean | 0 | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){
|
|
1
|
+
function t(t){if(!t.status)return!1;const e=Date.now();return t.dateRange?.start&&e>t.dateRange.start&&t.dateRange.end&&e<t.dateRange.end}export{t as isRaffleAvailable};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasVariantType } from "@ikas/storefront-models";
|
|
2
|
-
export declare function isColorSelection(variantType: IkasVariantType): boolean;
|
|
3
|
-
export declare function getIkasVariantTypeSlug(variantType: IkasVariantType): string;
|
|
1
|
+
import { IkasVariantType } from "@ikas/storefront-models";
|
|
2
|
+
export declare function isColorSelection(variantType: IkasVariantType): boolean;
|
|
3
|
+
export declare function getIkasVariantTypeSlug(variantType: IkasVariantType): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IkasImage, IkasVariantValue } from "@ikas/storefront-models";
|
|
2
|
-
export declare function getIkasVariantValueSlug(variantValue: IkasVariantValue): string;
|
|
3
|
-
export declare function getThumbnailImage(variantValue: IkasVariantValue): IkasImage | undefined;
|
|
1
|
+
import { IkasImage, IkasVariantValue } from "@ikas/storefront-models";
|
|
2
|
+
export declare function getIkasVariantValueSlug(variantValue: IkasVariantValue): string;
|
|
3
|
+
export declare function getThumbnailImage(variantValue: IkasVariantValue): IkasImage | undefined;
|
package/build/index.d.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import * as IkasBlogCategoryFunctions from "./functions/blog/category";
|
|
2
|
-
export { IkasBlogCategoryFunctions };
|
|
3
|
-
import * as IkasBlogFunctions from "./functions/blog";
|
|
4
|
-
export { IkasBlogFunctions };
|
|
5
|
-
import * as IkasBrandFunctions from "./functions/brand";
|
|
6
|
-
export { IkasBrandFunctions };
|
|
7
|
-
import * as IkasCategoryPathItemFunctions from "./functions/category/path-item";
|
|
8
|
-
export { IkasCategoryPathItemFunctions };
|
|
9
|
-
import * as IkasCategoryFunctions from "./functions/category";
|
|
10
|
-
export { IkasCategoryFunctions };
|
|
11
|
-
import * as IkasCheckoutFunctions from "./functions/checkout";
|
|
12
|
-
export { IkasCheckoutFunctions };
|
|
13
|
-
import * as IkasCustomerAddressFunctions from "./functions/customer/address";
|
|
14
|
-
export { IkasCustomerAddressFunctions };
|
|
15
|
-
import * as IkasCustomerAttributeFunctions from "./functions/customer/attribute";
|
|
16
|
-
export { IkasCustomerAttributeFunctions };
|
|
17
|
-
import * as IkasCustomerFunctions from "./functions/customer";
|
|
18
|
-
export { IkasCustomerFunctions };
|
|
19
|
-
import * as IkasFilterCategoryFunctions from "./functions/filter-category";
|
|
20
|
-
export { IkasFilterCategoryFunctions };
|
|
21
|
-
import * as IkasImageFunctions from "./functions/image";
|
|
22
|
-
export { IkasImageFunctions };
|
|
23
|
-
import * as IkasOrderAddressFunctions from "./functions/order/address";
|
|
24
|
-
export { IkasOrderAddressFunctions };
|
|
25
|
-
import * as IkasOrderLineItemVariantValueFunctions from "./functions/order/line-item/variant/value";
|
|
26
|
-
export { IkasOrderLineItemVariantValueFunctions };
|
|
27
|
-
import * as IkasOrderLineItemVariantFunctions from "./functions/order/line-item/variant";
|
|
28
|
-
export { IkasOrderLineItemVariantFunctions };
|
|
29
|
-
import * as IkasOrderLineItemFunctions from "./functions/order/line-item";
|
|
30
|
-
export { IkasOrderLineItemFunctions };
|
|
31
|
-
import * as IkasOrderFunctions from "./functions/order";
|
|
32
|
-
export { IkasOrderFunctions };
|
|
33
|
-
import * as IkasPaymentGatewayFunctions from "./functions/payment-gateway";
|
|
34
|
-
export { IkasPaymentGatewayFunctions };
|
|
35
|
-
import * as IkasProductAttributeValueFunctions from "./functions/product/attribute-value";
|
|
36
|
-
export { IkasProductAttributeValueFunctions };
|
|
37
|
-
import * as IkasProductFilterFunctions from "./functions/product/filter";
|
|
38
|
-
export { IkasProductFilterFunctions };
|
|
39
|
-
import * as IkasProductOptionFunctions from "./functions/product/option-set/option";
|
|
40
|
-
export { IkasProductOptionFunctions };
|
|
41
|
-
import * as IkasProductOptionSetFunctions from "./functions/product/option-set";
|
|
42
|
-
export { IkasProductOptionSetFunctions };
|
|
43
|
-
import * as IkasProductPriceFunctions from "./functions/product/variant/price";
|
|
44
|
-
export { IkasProductPriceFunctions };
|
|
45
|
-
import * as IkasProductVariantFunctions from "./functions/product/variant";
|
|
46
|
-
export { IkasProductVariantFunctions };
|
|
47
|
-
import * as IkasProductFunctions from "./functions/product";
|
|
48
|
-
export { IkasProductFunctions };
|
|
49
|
-
import * as IkasRaffleFunctions from "./functions/raffle";
|
|
50
|
-
export { IkasRaffleFunctions };
|
|
51
|
-
import * as IkasVariantValueFunctions from "./functions/variant-type/variant-value";
|
|
52
|
-
export { IkasVariantValueFunctions };
|
|
53
|
-
import * as IkasVariantTypeFunctions from "./functions/variant-type";
|
|
54
|
-
export { IkasVariantTypeFunctions };
|
|
1
|
+
import * as IkasBlogCategoryFunctions from "./functions/blog/category";
|
|
2
|
+
export { IkasBlogCategoryFunctions };
|
|
3
|
+
import * as IkasBlogFunctions from "./functions/blog";
|
|
4
|
+
export { IkasBlogFunctions };
|
|
5
|
+
import * as IkasBrandFunctions from "./functions/brand";
|
|
6
|
+
export { IkasBrandFunctions };
|
|
7
|
+
import * as IkasCategoryPathItemFunctions from "./functions/category/path-item";
|
|
8
|
+
export { IkasCategoryPathItemFunctions };
|
|
9
|
+
import * as IkasCategoryFunctions from "./functions/category";
|
|
10
|
+
export { IkasCategoryFunctions };
|
|
11
|
+
import * as IkasCheckoutFunctions from "./functions/checkout";
|
|
12
|
+
export { IkasCheckoutFunctions };
|
|
13
|
+
import * as IkasCustomerAddressFunctions from "./functions/customer/address";
|
|
14
|
+
export { IkasCustomerAddressFunctions };
|
|
15
|
+
import * as IkasCustomerAttributeFunctions from "./functions/customer/attribute";
|
|
16
|
+
export { IkasCustomerAttributeFunctions };
|
|
17
|
+
import * as IkasCustomerFunctions from "./functions/customer";
|
|
18
|
+
export { IkasCustomerFunctions };
|
|
19
|
+
import * as IkasFilterCategoryFunctions from "./functions/filter-category";
|
|
20
|
+
export { IkasFilterCategoryFunctions };
|
|
21
|
+
import * as IkasImageFunctions from "./functions/image";
|
|
22
|
+
export { IkasImageFunctions };
|
|
23
|
+
import * as IkasOrderAddressFunctions from "./functions/order/address";
|
|
24
|
+
export { IkasOrderAddressFunctions };
|
|
25
|
+
import * as IkasOrderLineItemVariantValueFunctions from "./functions/order/line-item/variant/value";
|
|
26
|
+
export { IkasOrderLineItemVariantValueFunctions };
|
|
27
|
+
import * as IkasOrderLineItemVariantFunctions from "./functions/order/line-item/variant";
|
|
28
|
+
export { IkasOrderLineItemVariantFunctions };
|
|
29
|
+
import * as IkasOrderLineItemFunctions from "./functions/order/line-item";
|
|
30
|
+
export { IkasOrderLineItemFunctions };
|
|
31
|
+
import * as IkasOrderFunctions from "./functions/order";
|
|
32
|
+
export { IkasOrderFunctions };
|
|
33
|
+
import * as IkasPaymentGatewayFunctions from "./functions/payment-gateway";
|
|
34
|
+
export { IkasPaymentGatewayFunctions };
|
|
35
|
+
import * as IkasProductAttributeValueFunctions from "./functions/product/attribute-value";
|
|
36
|
+
export { IkasProductAttributeValueFunctions };
|
|
37
|
+
import * as IkasProductFilterFunctions from "./functions/product/filter";
|
|
38
|
+
export { IkasProductFilterFunctions };
|
|
39
|
+
import * as IkasProductOptionFunctions from "./functions/product/option-set/option";
|
|
40
|
+
export { IkasProductOptionFunctions };
|
|
41
|
+
import * as IkasProductOptionSetFunctions from "./functions/product/option-set";
|
|
42
|
+
export { IkasProductOptionSetFunctions };
|
|
43
|
+
import * as IkasProductPriceFunctions from "./functions/product/variant/price";
|
|
44
|
+
export { IkasProductPriceFunctions };
|
|
45
|
+
import * as IkasProductVariantFunctions from "./functions/product/variant";
|
|
46
|
+
export { IkasProductVariantFunctions };
|
|
47
|
+
import * as IkasProductFunctions from "./functions/product";
|
|
48
|
+
export { IkasProductFunctions };
|
|
49
|
+
import * as IkasRaffleFunctions from "./functions/raffle";
|
|
50
|
+
export { IkasRaffleFunctions };
|
|
51
|
+
import * as IkasVariantValueFunctions from "./functions/variant-type/variant-value";
|
|
52
|
+
export { IkasVariantValueFunctions };
|
|
53
|
+
import * as IkasVariantTypeFunctions from "./functions/variant-type";
|
|
54
|
+
export { IkasVariantTypeFunctions };
|
package/build/utils/helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const validatePhoneNumber: (str: string) => boolean;
|
|
2
|
-
export declare const stringToSlug: (str: string) => string;
|
|
3
|
-
export declare function formatDate(date: Date): string;
|
|
4
|
-
export declare const validateEmail: (str: string) => boolean;
|
|
1
|
+
export declare const validatePhoneNumber: (str: string) => boolean;
|
|
2
|
+
export declare const stringToSlug: (str: string) => string;
|
|
3
|
+
export declare function formatDate(date: Date): string;
|
|
4
|
+
export declare const validateEmail: (str: string) => boolean;
|
package/build/utils/helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasStorefrontConfig as e}from"@ikas/storefront-config";
|
|
1
|
+
import{IkasStorefrontConfig as e}from"@ikas/storefront-config";const r=e=>/^\+?\d+$/.test(e),t=e=>{e=(e=e.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");const r="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;";for(let t=0,a=31;t<a;t++)e=e.replace(new RegExp(r.charAt(t),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(t));return e=e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")};function a(r){const t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},a=e.getCurrentLocale();function o(e){return!!new Intl.DateTimeFormat(e,{hour:"numeric"}).format(0).match(/\s/)}return"undefined"!=typeof navigator?t.hour12=o(navigator.language):t.hour12=o(a),new Intl.DateTimeFormat(a,t).format(r)}const o=e=>!(e.length>320)&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e);export{a as formatDate,t as stringToSlug,o as validateEmail,r as validatePhoneNumber};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront-model-functions",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.30",
|
|
4
4
|
"description": "Functions for ikas storefront models.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -12,29 +12,28 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"pack": "npm pack",
|
|
15
|
-
"release": "npm publish",
|
|
16
|
-
"build": "rm -rf build && rollup -c"
|
|
15
|
+
"release": "npm run build && npm publish",
|
|
16
|
+
"build": "npm install && rm -rf build && rollup -c --bundleConfigAsCjs"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ikas/storefront-config": "^5.0.0-beta.
|
|
20
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
21
|
-
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
22
|
-
"@rollup/plugin-commonjs": "^22.0.0",
|
|
23
|
-
"rollup-plugin-rename-node-modules": "^1.2.0",
|
|
19
|
+
"@ikas/storefront-config": "^5.0.0-beta.30",
|
|
20
|
+
"@ikas/storefront-models": "^5.0.0-beta.30",
|
|
24
21
|
"@types/lodash": "^4.14.182",
|
|
25
22
|
"prettier": "^2.2.1",
|
|
26
|
-
"rollup": "^
|
|
27
|
-
"rollup
|
|
28
|
-
"rollup-plugin-typescript2": "^0.
|
|
23
|
+
"rollup": "^4.5.1",
|
|
24
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
25
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
29
26
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
30
|
-
"
|
|
27
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
28
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
29
|
+
"typescript": "^5.1.6",
|
|
31
30
|
"ttypescript": "^1.5.12",
|
|
32
|
-
"typescript-transform-paths": "^
|
|
31
|
+
"typescript-transform-paths": "^3.4.6",
|
|
33
32
|
"lodash": "^4.17.21"
|
|
34
33
|
},
|
|
35
34
|
"peerDependencies": {
|
|
36
|
-
"@ikas/storefront-config": "^5.0.0-beta.
|
|
37
|
-
"@ikas/storefront-models": "^5.0.0-beta.
|
|
35
|
+
"@ikas/storefront-config": "^5.0.0-beta.30",
|
|
36
|
+
"@ikas/storefront-models": "^5.0.0-beta.30",
|
|
38
37
|
"lodash": "^4.17.21"
|
|
39
38
|
}
|
|
40
|
-
}
|
|
39
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r,t,e){if(e||2===arguments.length)for(var l,o=0,c=t.length;o<c;o++)!l&&o in t||(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return r.concat(l||Array.prototype.slice.call(t))}export{r as __spreadArray};
|