ingeniuscliq-core 0.0.12 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/core/commands/common/constants.js +10 -0
  2. package/core/commands/create-core-module.js +288 -0
  3. package/core/commands/create-module.js +288 -0
  4. package/core/commands/helpers/index.js +15 -0
  5. package/core/commands/helpers/strings.js +4 -0
  6. package/core/commands/rollback-core-module.js +195 -0
  7. package/core/commands/rollback-module.js +208 -0
  8. package/core/commands/templates/locale.js +14 -0
  9. package/core/commands/templates/service.js +12 -0
  10. package/core/commands/templates/type.js +10 -0
  11. package/dist/assets/index.d.ts +4 -0
  12. package/dist/classes/CoreBuilder.d.ts +3 -0
  13. package/dist/classes/index.d.ts +1 -0
  14. package/dist/components/customs/carousel/CustomCarousel.d.ts +7 -0
  15. package/dist/components/customs/carousel/CustomCarouselSection.d.ts +11 -0
  16. package/dist/components/customs/carousel/index.d.ts +2 -0
  17. package/dist/components/customs/form/CustomFormField.d.ts +12 -0
  18. package/dist/components/customs/form/FormInput.d.ts +16 -0
  19. package/dist/components/customs/form/FormTextArea.d.ts +9 -0
  20. package/dist/components/customs/form/FormWrapper.d.ts +8 -0
  21. package/dist/components/customs/form/index.d.ts +4 -0
  22. package/dist/components/customs/index.d.ts +6 -0
  23. package/dist/components/customs/logo/Logo.d.ts +6 -0
  24. package/dist/components/customs/pagination/CustomPagination.d.ts +7 -0
  25. package/dist/components/customs/select/CustomSelect.d.ts +10 -0
  26. package/dist/components/customs/spinner/Spinner.d.ts +7 -0
  27. package/dist/components/index.d.ts +3 -0
  28. package/dist/components/layouts/CoreBaseLayout.d.ts +9 -0
  29. package/dist/components/templates/CoreHomeLayout.d.ts +5 -0
  30. package/dist/components/templates/CorePreviewLayout.d.ts +2 -0
  31. package/dist/components/templates/partials/CoreFooter.d.ts +1 -0
  32. package/dist/components/templates/partials/CoreHeader.d.ts +6 -0
  33. package/dist/components/templates/partials/CoreMainSearch.d.ts +8 -0
  34. package/dist/components/templates/partials/CoreNavbar.d.ts +8 -0
  35. package/dist/components/templates/partials/CoreSubMenu.d.ts +6 -0
  36. package/dist/components/templates/partials/CoreSubMenuHeader.d.ts +7 -0
  37. package/dist/components/templates/partials/DynamicHeader.d.ts +7 -0
  38. package/dist/components/templates/partials/DynamicMain.d.ts +5 -0
  39. package/dist/components/ui/accordion.d.ts +7 -0
  40. package/dist/components/ui/alert-dialog.d.ts +14 -0
  41. package/dist/components/ui/alert.d.ts +9 -0
  42. package/dist/components/ui/avatar.d.ts +6 -0
  43. package/dist/components/ui/badge.d.ts +9 -0
  44. package/dist/components/ui/breadcrumb.d.ts +11 -0
  45. package/dist/components/ui/button.d.ts +10 -0
  46. package/dist/components/ui/calendar.d.ts +4 -0
  47. package/dist/components/ui/card.d.ts +9 -0
  48. package/dist/components/ui/carousel.d.ts +19 -0
  49. package/dist/components/ui/checkbox.d.ts +4 -0
  50. package/dist/components/ui/dialog.d.ts +15 -0
  51. package/dist/components/ui/drawer.d.ts +13 -0
  52. package/dist/components/ui/dropdown-menu.d.ts +25 -0
  53. package/dist/components/ui/form.d.ts +24 -0
  54. package/dist/components/ui/index.d.ts +34 -0
  55. package/dist/components/ui/input.d.ts +5 -0
  56. package/dist/components/ui/label.d.ts +4 -0
  57. package/dist/components/ui/navigation-menu.d.ts +14 -0
  58. package/dist/components/ui/pagination.d.ts +13 -0
  59. package/dist/components/ui/popover.d.ts +7 -0
  60. package/dist/components/ui/radio-group.d.ts +5 -0
  61. package/dist/components/ui/select.d.ts +15 -0
  62. package/dist/components/ui/separator.d.ts +4 -0
  63. package/dist/components/ui/sheet.d.ts +13 -0
  64. package/dist/components/ui/sidebar.d.ts +69 -0
  65. package/dist/components/ui/skeleton.d.ts +2 -0
  66. package/dist/components/ui/slider.d.ts +4 -0
  67. package/dist/components/ui/sonner.d.ts +3 -0
  68. package/dist/components/ui/stepper.d.ts +18 -0
  69. package/dist/components/ui/switch.d.ts +4 -0
  70. package/dist/components/ui/table.d.ts +10 -0
  71. package/dist/components/ui/tabs.d.ts +7 -0
  72. package/dist/components/ui/textarea.d.ts +3 -0
  73. package/dist/components/ui/tooltip.d.ts +7 -0
  74. package/dist/constants/index.d.ts +1 -0
  75. package/dist/constants/menu.d.ts +2 -0
  76. package/dist/helpers/axiosGlobal.d.ts +7 -0
  77. package/dist/helpers/index.d.ts +4 -0
  78. package/dist/helpers/strings.d.ts +1 -0
  79. package/dist/helpers/template.d.ts +3 -0
  80. package/dist/helpers/tenant.d.ts +3 -0
  81. package/dist/hooks/index.d.ts +3 -0
  82. package/dist/hooks/use-mobile.d.ts +1 -0
  83. package/dist/hooks/useI18n.d.ts +5 -0
  84. package/dist/hooks/useNotification.d.ts +6 -0
  85. package/dist/i18n/config.d.ts +130 -0
  86. package/dist/i18n/index.d.ts +1 -0
  87. package/dist/i18n/utils/loadModuleTranslations.d.ts +8 -0
  88. package/dist/index.css +1 -0
  89. package/dist/index.d.ts +9 -3
  90. package/dist/index.js +18852 -1490
  91. package/dist/lib/utils.d.ts +2 -0
  92. package/dist/modules/CoreAuth/components/layouts/partials/AuthDecorator.d.ts +1 -0
  93. package/dist/modules/CoreAuth/components/layouts/partials/AuthProfileDeleteAccountForm.d.ts +1 -0
  94. package/dist/modules/CoreAuth/components/layouts/partials/AuthProfileForm.d.ts +1 -0
  95. package/dist/modules/CoreAuth/components/layouts/partials/AuthProfileUpdatePassForm.d.ts +1 -0
  96. package/dist/modules/CoreAuth/components/layouts/partials/AuthUserMenu.d.ts +1 -0
  97. package/dist/modules/CoreAuth/constants/auth.d.ts +5 -0
  98. package/dist/modules/CoreAuth/hooks/useAuth.d.ts +18 -0
  99. package/dist/modules/CoreAuth/index.d.ts +1 -0
  100. package/dist/modules/CoreAuth/services/base.d.ts +23 -0
  101. package/dist/modules/CoreAuth/stores/authStore.d.ts +22 -0
  102. package/dist/modules/CoreAuth/types/CoreAuth.d.ts +25 -0
  103. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +30 -0
  104. package/dist/modules/CoreCustomization/index.d.ts +1 -0
  105. package/dist/modules/CoreCustomization/services/base.d.ts +10 -0
  106. package/dist/modules/CoreCustomization/types/CoreCustomization.d.ts +22 -0
  107. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts +23 -0
  108. package/dist/modules/CoreOrder/index.d.ts +1 -0
  109. package/dist/modules/CoreOrder/services/base.d.ts +7 -0
  110. package/dist/modules/CoreOrder/types/CoreOrder.d.ts +41 -0
  111. package/dist/modules/CoreOrder/types/interfaces/OrderActions.d.ts +14 -0
  112. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +23 -0
  113. package/dist/modules/CorePayForm/index.d.ts +1 -0
  114. package/dist/modules/CorePayForm/services/base.d.ts +7 -0
  115. package/dist/modules/CorePayForm/types/CorePayForm.d.ts +19 -0
  116. package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +25 -0
  117. package/dist/modules/CoreProduct/components/layouts/partials/TabHead.d.ts +6 -0
  118. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCard.d.ts +15 -0
  119. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCardActions.d.ts +18 -0
  120. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCartItemAsideCard.d.ts +7 -0
  121. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCartItemCard.d.ts +8 -0
  122. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCartSummaryCard.d.ts +7 -0
  123. package/dist/modules/CoreProduct/components/ui/cards/addons/WarrantyLabel.d.ts +10 -0
  124. package/dist/modules/CoreProduct/components/ui/cards/skeletons/CoreProductCardSkeleton.d.ts +5 -0
  125. package/dist/modules/CoreProduct/components/ui/cards/skeletons/CoreProductCartItemCardSkeleton.d.ts +1 -0
  126. package/dist/modules/CoreProduct/components/ui/cards/skeletons/index.d.ts +2 -0
  127. package/dist/modules/CoreProduct/components/ui/carousels/CoreProductImageCarousel.d.ts +8 -0
  128. package/dist/modules/CoreProduct/components/ui/containers/CoreProductGrid.d.ts +19 -0
  129. package/dist/modules/CoreProduct/index.d.ts +1 -0
  130. package/dist/modules/CoreProduct/services/base.d.ts +7 -0
  131. package/dist/modules/CoreProduct/types/CoreProduct.d.ts +33 -0
  132. package/dist/modules/CoreProduct/types/CoreProductCategory.d.ts +10 -0
  133. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +25 -0
  134. package/dist/modules/CoreShopCart/components/layouts/partials/CoreShopCartAside.d.ts +12 -0
  135. package/dist/modules/CoreShopCart/components/layouts/partials/CoreShopCartIcon.d.ts +7 -0
  136. package/dist/modules/CoreShopCart/components/ui/cards/CoreCartItemAsideCard.d.ts +9 -0
  137. package/dist/modules/CoreShopCart/components/ui/cards/skeletons/CoreCartItemAsideCardSkeleton.d.ts +4 -0
  138. package/dist/modules/CoreShopCart/components/ui/empty/EmptyCartItems.d.ts +1 -0
  139. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartHintTitle.d.ts +8 -0
  140. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartSubtotalText.d.ts +7 -0
  141. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartSummaryHead.d.ts +6 -0
  142. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartSummaryText.d.ts +7 -0
  143. package/dist/modules/CoreShopCart/constants/shopCart.d.ts +6 -0
  144. package/dist/modules/CoreShopCart/index.d.ts +1 -0
  145. package/dist/modules/CoreShopCart/services/base.d.ts +16 -0
  146. package/dist/modules/CoreShopCart/types/CoreShopCart.d.ts +32 -0
  147. package/dist/modules/CoreShopCart/types/interfaces/CartActions.d.ts +23 -0
  148. package/dist/modules/index.d.ts +0 -0
  149. package/dist/services/base.d.ts +38 -0
  150. package/dist/services/index.d.ts +1 -0
  151. package/dist/stores/customizationStore.d.ts +21 -0
  152. package/dist/stores/index.d.ts +1 -0
  153. package/dist/types/BaseStore.d.ts +7 -0
  154. package/dist/types/BaseType.d.ts +5 -0
  155. package/dist/types/CoreImage.d.ts +5 -0
  156. package/dist/types/CoreMenu.d.ts +6 -0
  157. package/dist/types/contracts/BaseApiResponse.d.ts +7 -0
  158. package/dist/types/contracts/BasePagination.d.ts +9 -0
  159. package/dist/types/contracts/index.d.ts +2 -0
  160. package/dist/types/index.d.ts +7 -0
  161. package/dist/types/interfaces/BaseImageType.d.ts +7 -0
  162. package/dist/types/interfaces/BaseSlugType.d.ts +3 -0
  163. package/dist/types/interfaces/BaseVisibleType.d.ts +3 -0
  164. package/dist/types/interfaces/index.d.ts +3 -0
  165. package/dist/types/ui/carousel.d.ts +5 -0
  166. package/dist/types/ui/index.d.ts +3 -0
  167. package/dist/types/ui/main.d.ts +8 -0
  168. package/dist/types/ui/template.d.ts +19 -0
  169. package/package.json +12 -3
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1 @@
1
+ export declare function AuthDecorator(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function AuthProfileDeleteAccountForm(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function AuthProfileForm(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function AuthProfileUpdatePassForm(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function AuthUserMenu(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const LOGIN_ROUTE = "/api/login";
2
+ export declare const REGISTER_ROUTE = "/api/register";
3
+ export declare const LOGOUT_ROUTE = "/api/logout";
4
+ export declare const REFRESH_TOKEN_ROUTE = "/api/refresh-token";
5
+ export declare const USER_ROUTE = "/api/user";
@@ -0,0 +1,18 @@
1
+ import { CoreLoginCredentials, CoreRegisterCredentials, CoreUser } from '../types/CoreAuth';
2
+ export declare function useAuth(): {
3
+ user: CoreUser | null;
4
+ token: string | null;
5
+ refreshToken: string | null;
6
+ isAuthenticated: boolean;
7
+ loading: boolean;
8
+ error: string | null;
9
+ getUser: () => Promise<any>;
10
+ login: <T extends CoreLoginCredentials>(credentials: T) => Promise<any>;
11
+ register: <T extends CoreRegisterCredentials>(credentials: T) => Promise<any>;
12
+ logout: () => Promise<void>;
13
+ refreshUserToken: () => Promise<any>;
14
+ updateUser: (userData: Partial<CoreUser>) => void;
15
+ setUser: (user: CoreUser | null) => void;
16
+ setError: (error: string | null) => void;
17
+ reset: () => void;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
+ import { CoreLoginCredentials, CoreRegisterCredentials } from '../types/CoreAuth';
3
+ interface CoreAuthRoutes {
4
+ login: string;
5
+ register: string;
6
+ logout: string;
7
+ refreshToken: string;
8
+ user: string;
9
+ }
10
+ /**
11
+ * Base class that can be extended by concrete services
12
+ */
13
+ export declare class CoreAuthBaseService {
14
+ private readonly api;
15
+ private readonly routes;
16
+ constructor(routes?: CoreAuthRoutes, api?: AxiosInstance);
17
+ getUser(): Promise<import('axios').AxiosResponse<any, any>>;
18
+ login<T extends CoreLoginCredentials>(credentials: T): Promise<import('axios').AxiosResponse<any, any>>;
19
+ register<T extends CoreRegisterCredentials>(credentials: T): Promise<import('axios').AxiosResponse<any, any>>;
20
+ logout(config?: AxiosRequestConfig): Promise<import('axios').AxiosResponse<any, any>>;
21
+ refreshToken(config?: AxiosRequestConfig): Promise<import('axios').AxiosResponse<any, any>>;
22
+ }
23
+ export {};
@@ -0,0 +1,22 @@
1
+ import { CoreAuthStore, CoreUser } from '../types/CoreAuth';
2
+ export declare const useAuthStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreAuthStore<CoreUser>>, "persist"> & {
3
+ persist: {
4
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreAuthStore<CoreUser>, {
5
+ user: CoreUser | null;
6
+ token: string | null;
7
+ refreshToken: string | null;
8
+ isAuthenticated: boolean;
9
+ }>>) => void;
10
+ clearStorage: () => void;
11
+ rehydrate: () => Promise<void> | void;
12
+ hasHydrated: () => boolean;
13
+ onHydrate: (fn: (state: CoreAuthStore<CoreUser>) => void) => () => void;
14
+ onFinishHydration: (fn: (state: CoreAuthStore<CoreUser>) => void) => () => void;
15
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreAuthStore<CoreUser>, {
16
+ user: CoreUser | null;
17
+ token: string | null;
18
+ refreshToken: string | null;
19
+ isAuthenticated: boolean;
20
+ }>>;
21
+ };
22
+ }>;
@@ -0,0 +1,25 @@
1
+ import { BaseStore } from '../../../types/BaseStore';
2
+ import { BaseType } from '../../../types/BaseType';
3
+ export interface CoreUser extends BaseType {
4
+ name?: string;
5
+ lastname?: string;
6
+ email: string;
7
+ phone?: string;
8
+ address?: string;
9
+ }
10
+ export interface CoreLoginCredentials {
11
+ email: string;
12
+ password: string;
13
+ }
14
+ export interface CoreRegisterCredentials extends CoreLoginCredentials {
15
+ name?: string;
16
+ }
17
+ export interface CoreAuthStore<T extends CoreUser> extends BaseStore {
18
+ user: T | null;
19
+ token: string | null;
20
+ refreshToken: string | null;
21
+ isAuthenticated: boolean;
22
+ setUser: (user: T | null) => void;
23
+ setToken: (token: string | null) => void;
24
+ setRefreshToken: (token: string | null) => void;
25
+ }
@@ -0,0 +1,30 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CoreDesignTemplateSettings, CoreDesignTemplateStyles } from '../../../types/ui/template';
3
+ import { CoreCustomizationStore } from '../types/CoreCustomization';
4
+ import { CoreCustomizationBaseService } from '../services/base';
5
+ export declare class CoreCustomizationBuilder implements CoreBuilder {
6
+ protected customizationService: CoreCustomizationBaseService;
7
+ protected initialState: Pick<CoreCustomizationStore, "template" | "components" | "styles" | "settings" | "loading" | "error">;
8
+ constructor(service?: CoreCustomizationBaseService, initialState?: any);
9
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreCustomizationStore>, "persist"> & {
10
+ persist: {
11
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreCustomizationStore, {
12
+ template: string | null;
13
+ components: string[] | null;
14
+ styles: CoreDesignTemplateStyles[] | null;
15
+ settings: CoreDesignTemplateSettings | null;
16
+ }>>) => void;
17
+ clearStorage: () => void;
18
+ rehydrate: () => Promise<void> | void;
19
+ hasHydrated: () => boolean;
20
+ onHydrate: (fn: (state: CoreCustomizationStore) => void) => () => void;
21
+ onFinishHydration: (fn: (state: CoreCustomizationStore) => void) => () => void;
22
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreCustomizationStore, {
23
+ template: string | null;
24
+ components: string[] | null;
25
+ styles: CoreDesignTemplateStyles[] | null;
26
+ settings: CoreDesignTemplateSettings | null;
27
+ }>>;
28
+ };
29
+ }>;
30
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { BaseService } from '../../../services/base';
2
+ import { BaseApiResponse } from '../../../types/contracts/BaseApiResponse';
3
+ import { CoreDesignTemplate } from '../../../types/ui/template';
4
+ /**
5
+ * Base class that can be extended by concrete services
6
+ */
7
+ export declare class CoreCustomizationBaseService extends BaseService {
8
+ constructor();
9
+ fetchTemplate(): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreDesignTemplate>, any>>;
10
+ }
@@ -0,0 +1,22 @@
1
+ import { BaseType } from '../../../types/BaseType';
2
+ import { BaseStore } from '../../../types/BaseStore';
3
+ import { CoreDesignTemplate, CoreDesignTemplateSettings, CoreDesignTemplateStyles } from '../../../types/ui/template';
4
+ /**
5
+ * CoreCustomization base type
6
+ */
7
+ export interface CoreCustomization extends BaseType {
8
+ template: string | null;
9
+ styles: CoreDesignTemplateStyles[] | null;
10
+ settings: CoreDesignTemplateSettings | null;
11
+ }
12
+ export interface CoreCustomizationStore extends BaseStore {
13
+ template: string | null;
14
+ components: string[] | null;
15
+ styles: CoreDesignTemplateStyles[] | null;
16
+ settings: CoreDesignTemplateSettings | null;
17
+ fetchTemplate: () => Promise<CoreDesignTemplate>;
18
+ setTemplate: (template: string) => void;
19
+ setComponents: (components: string[]) => void;
20
+ setStyles: (styles: CoreDesignTemplateStyles[]) => void;
21
+ setSettings: (settings: CoreDesignTemplateSettings) => void;
22
+ }
@@ -0,0 +1,23 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CoreOrderBaseService } from '../services/base';
3
+ import { CoreOrder, CoreOrderStore } from '../types/CoreOrder';
4
+ export declare class CoreOrderBuilder<T> implements CoreBuilder {
5
+ protected orderService: CoreOrderBaseService;
6
+ protected initialState: Pick<CoreOrderStore<T>, 'order'>;
7
+ constructor(orderService?: CoreOrderBaseService, initialState?: Pick<CoreOrderStore<T>, 'order'>);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreOrderStore<T>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreOrderStore<T>, {
11
+ order: CoreOrder<T>;
12
+ }>>) => void;
13
+ clearStorage: () => void;
14
+ rehydrate: () => Promise<void> | void;
15
+ hasHydrated: () => boolean;
16
+ onHydrate: (fn: (state: CoreOrderStore<T>) => void) => () => void;
17
+ onFinishHydration: (fn: (state: CoreOrderStore<T>) => void) => () => void;
18
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreOrderStore<T>, {
19
+ order: CoreOrder<T>;
20
+ }>>;
21
+ };
22
+ }>;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseService } from '../../../services/base';
2
+ /**
3
+ * Base class that can be extended by concrete services
4
+ */
5
+ export declare class CoreOrderBaseService extends BaseService {
6
+ constructor();
7
+ }
@@ -0,0 +1,41 @@
1
+ import { BaseType } from '../../../types/BaseType';
2
+ import { IOrderActions } from './interfaces/OrderActions';
3
+ /**
4
+ * CoreOrder base type
5
+ */
6
+ export interface CoreOrder<T> extends BaseType {
7
+ customer_name: string;
8
+ customer_email: string;
9
+ customer_phone: string;
10
+ customer_address: string;
11
+ note?: string;
12
+ order_number: string;
13
+ userable_type: string;
14
+ userable_id: number;
15
+ items_subtotal: number;
16
+ current_base_currency: string;
17
+ currency: string;
18
+ exchange_rate: number;
19
+ status: string;
20
+ base_total_amount_in_cents: number;
21
+ base_total_amount_formatted: string;
22
+ total_amount_in_cents: number;
23
+ total_amount_formatted: string;
24
+ status_name: string;
25
+ allowed_next_statuses: {
26
+ identifier: string;
27
+ name: string;
28
+ }[];
29
+ products: T[];
30
+ }
31
+ export interface CoreOrderStore<T> extends IOrderActions<T> {
32
+ order: CoreOrder<T>;
33
+ }
34
+ export interface CoreOrderForm extends BaseType {
35
+ customer_name: string;
36
+ customer_email: string;
37
+ customer_phone: string;
38
+ customer_address: string;
39
+ note?: string;
40
+ payform_id?: string;
41
+ }
@@ -0,0 +1,14 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { BaseApiResponse } from '../../../../types/contracts/BaseApiResponse';
3
+ import { CoreOrderForm, CoreOrder } from '../CoreOrder';
4
+ export interface IOrderActions<T> {
5
+ createOrder: (order: CoreOrderForm) => Promise<BaseApiResponse<CreateOrderResponse<CoreOrder<T>>>>;
6
+ fetchOrder: (order_id: string | number) => Promise<BaseApiResponse<CoreOrder<T>>>;
7
+ getOrder: () => CoreOrder<T>;
8
+ }
9
+ export interface IOrderActionsService<T> {
10
+ createOrder: (order: CoreOrderForm) => Promise<AxiosResponse<BaseApiResponse<CreateOrderResponse<CoreOrder<T>>>>>;
11
+ }
12
+ export interface CreateOrderResponse<T> {
13
+ order: T;
14
+ }
@@ -0,0 +1,23 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CorePayFormBaseService } from '../services/base';
3
+ import { CorePayForm, CorePayFormStore } from '../types/CorePayForm';
4
+ export declare class CorePayFormBuilder implements CoreBuilder {
5
+ protected payFormService: CorePayFormBaseService;
6
+ protected initialState: Pick<CorePayFormStore<CorePayForm>, "payForms" | "loading" | "error">;
7
+ constructor(service?: CorePayFormBaseService, initialState?: any);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CorePayFormStore<CorePayForm>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CorePayFormStore<CorePayForm>, {
11
+ payForms: import('../../..').BasePagination<CorePayForm> | null;
12
+ }>>) => void;
13
+ clearStorage: () => void;
14
+ rehydrate: () => Promise<void> | void;
15
+ hasHydrated: () => boolean;
16
+ onHydrate: (fn: (state: CorePayFormStore<CorePayForm>) => void) => () => void;
17
+ onFinishHydration: (fn: (state: CorePayFormStore<CorePayForm>) => void) => () => void;
18
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CorePayFormStore<CorePayForm>, {
19
+ payForms: import('../../..').BasePagination<CorePayForm> | null;
20
+ }>>;
21
+ };
22
+ }>;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseService } from '../../../services/base';
2
+ /**
3
+ * Base class that can be extended by concrete services
4
+ */
5
+ export declare class CorePayFormBaseService extends BaseService {
6
+ constructor();
7
+ }
@@ -0,0 +1,19 @@
1
+ import { BaseStore } from '../../../types/BaseStore';
2
+ import { BaseType } from '../../../types/BaseType';
3
+ import { BaseApiResponsePagination } from '../../../types/contracts/BaseApiResponse';
4
+ import { BasePagination } from '../../../types/contracts/BasePagination';
5
+ /**
6
+ * CorePayForm base type
7
+ */
8
+ export interface CorePayForm extends BaseType {
9
+ name: string;
10
+ icon: string;
11
+ description: string;
12
+ currencies: string[];
13
+ }
14
+ export interface CorePayFormStore<T extends CorePayForm> extends BaseStore {
15
+ payForms: BasePagination<T> | null;
16
+ setPayForms: (payForms: BasePagination<T> | null) => void;
17
+ getPayForms: () => BasePagination<T> | null;
18
+ fetchPayForms: (params?: Record<string, any>) => Promise<BaseApiResponsePagination<T>>;
19
+ }
@@ -0,0 +1,25 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CoreProductBaseService } from '../services/base';
3
+ import { CoreProduct, CoreProductStore } from '../types/CoreProduct';
4
+ export declare class CoreProductBuilder implements CoreBuilder {
5
+ protected productService: CoreProductBaseService;
6
+ protected initialState: Pick<CoreProductStore<CoreProduct>, "productDetails" | "products" | "loading" | "error">;
7
+ constructor(service?: CoreProductBaseService, initialState?: any);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreProductStore<CoreProduct>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
11
+ productDetails: CoreProduct | null;
12
+ products: import('../../..').BasePagination<CoreProduct> | null;
13
+ }>>) => void;
14
+ clearStorage: () => void;
15
+ rehydrate: () => Promise<void> | void;
16
+ hasHydrated: () => boolean;
17
+ onHydrate: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
18
+ onFinishHydration: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
19
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
20
+ productDetails: CoreProduct | null;
21
+ products: import('../../..').BasePagination<CoreProduct> | null;
22
+ }>>;
23
+ };
24
+ }>;
25
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui/main';
2
+ interface TabHeadProps extends BaseStyleProps {
3
+ readonly title: string;
4
+ }
5
+ export declare function TabHead({ title, className }: TabHeadProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ import { BaseStyleProps } from '../../../../../types/ui/main';
3
+ import { CoreProductCardActionsEvents } from './CoreProductCardActions';
4
+ interface CoreProductCardProps extends BaseStyleProps, Omit<CoreProductCardActionsEvents, 'onAddToCart'>, CoreProductCardEvents {
5
+ readonly product: CoreProduct;
6
+ readonly renderActions?: React.ReactNode;
7
+ readonly loadingAddToCart?: boolean;
8
+ readonly renderAddons?: React.ReactNode;
9
+ }
10
+ interface CoreProductCardEvents {
11
+ onClick: (product: CoreProduct) => void;
12
+ onAddToCart: (product: CoreProduct, quantity: number) => void;
13
+ }
14
+ export declare function CoreProductCard({ product, className, renderAddons, renderActions, loadingAddToCart, onUpdateQuantity, onAddToCart, onClick }: CoreProductCardProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,18 @@
1
+ import { BaseStyleProps, BaseVariantProps } from '../../../../../types/ui/main';
2
+ export interface CoreProductCardActionsProps extends BaseStyleProps, CoreProductCardActionsEvents, BaseVariantProps {
3
+ readonly disabledColor?: boolean;
4
+ readonly productQuantity?: number;
5
+ readonly minValue?: number;
6
+ readonly maxValue?: number;
7
+ readonly colorLoading?: string;
8
+ readonly loading?: boolean;
9
+ }
10
+ export interface CoreProductCardActionsEvents {
11
+ onUpdateQuantity?: (quantity: number) => void;
12
+ onAddToCart?: (quantity: number) => void;
13
+ onValidateUpdateQuantity?: () => boolean;
14
+ onValidateAddToCart?: () => boolean;
15
+ onErrorUpdateQuantity?: () => void;
16
+ onErrorAddToCart?: () => void;
17
+ }
18
+ export declare function CoreProductCardActions({ disabledColor, variant, productQuantity, minValue, maxValue, colorLoading, loading, className, onUpdateQuantity, onAddToCart, onValidateUpdateQuantity, onValidateAddToCart, onErrorAddToCart, onErrorUpdateQuantity }: CoreProductCardActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ interface CoreProductCartItemAsideCardProps<T extends CoreProduct> {
3
+ product: T;
4
+ quantity: number;
5
+ }
6
+ export declare function CoreProductCartItemAsideCard<T extends CoreProduct>({ product, quantity }: CoreProductCartItemAsideCardProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ interface CoreProductCartItemCardProps<T extends CoreProduct> {
3
+ product: T;
4
+ quantity: number;
5
+ actions: React.ReactNode;
6
+ }
7
+ export declare function CoreProductCartItemCard<T extends CoreProduct>({ product, actions, quantity }: CoreProductCartItemCardProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ import { BaseProps } from '../../../../../types/ui/main';
3
+ interface CoreProductCartSummaryCardProps<T extends CoreProduct> extends BaseProps {
4
+ product: T;
5
+ }
6
+ export declare function CoreProductCartSummaryCard<T extends CoreProduct>({ product, children, className }: CoreProductCartSummaryCardProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare enum SUPPORTED_WARRANTY_VARIANTS_ENUM {
2
+ primary = "primary",
3
+ secondary = "secondary"
4
+ }
5
+ export type SUPPORTED_WARRANTY_VARIANTS = keyof typeof SUPPORTED_WARRANTY_VARIANTS_ENUM;
6
+ export interface WarrantyLabelProps {
7
+ readonly warrantyText?: string;
8
+ readonly variant: SUPPORTED_WARRANTY_VARIANTS_ENUM;
9
+ }
10
+ export declare function WarrantyLabel({ warrantyText, variant }: WarrantyLabelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { BaseStyleProps } from '../../../../../../types/ui/main';
2
+ interface CoreProductCardSkeletonProps extends BaseStyleProps {
3
+ }
4
+ export declare function CoreProductCardSkeleton({ className }: CoreProductCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1 @@
1
+ export declare function CoreProductCartItemCardSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './CoreProductCardSkeleton';
2
+ export * from './CoreProductCartItemCardSkeleton';
@@ -0,0 +1,8 @@
1
+ import { BaseProps } from '../../../../../types/ui/main';
2
+ import { CoreImage } from '../../../../../types/CoreImage';
3
+ interface CoreProductImageCarouselProps<T extends CoreImage> extends BaseProps {
4
+ readonly renderAddons?: React.ReactNode;
5
+ readonly images: T[];
6
+ }
7
+ export declare function CoreProductImageCarousel<T extends CoreImage>({ className, renderAddons, images }: CoreProductImageCarouselProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui/main';
2
+ import { BasePagination } from '../../../../../types/contracts/BasePagination';
3
+ import { CoreProduct } from '../../../types/CoreProduct';
4
+ interface CoreProductGridProps<T extends CoreProduct> extends BaseStyleProps, CoreProductGridEvents<T> {
5
+ readonly products: BasePagination<T>;
6
+ readonly component?: React.ComponentType<any>;
7
+ readonly classNameItems?: string;
8
+ readonly loading?: boolean;
9
+ readonly skeleton?: React.ComponentType<any>;
10
+ readonly skeletonItems?: number;
11
+ readonly skeletonClassName?: string;
12
+ [key: string]: any;
13
+ }
14
+ interface CoreProductGridEvents<T extends CoreProduct> {
15
+ onItemClick?: (product: T) => void;
16
+ onPageChange?: (page: number) => void;
17
+ }
18
+ export declare function CoreProductGrid<T extends CoreProduct>({ products, onPageChange, component: Component, className, classNameItems, loading, skeleton: Skeleton, skeletonItems, skeletonClassName, onItemClick, ...props }: CoreProductGridProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseService } from '../../../services/base';
2
+ /**
3
+ * Base class that can be extended by concrete services
4
+ */
5
+ export declare class CoreProductBaseService extends BaseService {
6
+ constructor();
7
+ }
@@ -0,0 +1,33 @@
1
+ import { BasePagination } from '../../../types/contracts/BasePagination';
2
+ import { BaseStore } from '../../../types/BaseStore';
3
+ import { BaseType } from '../../../types/BaseType';
4
+ import { BaseImagesType } from '../../../types/interfaces/BaseImageType';
5
+ import { BaseSlugType } from '../../../types/interfaces/BaseSlugType';
6
+ import { BaseVisibleType } from '../../../types/interfaces/BaseVisibleType';
7
+ import { HasProductCategories } from './CoreProductCategory';
8
+ import { BaseApiResponse, BaseApiResponsePagination } from '../../../types/contracts/BaseApiResponse';
9
+ /**
10
+ * CoreProduct base type
11
+ */
12
+ export interface CoreProduct extends BaseType, BaseSlugType, BaseImagesType, BaseVisibleType, HasProductCategories {
13
+ name: string;
14
+ sku: string;
15
+ description: string;
16
+ regular_price: number;
17
+ sale_price: number;
18
+ handle_stock: boolean;
19
+ stock: number;
20
+ stock_for_sale: number;
21
+ unit_of_measurement: string;
22
+ short_description: string;
23
+ }
24
+ export interface CoreProductStore<T extends CoreProduct> extends BaseStore {
25
+ productDetails: T | null;
26
+ products: BasePagination<T> | null;
27
+ setProducts: (products: BasePagination<T> | null) => void;
28
+ setProductDetails: (product: T | null) => void;
29
+ fetchProducts: (params?: Record<string, any>) => Promise<BaseApiResponsePagination<T>>;
30
+ getProducts: () => BasePagination<T> | null;
31
+ getProductDetails: () => T | null;
32
+ fetchProductDetails: (id: string | number) => Promise<BaseApiResponse<T>>;
33
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseType } from '../../../types/BaseType';
2
+ export interface CoreProductCategory extends BaseType {
3
+ name: string;
4
+ }
5
+ export interface HasProductCategories {
6
+ categories?: CoreProductCategory[];
7
+ }
8
+ export interface HasProbablyProductCategories {
9
+ categories?: CoreProductCategory[];
10
+ }
@@ -0,0 +1,25 @@
1
+ import { CoreShopCartBaseService } from '../services/base';
2
+ import { CoreShopCartStore } from '../types/CoreShopCart';
3
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
4
+ export declare class CoreShopCartBuilder<T> implements CoreBuilder {
5
+ protected shopCartService: CoreShopCartBaseService<T>;
6
+ protected initialState: Pick<CoreShopCartStore<T>, 'cart' | 'cartItems'>;
7
+ constructor(service?: CoreShopCartBaseService<T>, initialState?: Pick<CoreShopCartStore<T>, 'cart' | 'cartItems'>);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreShopCartStore<T>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreShopCartStore<T>, {
11
+ cart: import('../types/CoreShopCart').CoreShopCart<T>;
12
+ cartItems: import('../types/CoreShopCart').CoreCartItem<T>[];
13
+ }>>) => void;
14
+ clearStorage: () => void;
15
+ rehydrate: () => Promise<void> | void;
16
+ hasHydrated: () => boolean;
17
+ onHydrate: (fn: (state: CoreShopCartStore<T>) => void) => () => void;
18
+ onFinishHydration: (fn: (state: CoreShopCartStore<T>) => void) => () => void;
19
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreShopCartStore<T>, {
20
+ cart: import('../types/CoreShopCart').CoreShopCart<T>;
21
+ cartItems: import('../types/CoreShopCart').CoreCartItem<T>[];
22
+ }>>;
23
+ };
24
+ }>;
25
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseProps } from '../../../../../types/ui/main';
2
+ interface CoreShopCartAsideProps extends CoreShopCartAsideEvents, BaseProps {
3
+ title: string;
4
+ containerClassName?: string;
5
+ renderTriggerAction?: React.ReactNode;
6
+ }
7
+ interface CoreShopCartAsideEvents {
8
+ onClose?: () => void;
9
+ onGoToCart?: () => void;
10
+ }
11
+ export declare function CoreShopCartAside({ title, className, containerClassName, children, onClose, onGoToCart, renderTriggerAction }: CoreShopCartAsideProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui/main';
2
+ interface CoreShopCartIconProps extends BaseStyleProps {
3
+ totalItems: number;
4
+ totalPrice: string;
5
+ }
6
+ export declare function CoreShopCartIcon({ totalItems, totalPrice, className }: CoreShopCartIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { BaseProps } from '../../../../../types/ui/main';
2
+ import { CoreCartItem } from '../../../types/CoreShopCart';
3
+ interface CoreCartItemAsideCartProps<T extends CoreCartItem<K>, K> extends BaseProps {
4
+ cartItem: T;
5
+ onAddToCart: (product_id: string | number, quantity: number) => void;
6
+ onRemoveFromCart: (product_id: string | number) => void;
7
+ }
8
+ export declare function CoreCartItemAsideCard<T extends CoreCartItem<K>, K>({ className, cartItem, children, onAddToCart, onRemoveFromCart }: CoreCartItemAsideCartProps<T, K>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ interface CoreCartItemAsideCardSkeletonProps extends React.PropsWithChildren {
2
+ }
3
+ export declare function CoreCartItemAsideCardSkeleton({ children }: CoreCartItemAsideCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
4
+ export {};