arkenstone-ui 0.0.17 → 0.0.19

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 (123) hide show
  1. package/dist/arkenstone-ui.es.js +11692 -188
  2. package/dist/arkenstone-ui.umd.js +112 -4
  3. package/dist/assets/style.css +1 -0
  4. package/dist/types/components/access-gate.d.ts +11 -0
  5. package/dist/types/components/arkestone.d.ts +27 -0
  6. package/dist/types/components/custom/breadcrumb.d.ts +7 -0
  7. package/dist/types/components/custom/button.d.ts +4 -0
  8. package/dist/types/components/custom/index.d.ts +8 -0
  9. package/dist/types/components/custom/input.d.ts +3 -0
  10. package/dist/types/components/custom/mode-toggle.d.ts +1 -0
  11. package/dist/types/components/custom/search.d.ts +23 -0
  12. package/dist/types/components/index.d.ts +2 -0
  13. package/dist/types/components/sidebar/app-sidebar.d.ts +3 -0
  14. package/dist/types/components/sidebar/nav-main.d.ts +14 -0
  15. package/dist/types/components/sidebar/nav-secondary.d.ts +10 -0
  16. package/dist/types/components/sidebar/nav-slot2.d.ts +15 -0
  17. package/dist/types/components/sidebar/nav-user.d.ts +21 -0
  18. package/dist/types/components/tables/default-table.d.ts +17 -0
  19. package/dist/types/components/ui/accordion.d.ts +7 -0
  20. package/dist/types/components/ui/alert.d.ts +9 -0
  21. package/dist/types/components/ui/avatar.d.ts +6 -0
  22. package/dist/types/components/ui/badge.d.ts +9 -0
  23. package/dist/types/components/ui/breadcrumb.d.ts +11 -0
  24. package/dist/types/components/ui/button.d.ts +10 -0
  25. package/dist/types/components/ui/calendar.d.ts +8 -0
  26. package/dist/types/components/ui/card.d.ts +8 -0
  27. package/dist/types/components/ui/chart.d.ts +40 -0
  28. package/dist/types/components/ui/checkbox.d.ts +4 -0
  29. package/dist/types/components/ui/collapsible.d.ts +5 -0
  30. package/dist/types/components/ui/dialog.d.ts +13 -0
  31. package/dist/types/components/ui/dropdown-menu.d.ts +25 -0
  32. package/dist/types/components/ui/form.d.ts +24 -0
  33. package/dist/types/components/ui/hover-card.d.ts +6 -0
  34. package/dist/types/components/ui/icon.d.ts +7 -0
  35. package/dist/types/components/ui/input.d.ts +3 -0
  36. package/dist/types/components/ui/label.d.ts +4 -0
  37. package/dist/types/components/ui/navigation-menu.d.ts +14 -0
  38. package/dist/types/components/ui/placeholder-pattern.d.ts +5 -0
  39. package/dist/types/components/ui/popover.d.ts +6 -0
  40. package/dist/types/components/ui/scroll-area.d.ts +5 -0
  41. package/dist/types/components/ui/select.d.ts +15 -0
  42. package/dist/types/components/ui/separator.d.ts +4 -0
  43. package/dist/types/components/ui/sheet.d.ts +13 -0
  44. package/dist/types/components/ui/sidebar.d.ts +70 -0
  45. package/dist/types/components/ui/skeleton.d.ts +2 -0
  46. package/dist/types/components/ui/sonner.d.ts +3 -0
  47. package/dist/types/components/ui/table.d.ts +10 -0
  48. package/dist/types/components/ui/tabs.d.ts +7 -0
  49. package/dist/types/components/ui/toggle-group.d.ts +7 -0
  50. package/dist/types/components/ui/toggle.d.ts +9 -0
  51. package/dist/types/components/ui/tooltip.d.ts +7 -0
  52. package/dist/types/components/workspace/workspace.d.ts +1 -0
  53. package/dist/types/config/config.d.ts +41 -0
  54. package/dist/types/e-commerce/index.d.ts +1 -0
  55. package/dist/types/e-commerce/product/components/catelog/components/category-filter.d.ts +14 -0
  56. package/dist/types/e-commerce/product/components/catelog/components/filter.d.ts +60 -0
  57. package/dist/types/e-commerce/product/components/catelog/components/index.d.ts +6 -0
  58. package/dist/types/e-commerce/product/components/catelog/components/listing-controls.d.ts +12 -0
  59. package/dist/types/e-commerce/product/components/catelog/components/pagination.d.ts +37 -0
  60. package/dist/types/e-commerce/product/components/catelog/components/sort-bar.d.ts +33 -0
  61. package/dist/types/e-commerce/product/components/catelog/components/view-mode.d.ts +22 -0
  62. package/dist/types/e-commerce/product/components/catelog/index.d.ts +3 -0
  63. package/dist/types/e-commerce/product/components/catelog/layouts/catelog-content-layout.d.ts +9 -0
  64. package/dist/types/e-commerce/product/components/catelog/layouts/index.d.ts +2 -0
  65. package/dist/types/e-commerce/product/components/catelog/layouts/listings-layout.d.ts +13 -0
  66. package/dist/types/e-commerce/product/components/catelog/pages/default-catelog.d.ts +1 -0
  67. package/dist/types/e-commerce/product/components/catelog/pages/index.d.ts +1 -0
  68. package/dist/types/e-commerce/product/components/index.d.ts +2 -0
  69. package/dist/types/e-commerce/product/components/product-card/components/add-to-cart-button.d.ts +19 -0
  70. package/dist/types/e-commerce/product/components/product-card/components/brand-title.d.ts +16 -0
  71. package/dist/types/e-commerce/product/components/product-card/components/categories.d.ts +19 -0
  72. package/dist/types/e-commerce/product/components/product-card/components/discount-badge.d.ts +13 -0
  73. package/dist/types/e-commerce/product/components/product-card/components/index.d.ts +8 -0
  74. package/dist/types/e-commerce/product/components/product-card/components/price-card.d.ts +21 -0
  75. package/dist/types/e-commerce/product/components/product-card/components/product-image.d.ts +15 -0
  76. package/dist/types/e-commerce/product/components/product-card/components/view-details-button.d.ts +8 -0
  77. package/dist/types/e-commerce/product/components/product-card/components/wishlist-button.d.ts +15 -0
  78. package/dist/types/e-commerce/product/components/product-card/index.d.ts +4 -0
  79. package/dist/types/e-commerce/product/components/product-card/layouts/index.d.ts +2 -0
  80. package/dist/types/e-commerce/product/components/product-card/layouts/product-card-image-layout.d.ts +35 -0
  81. package/dist/types/e-commerce/product/components/product-card/layouts/product-card-layout.d.ts +16 -0
  82. package/dist/types/e-commerce/product/components/product-card/page/index.d.ts +1 -0
  83. package/dist/types/e-commerce/product/components/product-card/page/product-card-listing.d.ts +2 -0
  84. package/dist/types/e-commerce/product/components/product-card/product-card.d.ts +16 -0
  85. package/dist/types/e-commerce/product/index.d.ts +3 -0
  86. package/dist/types/e-commerce/product/service/brand-service.d.ts +67 -0
  87. package/dist/types/e-commerce/product/service/category-service.d.ts +68 -0
  88. package/dist/types/e-commerce/product/service/index.d.ts +7 -0
  89. package/dist/types/e-commerce/product/service/product-image-service.d.ts +44 -0
  90. package/dist/types/e-commerce/product/service/product-service.d.ts +67 -0
  91. package/dist/types/e-commerce/product/service/product-taxonomy-service.d.ts +49 -0
  92. package/dist/types/e-commerce/product/service/taxonomy-service.d.ts +69 -0
  93. package/dist/types/e-commerce/product/service/taxonomy-type-service.d.ts +68 -0
  94. package/dist/types/e-commerce/product/types/index.d.ts +87 -0
  95. package/dist/types/hooks/api.d.ts +16 -0
  96. package/dist/types/hooks/index.d.ts +1 -0
  97. package/dist/types/hooks/use-access.d.ts +7 -0
  98. package/dist/types/hooks/use-mobile.d.ts +1 -0
  99. package/dist/types/index.d.ts +7 -3
  100. package/dist/types/layouts/index.d.ts +0 -0
  101. package/dist/types/layouts/panels/default-panel-layout.d.ts +5 -0
  102. package/dist/types/lib/utils.d.ts +2 -0
  103. package/dist/types/provider/index.d.ts +1 -0
  104. package/dist/types/provider/theme-provider.d.ts +13 -0
  105. package/dist/types/services/planet-service.d.ts +20 -0
  106. package/dist/types/services/service-factory.d.ts +96 -0
  107. package/dist/types/stores/acl.store.d.ts +8 -0
  108. package/dist/types/stores/config.store.d.ts +11 -0
  109. package/dist/types/stores/index.d.ts +4 -0
  110. package/dist/types/stores/store-factory.d.ts +17 -0
  111. package/dist/types/stores/useStore.d.ts +43 -0
  112. package/dist/types/types/acl.d.ts +38 -0
  113. package/dist/types/types/config.d.ts +17 -0
  114. package/dist/types/types/index.d.ts +2 -0
  115. package/dist/types/util/currency-code/currency-symbols.json.d.ts +17 -0
  116. package/dist/types/util/currency-code/index.d.ts +6 -0
  117. package/dist/types/util/index.d.ts +2 -0
  118. package/dist/types/util/text-filter.d.ts +6 -0
  119. package/package.json +38 -2
  120. package/dist/style.css +0 -1
  121. package/dist/types/components/button.d.ts +0 -5
  122. package/dist/types/components/janith-nirmal.d.ts +0 -3
  123. package/dist/types/pages/home.d.ts +0 -1
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ export interface PriceCardProps {
3
+ price: number | null;
4
+ salePrice: number | null;
5
+ discountType?: string | null;
6
+ discountValue?: number | null;
7
+ /** Visibility */
8
+ showOriginalPrice?: boolean;
9
+ showDiscountPercentage?: boolean;
10
+ /** Currency options */
11
+ currency?: string;
12
+ fractionDigits?: number;
13
+ /** Styles */
14
+ className?: {
15
+ wrapper?: string;
16
+ price?: string;
17
+ originalPrice?: string;
18
+ discount?: string;
19
+ };
20
+ }
21
+ export declare const PriceCard: React.FC<PriceCardProps>;
@@ -0,0 +1,15 @@
1
+ export interface ProductImageProps {
2
+ imageUrl?: string | null;
3
+ alt?: string;
4
+ /** "bg" uses background-image, "img" uses an <img> */
5
+ mode?: "bg" | "img";
6
+ height?: number | string;
7
+ children?: React.ReactNode;
8
+ onClick?: React.MouseEventHandler;
9
+ className?: {
10
+ wrapper?: string;
11
+ image?: string;
12
+ overlay?: string;
13
+ };
14
+ }
15
+ export default function ProductImage({ imageUrl, alt, mode, height, className, children, onClick, }: ProductImageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export interface ViewDetailsButtonProps {
2
+ /** Called when the button is clicked */
3
+ onClick?: () => void;
4
+ label?: string;
5
+ disabled?: boolean;
6
+ className?: string;
7
+ }
8
+ export declare function ViewDetailsButton({ onClick, label, disabled, className, }: ViewDetailsButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ export interface WishlistButtonProps {
3
+ isWishlisted?: boolean;
4
+ onToggle?: (value: boolean) => void;
5
+ icon?: React.ReactNode;
6
+ activeIcon?: React.ReactNode;
7
+ ariaLabel?: string;
8
+ size?: number;
9
+ className?: {
10
+ button?: string;
11
+ icon?: string;
12
+ };
13
+ animationDuration?: number;
14
+ }
15
+ export declare function WishlistButton({ isWishlisted, onToggle, icon, activeIcon, ariaLabel, size, className, animationDuration, }: WishlistButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export * from './components';
2
+ export * from './layouts';
3
+ export * from './page';
4
+ export * from './product-card';
@@ -0,0 +1,2 @@
1
+ export * from './product-card-image-layout';
2
+ export * from './product-card-layout';
@@ -0,0 +1,35 @@
1
+ import { default as React } from 'react';
2
+ export interface ProductImageLayoutProps {
3
+ imageUrl?: string;
4
+ imageAlt?: string;
5
+ width?: string | number;
6
+ height?: string | number;
7
+ background?: React.ReactNode;
8
+ className?: {
9
+ container?: string;
10
+ image?: string;
11
+ overlay?: string;
12
+ corner?: string;
13
+ center?: string;
14
+ background?: string;
15
+ backgroundWrapper?: string;
16
+ };
17
+ topLeft?: React.ReactNode;
18
+ topRight?: React.ReactNode;
19
+ bottomLeft?: React.ReactNode;
20
+ bottomRight?: React.ReactNode;
21
+ center?: React.ReactNode;
22
+ topPlaceholder?: React.ReactNode;
23
+ bottomPlaceholder?: React.ReactNode;
24
+ placeholderClassName?: {
25
+ top?: string;
26
+ bottom?: string;
27
+ };
28
+ }
29
+ /**
30
+ * DefaultProductImage
31
+ * - Renders an image as a background (cover)
32
+ * - Provides 4 corner slots + center slot where you can place components (wishlist, discount badge, brand, price, view details)
33
+ * - Fully customizable via className props and by passing custom nodes
34
+ */
35
+ export declare function ProductImageLayout({ imageUrl, imageAlt, width, height, background, className, topLeft, topRight, bottomLeft, bottomRight, center, topPlaceholder, bottomPlaceholder, placeholderClassName, }: ProductImageLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ export type ProductLayoutType = "compact" | "detailed";
3
+ export interface ProductCardLayoutProps {
4
+ layout?: ProductLayoutType;
5
+ ImageComponent: React.ReactNode;
6
+ DetailsComponent: React.ReactNode;
7
+ /** granular class overrides */
8
+ className?: {
9
+ container?: string;
10
+ compactWrapper?: string;
11
+ detailedWrapper?: string;
12
+ imageContainer?: string;
13
+ detailsContainer?: string;
14
+ };
15
+ }
16
+ export declare function ProductCardLayout({ layout, ImageComponent, DetailsComponent, className, }: ProductCardLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './product-card-listing';
@@ -0,0 +1,2 @@
1
+ export declare function ProductCardListing(): import("react/jsx-runtime").JSX.Element;
2
+ export default ProductCardListing;
@@ -0,0 +1,16 @@
1
+ import { Product } from '../../types';
2
+ export interface ProductCardProps {
3
+ product: Product;
4
+ layout?: "compact" | "detailed";
5
+ showWishlist?: boolean;
6
+ showDiscount?: boolean;
7
+ showViewDetails?: boolean;
8
+ showBrand?: boolean;
9
+ showPrice?: boolean;
10
+ onToggleWishlist?: (productId: number, wishlisted: boolean) => void;
11
+ onViewDetails?: (productId: number) => void;
12
+ onAddToCart?: (productId: number) => void;
13
+ containerClassName?: string;
14
+ imageHeight?: number | string;
15
+ }
16
+ export declare function ProductCard({ product, layout, showWishlist, showDiscount, showViewDetails, showBrand, showPrice, containerClassName, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './service';
3
+ export * from './types';
@@ -0,0 +1,67 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { Brand } from '../types';
3
+ /**
4
+ * Defines the structure of a Brand object.
5
+ * Customize these properties to match your application's data model.
6
+ */
7
+ export interface ServiceTypeBrand extends Brand {
8
+ }
9
+ /**
10
+ * Defines the payload for creating a new brand.
11
+ * It omits server-generated fields like `id`.
12
+ */
13
+ export type BrandCreationPayload = Omit<ServiceTypeBrand, 'id'>;
14
+ /**
15
+ * Defines the payload for updating an existing brand.
16
+ * All fields are optional to allow for partial updates.
17
+ */
18
+ export type BrandUpdatePayload = Partial<BrandCreationPayload>;
19
+ /**
20
+ * Defines the available query parameters for fetching a list of brands.
21
+ * This is useful for implementing features like pagination, sorting, and searching.
22
+ */
23
+ export type BrandListQuery = {
24
+ page?: number;
25
+ per_page?: number;
26
+ sort_by?: keyof Brand;
27
+ sort_order?: 'asc' | 'desc';
28
+ search?: string;
29
+ };
30
+ export declare const brandService: {
31
+ /**
32
+ * Fetches a paginated and filterable list of brands.
33
+ * @param {BrandListQuery} params - Query parameters for filtering and pagination.
34
+ * @param {ApiOptions} options - Custom options for the API request.
35
+ * @returns {Promise<Brand[]>} A promise that resolves to an array of brands.
36
+ */
37
+ getBrands(params?: BrandListQuery, options?: ApiOptions): Promise<Brand[]>;
38
+ /**
39
+ * Fetches a single brand by its unique identifier.
40
+ * @param {string | number} id - The ID of the brand.
41
+ * @param {ApiOptions} options - Custom options for the API request.
42
+ * @returns {Promise<Brand>} A promise that resolves to the requested brand.
43
+ */
44
+ getBrandById(id: string | number, options?: ApiOptions): Promise<Brand>;
45
+ /**
46
+ * Creates a new brand.
47
+ * @param {BrandCreationPayload} brandData - The data for the new brand.
48
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
49
+ * @returns {Promise<Brand>} A promise that resolves to the newly created brand.
50
+ */
51
+ createBrand(brandData: BrandCreationPayload, options?: ApiOptions): Promise<Brand>;
52
+ /**
53
+ * Updates an existing brand's information.
54
+ * @param {string | number} id - The ID of the brand to update.
55
+ * @param {BrandUpdatePayload} brandData - The data to update.
56
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
57
+ * @returns {Promise<Brand>} A promise that resolves to the updated brand.
58
+ */
59
+ updateBrand(id: string | number, brandData: BrandUpdatePayload, options?: ApiOptions): Promise<Brand>;
60
+ /**
61
+ * Deletes a brand.
62
+ * @param {string | number} id - The ID of the brand to delete.
63
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
64
+ * @returns {Promise<void>} A promise that resolves when the deletion is successful.
65
+ */
66
+ deleteBrand(id: string | number, options?: ApiOptions): Promise<void>;
67
+ };
@@ -0,0 +1,68 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { Category } from '../types';
3
+ /**
4
+ * Defines the structure of a Category object.
5
+ * Customize these properties to match your application's data model.
6
+ */
7
+ export interface ServiceTypeCategory extends Category {
8
+ }
9
+ /**
10
+ * Defines the payload for creating a new category.
11
+ * It omits server-generated fields like `id` and `children`.
12
+ */
13
+ export type CategoryCreationPayload = Omit<ServiceTypeCategory, 'id' | 'children'>;
14
+ /**
15
+ * Defines the payload for updating an existing category.
16
+ * All fields are optional to allow for partial updates.
17
+ */
18
+ export type CategoryUpdatePayload = Partial<CategoryCreationPayload>;
19
+ /**
20
+ * Defines the available query parameters for fetching a list of categories.
21
+ * This is useful for implementing features like pagination, sorting, and searching.
22
+ */
23
+ export type CategoryListQuery = {
24
+ page?: number;
25
+ per_page?: number;
26
+ sort_by?: keyof Category;
27
+ sort_order?: 'asc' | 'desc';
28
+ search?: string;
29
+ parent_id?: number | null;
30
+ };
31
+ export declare const categoryService: {
32
+ /**
33
+ * Fetches a hierarchical list of categories.
34
+ * @param {CategoryListQuery} params - Query parameters for filtering and pagination.
35
+ * @param {ApiOptions} options - Custom options for the API request.
36
+ * @returns {Promise<Category[]>} A promise that resolves to an array of categories with nested children.
37
+ */
38
+ getCategories(params?: CategoryListQuery, options?: ApiOptions): Promise<Category[]>;
39
+ /**
40
+ * Fetches a single category by its unique identifier.
41
+ * @param {string | number} id - The ID of the category.
42
+ * @param {ApiOptions} options - Custom options for the API request.
43
+ * @returns {Promise<Category>} A promise that resolves to the requested category.
44
+ */
45
+ getCategoryById(id: string | number, options?: ApiOptions): Promise<Category>;
46
+ /**
47
+ * Creates a new category.
48
+ * @param {CategoryCreationPayload} categoryData - The data for the new category.
49
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
50
+ * @returns {Promise<Category>} A promise that resolves to the newly created category.
51
+ */
52
+ createCategory(categoryData: CategoryCreationPayload, options?: ApiOptions): Promise<Category>;
53
+ /**
54
+ * Updates an existing category's information.
55
+ * @param {string | number} id - The ID of the category to update.
56
+ * @param {CategoryUpdatePayload} categoryData - The data to update.
57
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
58
+ * @returns {Promise<Category>} A promise that resolves to the updated category.
59
+ */
60
+ updateCategory(id: string | number, categoryData: CategoryUpdatePayload, options?: ApiOptions): Promise<Category>;
61
+ /**
62
+ * Deletes a category.
63
+ * @param {string | number} id - The ID of the category to delete.
64
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
65
+ * @returns {Promise<void>} A promise that resolves when the deletion is successful.
66
+ */
67
+ deleteCategory(id: string | number, options?: ApiOptions): Promise<void>;
68
+ };
@@ -0,0 +1,7 @@
1
+ export * from './brand-service';
2
+ export * from './category-service';
3
+ export * from './product-image-service';
4
+ export * from './product-service';
5
+ export * from './product-taxonomy-service';
6
+ export * from './taxonomy-service';
7
+ export * from './taxonomy-type-service';
@@ -0,0 +1,44 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { ProductImage } from '../types';
3
+ /**
4
+ * Defines the structure of a ProductImage object.
5
+ * Customize these properties to match your application's data model.
6
+ */
7
+ export interface ServiceTypeProductImage extends ProductImage {
8
+ }
9
+ /**
10
+ * Defines the payload for creating a new product image.
11
+ * It omits server-generated fields.
12
+ */
13
+ export type ProductImageCreationPayload = Omit<ServiceTypeProductImage, 'product_id' | 'url' | 'order'> & {
14
+ image: File;
15
+ };
16
+ /**
17
+ * Defines the payload for updating an existing product image.
18
+ * All fields are optional to allow for partial updates.
19
+ */
20
+ export type ProductImageUpdatePayload = Partial<Omit<ServiceTypeProductImage, 'product_id' | 'url'>>;
21
+ /**
22
+ * Defines the available query parameters for fetching a list of product images.
23
+ * This is useful for implementing features like filtering and searching.
24
+ */
25
+ export type ProductImageListQuery = {
26
+ product_id?: number;
27
+ is_primary?: boolean;
28
+ };
29
+ export declare const productImageService: {
30
+ /**
31
+ * Uploads a new product image.
32
+ * @param {File} image - The image file to upload.
33
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
34
+ * @returns {Promise<ProductImage>} A promise that resolves to the newly uploaded product image.
35
+ */
36
+ uploadImage(image: File, options?: ApiOptions): Promise<ProductImage>;
37
+ /**
38
+ * Deletes a product image.
39
+ * @param {number} imageId - The ID of the product image to delete.
40
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
41
+ * @returns {Promise<void>} A promise that resolves when the deletion is successful.
42
+ */
43
+ deleteImage(imageId: number, options?: ApiOptions): Promise<void>;
44
+ };
@@ -0,0 +1,67 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { Product } from '../types';
3
+ /**
4
+ * Defines the structure of a Product object.
5
+ * Customize these properties to match your application's data model.
6
+ */
7
+ export interface ServiceTypeProduct extends Product {
8
+ }
9
+ /**
10
+ * Defines the payload for creating a new product.
11
+ * It omits server-generated fields like `id`, `created_at`, and `updated_at`.
12
+ */
13
+ export type ProductCreationPayload = Omit<ServiceTypeProduct, 'id' | 'created_at' | 'updated_at'>;
14
+ /**
15
+ * Defines the payload for updating an existing product.
16
+ * All fields are optional to allow for partial updates.
17
+ */
18
+ export type ProductUpdatePayload = Partial<ProductCreationPayload>;
19
+ /**
20
+ * Defines the available query parameters for fetching a list of products.
21
+ * This is useful for implementing features like pagination, sorting, and searching.
22
+ */
23
+ export interface ProductListQuery {
24
+ page?: number;
25
+ per_page?: number;
26
+ sort_by?: keyof Product;
27
+ sort_order?: 'asc' | 'desc';
28
+ search?: string;
29
+ }
30
+ export declare const productService: {
31
+ /**
32
+ * Fetches a paginated and filterable list of products.
33
+ * @param {ProductListQuery} params - Query parameters for filtering and pagination.
34
+ * @param {ApiOptions} options - Custom options for the API request.
35
+ * @returns {Promise<Product[]>} A promise that resolves to an array of products.
36
+ */
37
+ getProducts(params?: ProductListQuery, options?: ApiOptions): Promise<Product[]>;
38
+ /**
39
+ * Fetches a single product by its unique identifier.
40
+ * @param {string | number} id - The ID of the product.
41
+ * @param {ApiOptions} options - Custom options for the API request.
42
+ * @returns {Promise<Product>} A promise that resolves to the requested product.
43
+ */
44
+ getProductById(id: string | number, options?: ApiOptions): Promise<Product>;
45
+ /**
46
+ * Creates a new product.
47
+ * @param {ProductCreationPayload} productData - The data for the new product.
48
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
49
+ * @returns {Promise<Product>} A promise that resolves to the newly created product.
50
+ */
51
+ createProduct(productData: ProductCreationPayload, options?: ApiOptions): Promise<Product>;
52
+ /**
53
+ * Updates an existing product's information.
54
+ * @param {string | number} id - The ID of the product to update.
55
+ * @param {ProductUpdatePayload} productData - The data to update.
56
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
57
+ * @returns {Promise<Product>} A promise that resolves to the updated product.
58
+ */
59
+ updateProduct(id: string | number, productData: ProductUpdatePayload, options?: ApiOptions): Promise<Product>;
60
+ /**
61
+ * Deletes a product.
62
+ * @param {string | number} id - The ID of the product to delete.
63
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
64
+ * @returns {Promise<void>} A promise that resolves when the deletion is successful.
65
+ */
66
+ deleteProduct(id: string | number, options?: ApiOptions): Promise<void>;
67
+ };
@@ -0,0 +1,49 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { ProductTaxonomy } from '../types';
3
+ /**
4
+ * Defines the structure of a ProductTaxonomy relationship.
5
+ * This represents the many-to-many relationship between products and taxonomies.
6
+ */
7
+ export interface ServiceTypeProductTaxonomy extends ProductTaxonomy {
8
+ }
9
+ /**
10
+ * Defines the payload for attaching taxonomies to a product.
11
+ */
12
+ export type ProductTaxonomyAttachPayload = {
13
+ taxonomy_ids: number[];
14
+ };
15
+ /**
16
+ * Defines the payload for syncing taxonomies with a product.
17
+ * This replaces all existing taxonomies with the provided list.
18
+ */
19
+ export type ProductTaxonomySyncPayload = {
20
+ taxonomy_ids: number[];
21
+ };
22
+ export declare const productTaxonomyService: {
23
+ /**
24
+ * Attaches taxonomies to a product.
25
+ * This adds the specified taxonomies to the product without removing existing ones.
26
+ * @param {string | number} productId - The ID of the product.
27
+ * @param {ProductTaxonomyAttachPayload} payload - The payload containing taxonomy IDs to attach.
28
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
29
+ * @returns {Promise<void>} A promise that resolves when the taxonomies are attached successfully.
30
+ */
31
+ attachTaxonomies(productId: string | number, payload: ProductTaxonomyAttachPayload, options?: ApiOptions): Promise<void>;
32
+ /**
33
+ * Syncs taxonomies with a product.
34
+ * This replaces all existing taxonomies with the provided list.
35
+ * @param {string | number} productId - The ID of the product.
36
+ * @param {ProductTaxonomySyncPayload} payload - The payload containing taxonomy IDs to sync.
37
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
38
+ * @returns {Promise<void>} A promise that resolves when the taxonomies are synced successfully.
39
+ */
40
+ syncTaxonomies(productId: string | number, payload: ProductTaxonomySyncPayload, options?: ApiOptions): Promise<void>;
41
+ /**
42
+ * Detaches a specific taxonomy from a product.
43
+ * @param {string | number} productId - The ID of the product.
44
+ * @param {string | number} taxonomyId - The ID of the taxonomy to detach.
45
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
46
+ * @returns {Promise<void>} A promise that resolves when the taxonomy is detached successfully.
47
+ */
48
+ detachTaxonomy(productId: string | number, taxonomyId: string | number, options?: ApiOptions): Promise<void>;
49
+ };
@@ -0,0 +1,69 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { Taxonomy } from '../types';
3
+ /**
4
+ * Defines the structure of a Taxonomy object.
5
+ * Customize these properties to match your application's data model.
6
+ */
7
+ export interface ServiceTypeTaxonomy extends Taxonomy {
8
+ }
9
+ /**
10
+ * Defines the payload for creating a new taxonomy.
11
+ * It omits server-generated fields like `id`, `created_at`, `updated_at`, and relational fields.
12
+ */
13
+ export type TaxonomyCreationPayload = Omit<ServiceTypeTaxonomy, 'id' | 'created_at' | 'updated_at' | 'type' | 'parent' | 'children'>;
14
+ /**
15
+ * Defines the payload for updating an existing taxonomy.
16
+ * All fields are optional to allow for partial updates.
17
+ */
18
+ export type TaxonomyUpdatePayload = Partial<TaxonomyCreationPayload>;
19
+ /**
20
+ * Defines the available query parameters for fetching a list of taxonomies.
21
+ * This is useful for implementing features like pagination, sorting, and searching.
22
+ */
23
+ export type TaxonomyListQuery = {
24
+ page?: number;
25
+ per_page?: number;
26
+ sort_by?: keyof Taxonomy;
27
+ sort_order?: 'asc' | 'desc';
28
+ search?: string;
29
+ taxonomy_type_id?: number;
30
+ parent_id?: number | null;
31
+ };
32
+ export declare const taxonomyService: {
33
+ /**
34
+ * Fetches a hierarchical list of taxonomies.
35
+ * @param {TaxonomyListQuery} params - Query parameters for filtering and pagination.
36
+ * @param {ApiOptions} options - Custom options for the API request.
37
+ * @returns {Promise<Taxonomy[]>} A promise that resolves to an array of taxonomies with nested children.
38
+ */
39
+ getTaxonomies(params?: TaxonomyListQuery, options?: ApiOptions): Promise<Taxonomy[]>;
40
+ /**
41
+ * Fetches a single taxonomy by its unique identifier.
42
+ * @param {string | number} id - The ID of the taxonomy.
43
+ * @param {ApiOptions} options - Custom options for the API request.
44
+ * @returns {Promise<Taxonomy>} A promise that resolves to the requested taxonomy.
45
+ */
46
+ getTaxonomyById(id: string | number, options?: ApiOptions): Promise<Taxonomy>;
47
+ /**
48
+ * Creates a new taxonomy.
49
+ * @param {TaxonomyCreationPayload} taxonomyData - The data for the new taxonomy.
50
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
51
+ * @returns {Promise<Taxonomy>} A promise that resolves to the newly created taxonomy.
52
+ */
53
+ createTaxonomy(taxonomyData: TaxonomyCreationPayload, options?: ApiOptions): Promise<Taxonomy>;
54
+ /**
55
+ * Updates an existing taxonomy's information.
56
+ * @param {string | number} id - The ID of the taxonomy to update.
57
+ * @param {TaxonomyUpdatePayload} taxonomyData - The data to update.
58
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
59
+ * @returns {Promise<Taxonomy>} A promise that resolves to the updated taxonomy.
60
+ */
61
+ updateTaxonomy(id: string | number, taxonomyData: TaxonomyUpdatePayload, options?: ApiOptions): Promise<Taxonomy>;
62
+ /**
63
+ * Deletes a taxonomy and its children.
64
+ * @param {string | number} id - The ID of the taxonomy to delete.
65
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
66
+ * @returns {Promise<void>} A promise that resolves when the deletion is successful.
67
+ */
68
+ deleteTaxonomy(id: string | number, options?: ApiOptions): Promise<void>;
69
+ };
@@ -0,0 +1,68 @@
1
+ import { ApiOptions } from '../../../hooks/api';
2
+ import { TaxonomyType } from '../types';
3
+ /**
4
+ * Defines the structure of a TaxonomyType object.
5
+ * Customize these properties to match your application's data model.
6
+ */
7
+ export interface ServiceTypeTaxonomyType extends TaxonomyType {
8
+ taxonomies?: any[];
9
+ }
10
+ /**
11
+ * Defines the payload for creating a new taxonomy type.
12
+ * It omits server-generated fields like `id`, `created_at`, and `updated_at`.
13
+ */
14
+ export type TaxonomyTypeCreationPayload = Omit<ServiceTypeTaxonomyType, 'id' | 'created_at' | 'updated_at' | 'taxonomies'>;
15
+ /**
16
+ * Defines the payload for updating an existing taxonomy type.
17
+ * All fields are optional to allow for partial updates.
18
+ */
19
+ export type TaxonomyTypeUpdatePayload = Partial<TaxonomyTypeCreationPayload>;
20
+ /**
21
+ * Defines the available query parameters for fetching a list of taxonomy types.
22
+ * This is useful for implementing features like pagination, sorting, and searching.
23
+ */
24
+ export type TaxonomyTypeListQuery = {
25
+ page?: number;
26
+ per_page?: number;
27
+ sort_by?: keyof TaxonomyType;
28
+ sort_order?: 'asc' | 'desc';
29
+ search?: string;
30
+ };
31
+ export declare const taxonomyTypeService: {
32
+ /**
33
+ * Fetches a list of taxonomy types.
34
+ * @param {TaxonomyTypeListQuery} params - Query parameters for filtering and pagination.
35
+ * @param {ApiOptions} options - Custom options for the API request.
36
+ * @returns {Promise<TaxonomyType[]>} A promise that resolves to an array of taxonomy types.
37
+ */
38
+ getTaxonomyTypes(params?: TaxonomyTypeListQuery, options?: ApiOptions): Promise<TaxonomyType[]>;
39
+ /**
40
+ * Fetches a single taxonomy type by its unique identifier.
41
+ * @param {string | number} id - The ID of the taxonomy type.
42
+ * @param {ApiOptions} options - Custom options for the API request.
43
+ * @returns {Promise<TaxonomyType>} A promise that resolves to the requested taxonomy type.
44
+ */
45
+ getTaxonomyTypeById(id: string | number, options?: ApiOptions): Promise<TaxonomyType>;
46
+ /**
47
+ * Creates a new taxonomy type.
48
+ * @param {TaxonomyTypeCreationPayload} taxonomyTypeData - The data for the new taxonomy type.
49
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
50
+ * @returns {Promise<TaxonomyType>} A promise that resolves to the newly created taxonomy type.
51
+ */
52
+ createTaxonomyType(taxonomyTypeData: TaxonomyTypeCreationPayload, options?: ApiOptions): Promise<TaxonomyType>;
53
+ /**
54
+ * Updates an existing taxonomy type's information.
55
+ * @param {string | number} id - The ID of the taxonomy type to update.
56
+ * @param {TaxonomyTypeUpdatePayload} taxonomyTypeData - The data to update.
57
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
58
+ * @returns {Promise<TaxonomyType>} A promise that resolves to the updated taxonomy type.
59
+ */
60
+ updateTaxonomyType(id: string | number, taxonomyTypeData: TaxonomyTypeUpdatePayload, options?: ApiOptions): Promise<TaxonomyType>;
61
+ /**
62
+ * Deletes a taxonomy type.
63
+ * @param {string | number} id - The ID of the taxonomy type to delete.
64
+ * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
65
+ * @returns {Promise<void>} A promise that resolves when the deletion is successful.
66
+ */
67
+ deleteTaxonomyType(id: string | number, options?: ApiOptions): Promise<void>;
68
+ };