@plasmicpkgs/commerce 0.0.1 → 0.0.2

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 (116) hide show
  1. package/README.md +1 -0
  2. package/dist/api/endpoints/cart.d.ts +4 -0
  3. package/dist/api/endpoints/catalog/products.d.ts +4 -0
  4. package/dist/api/index.d.ts +75 -0
  5. package/dist/api/operations.d.ts +130 -0
  6. package/dist/api/utils/errors.d.ts +10 -0
  7. package/dist/api/utils/is-allowed-method.d.ts +3 -0
  8. package/dist/api/utils/is-allowed-operation.d.ts +6 -0
  9. package/dist/api/utils/types.d.ts +34 -0
  10. package/dist/cart/use-add-item.d.ts +5 -6
  11. package/dist/cart/use-cart.d.ts +5 -6
  12. package/dist/cart/use-remove-item.d.ts +5 -6
  13. package/dist/cart/use-update-item.d.ts +5 -6
  14. package/dist/commerce.cjs.development.js +1851 -0
  15. package/dist/commerce.cjs.development.js.map +1 -0
  16. package/dist/commerce.cjs.production.min.js +2 -0
  17. package/dist/commerce.cjs.production.min.js.map +1 -0
  18. package/dist/commerce.d.ts +37 -0
  19. package/dist/commerce.esm.js +1828 -0
  20. package/dist/commerce.esm.js.map +1 -0
  21. package/dist/contexts.d.ts +10 -7
  22. package/dist/index.d.ts +21 -71
  23. package/dist/index.js +7 -28
  24. package/dist/product/use-price.d.ts +26 -26
  25. package/dist/product/use-search.d.ts +6 -6
  26. package/dist/registerAddToCartButton.d.ts +10 -0
  27. package/dist/registerProductCollection.d.ts +13 -11
  28. package/dist/registerProductMedia.d.ts +12 -0
  29. package/dist/registerProductPrice.d.ts +9 -0
  30. package/dist/registerProductQuantity.d.ts +11 -0
  31. package/dist/registerProductTextField.d.ts +10 -0
  32. package/dist/registerProductVariantPicker.d.ts +9 -0
  33. package/dist/registerUseCart.d.ts +9 -0
  34. package/dist/registerable.d.ts +4 -4
  35. package/dist/types/cart.d.ts +157 -157
  36. package/dist/types/checkout.d.ts +57 -57
  37. package/dist/types/common.d.ts +13 -13
  38. package/dist/types/customer/address.d.ts +110 -110
  39. package/dist/types/customer/card.d.ts +113 -113
  40. package/dist/types/customer/index.d.ts +24 -24
  41. package/dist/types/index.d.ts +12 -12
  42. package/dist/types/login.d.ts +27 -27
  43. package/dist/types/logout.d.ts +17 -17
  44. package/dist/types/page.d.ts +24 -24
  45. package/dist/types/product.d.ts +102 -99
  46. package/dist/types/signup.d.ts +23 -23
  47. package/dist/types/site.d.ts +17 -17
  48. package/dist/types/wishlist.d.ts +83 -83
  49. package/dist/utils/default-fetcher.d.ts +4 -4
  50. package/dist/utils/define-property.d.ts +21 -21
  51. package/dist/utils/errors.d.ts +27 -27
  52. package/dist/utils/get-product-price.d.ts +2 -0
  53. package/dist/utils/types.d.ts +95 -94
  54. package/dist/utils/use-data.d.ts +12 -12
  55. package/dist/utils/use-hook.d.ts +6 -6
  56. package/package.json +13 -13
  57. package/dist/auth/use-login.d.ts +0 -6
  58. package/dist/auth/use-login.js +0 -9
  59. package/dist/auth/use-logout.d.ts +0 -6
  60. package/dist/auth/use-logout.js +0 -9
  61. package/dist/auth/use-signup.d.ts +0 -6
  62. package/dist/auth/use-signup.js +0 -9
  63. package/dist/cart/use-add-item.js +0 -9
  64. package/dist/cart/use-cart.js +0 -18
  65. package/dist/cart/use-remove-item.js +0 -9
  66. package/dist/cart/use-update-item.js +0 -9
  67. package/dist/checkout/use-checkout.d.ts +0 -6
  68. package/dist/checkout/use-checkout.js +0 -18
  69. package/dist/checkout/use-submit-checkout.d.ts +0 -6
  70. package/dist/checkout/use-submit-checkout.js +0 -9
  71. package/dist/contexts.js +0 -46
  72. package/dist/customer/address/use-add-item.d.ts +0 -6
  73. package/dist/customer/address/use-add-item.js +0 -9
  74. package/dist/customer/address/use-addresses.d.ts +0 -6
  75. package/dist/customer/address/use-addresses.js +0 -18
  76. package/dist/customer/address/use-remove-item.d.ts +0 -6
  77. package/dist/customer/address/use-remove-item.js +0 -9
  78. package/dist/customer/address/use-update-item.d.ts +0 -6
  79. package/dist/customer/address/use-update-item.js +0 -9
  80. package/dist/customer/card/use-add-item.d.ts +0 -6
  81. package/dist/customer/card/use-add-item.js +0 -9
  82. package/dist/customer/card/use-cards.d.ts +0 -6
  83. package/dist/customer/card/use-cards.js +0 -18
  84. package/dist/customer/card/use-remove-item.d.ts +0 -6
  85. package/dist/customer/card/use-remove-item.js +0 -9
  86. package/dist/customer/card/use-update-item.d.ts +0 -6
  87. package/dist/customer/card/use-update-item.js +0 -9
  88. package/dist/customer/use-customer.d.ts +0 -6
  89. package/dist/customer/use-customer.js +0 -9
  90. package/dist/product/use-price.js +0 -33
  91. package/dist/product/use-search.js +0 -9
  92. package/dist/registerProductCollection.js +0 -42
  93. package/dist/registerProductImage.d.ts +0 -13
  94. package/dist/registerProductImage.js +0 -37
  95. package/dist/registerable.js +0 -0
  96. package/dist/tsconfig.tsbuildinfo +0 -2970
  97. package/dist/types/cart.js +0 -0
  98. package/dist/types/checkout.js +0 -0
  99. package/dist/types/common.js +0 -0
  100. package/dist/types/customer/address.js +0 -0
  101. package/dist/types/customer/card.js +0 -0
  102. package/dist/types/customer/index.js +0 -2
  103. package/dist/types/index.js +0 -11
  104. package/dist/types/login.js +0 -0
  105. package/dist/types/logout.js +0 -0
  106. package/dist/types/page.js +0 -0
  107. package/dist/types/product.js +0 -0
  108. package/dist/types/signup.js +0 -0
  109. package/dist/types/site.js +0 -0
  110. package/dist/types/wishlist.js +0 -0
  111. package/dist/utils/default-fetcher.js +0 -3
  112. package/dist/utils/define-property.js +0 -4
  113. package/dist/utils/errors.js +0 -24
  114. package/dist/utils/types.js +0 -0
  115. package/dist/utils/use-data.js +0 -43
  116. package/dist/utils/use-hook.js +0 -37
@@ -1,113 +1,113 @@
1
- export interface Card {
2
- id: string;
3
- mask: string;
4
- provider: string;
5
- }
6
- export interface CardFields {
7
- cardHolder: string;
8
- cardNumber: string;
9
- cardExpireDate: string;
10
- cardCvc: string;
11
- firstName: string;
12
- lastName: string;
13
- company: string;
14
- streetNumber: string;
15
- zipCode: string;
16
- city: string;
17
- country: string;
18
- }
19
- export declare type CustomerCardTypes = {
20
- card?: Card;
21
- fields: CardFields;
22
- };
23
- export declare type GetCardsHook<T extends CustomerCardTypes = CustomerCardTypes> = {
24
- data: T['card'][] | null;
25
- input: {};
26
- fetcherInput: {
27
- cartId?: string;
28
- };
29
- swrState: {
30
- isEmpty: boolean;
31
- };
32
- };
33
- export declare type AddItemHook<T extends CustomerCardTypes = CustomerCardTypes> = {
34
- data: T['card'];
35
- input?: T['fields'];
36
- fetcherInput: T['fields'];
37
- body: {
38
- item: T['fields'];
39
- };
40
- actionInput: T['fields'];
41
- };
42
- export declare type UpdateItemHook<T extends CustomerCardTypes = CustomerCardTypes> = {
43
- data: T['card'] | null;
44
- input: {
45
- item?: T['fields'];
46
- wait?: number;
47
- };
48
- fetcherInput: {
49
- itemId: string;
50
- item: T['fields'];
51
- };
52
- body: {
53
- itemId: string;
54
- item: T['fields'];
55
- };
56
- actionInput: T['fields'] & {
57
- id: string;
58
- };
59
- };
60
- export declare type RemoveItemHook<T extends CustomerCardTypes = CustomerCardTypes> = {
61
- data: T['card'] | null;
62
- input: {
63
- item?: T['card'];
64
- };
65
- fetcherInput: {
66
- itemId: string;
67
- };
68
- body: {
69
- itemId: string;
70
- };
71
- actionInput: {
72
- id: string;
73
- };
74
- };
75
- export declare type CustomerCardHooks<T extends CustomerCardTypes = CustomerCardTypes> = {
76
- getCards: GetCardsHook<T>;
77
- addItem: AddItemHook<T>;
78
- updateItem: UpdateItemHook<T>;
79
- removeItem: RemoveItemHook<T>;
80
- };
81
- export declare type CardsHandler<T extends CustomerCardTypes = CustomerCardTypes> = GetCardsHook<T> & {
82
- body: {
83
- cartId?: string;
84
- };
85
- };
86
- export declare type AddItemHandler<T extends CustomerCardTypes = CustomerCardTypes> = AddItemHook<T> & {
87
- body: {
88
- cartId: string;
89
- };
90
- };
91
- export declare type UpdateItemHandler<T extends CustomerCardTypes = CustomerCardTypes> = UpdateItemHook<T> & {
92
- data: T['card'];
93
- body: {
94
- cartId: string;
95
- };
96
- };
97
- export declare type RemoveItemHandler<T extends CustomerCardTypes = CustomerCardTypes> = RemoveItemHook<T> & {
98
- body: {
99
- cartId: string;
100
- };
101
- };
102
- export declare type CustomerCardHandlers<T extends CustomerCardTypes = CustomerCardTypes> = {
103
- getCards: GetCardsHook<T>;
104
- addItem: AddItemHandler<T>;
105
- updateItem: UpdateItemHandler<T>;
106
- removeItem: RemoveItemHandler<T>;
107
- };
108
- export declare type CustomerCardSchema<T extends CustomerCardTypes = CustomerCardTypes> = {
109
- endpoint: {
110
- options: {};
111
- handlers: CustomerCardHandlers<T>;
112
- };
113
- };
1
+ export interface Card {
2
+ id: string;
3
+ mask: string;
4
+ provider: string;
5
+ }
6
+ export interface CardFields {
7
+ cardHolder: string;
8
+ cardNumber: string;
9
+ cardExpireDate: string;
10
+ cardCvc: string;
11
+ firstName: string;
12
+ lastName: string;
13
+ company: string;
14
+ streetNumber: string;
15
+ zipCode: string;
16
+ city: string;
17
+ country: string;
18
+ }
19
+ export declare type CustomerCardTypes = {
20
+ card?: Card;
21
+ fields: CardFields;
22
+ };
23
+ export declare type GetCardsHook<T extends CustomerCardTypes = CustomerCardTypes> = {
24
+ data: T['card'][] | null;
25
+ input: {};
26
+ fetcherInput: {
27
+ cartId?: string;
28
+ };
29
+ swrState: {
30
+ isEmpty: boolean;
31
+ };
32
+ };
33
+ export declare type AddItemHook<T extends CustomerCardTypes = CustomerCardTypes> = {
34
+ data: T['card'];
35
+ input?: T['fields'];
36
+ fetcherInput: T['fields'];
37
+ body: {
38
+ item: T['fields'];
39
+ };
40
+ actionInput: T['fields'];
41
+ };
42
+ export declare type UpdateItemHook<T extends CustomerCardTypes = CustomerCardTypes> = {
43
+ data: T['card'] | null;
44
+ input: {
45
+ item?: T['fields'];
46
+ wait?: number;
47
+ };
48
+ fetcherInput: {
49
+ itemId: string;
50
+ item: T['fields'];
51
+ };
52
+ body: {
53
+ itemId: string;
54
+ item: T['fields'];
55
+ };
56
+ actionInput: T['fields'] & {
57
+ id: string;
58
+ };
59
+ };
60
+ export declare type RemoveItemHook<T extends CustomerCardTypes = CustomerCardTypes> = {
61
+ data: T['card'] | null;
62
+ input: {
63
+ item?: T['card'];
64
+ };
65
+ fetcherInput: {
66
+ itemId: string;
67
+ };
68
+ body: {
69
+ itemId: string;
70
+ };
71
+ actionInput: {
72
+ id: string;
73
+ };
74
+ };
75
+ export declare type CustomerCardHooks<T extends CustomerCardTypes = CustomerCardTypes> = {
76
+ getCards: GetCardsHook<T>;
77
+ addItem: AddItemHook<T>;
78
+ updateItem: UpdateItemHook<T>;
79
+ removeItem: RemoveItemHook<T>;
80
+ };
81
+ export declare type CardsHandler<T extends CustomerCardTypes = CustomerCardTypes> = GetCardsHook<T> & {
82
+ body: {
83
+ cartId?: string;
84
+ };
85
+ };
86
+ export declare type AddItemHandler<T extends CustomerCardTypes = CustomerCardTypes> = AddItemHook<T> & {
87
+ body: {
88
+ cartId: string;
89
+ };
90
+ };
91
+ export declare type UpdateItemHandler<T extends CustomerCardTypes = CustomerCardTypes> = UpdateItemHook<T> & {
92
+ data: T['card'];
93
+ body: {
94
+ cartId: string;
95
+ };
96
+ };
97
+ export declare type RemoveItemHandler<T extends CustomerCardTypes = CustomerCardTypes> = RemoveItemHook<T> & {
98
+ body: {
99
+ cartId: string;
100
+ };
101
+ };
102
+ export declare type CustomerCardHandlers<T extends CustomerCardTypes = CustomerCardTypes> = {
103
+ getCards: GetCardsHook<T>;
104
+ addItem: AddItemHandler<T>;
105
+ updateItem: UpdateItemHandler<T>;
106
+ removeItem: RemoveItemHandler<T>;
107
+ };
108
+ export declare type CustomerCardSchema<T extends CustomerCardTypes = CustomerCardTypes> = {
109
+ endpoint: {
110
+ options: {};
111
+ handlers: CustomerCardHandlers<T>;
112
+ };
113
+ };
@@ -1,24 +1,24 @@
1
- export * as Card from './card';
2
- export * as Address from './address';
3
- export declare type Customer = any;
4
- export declare type CustomerTypes = {
5
- customer: Customer;
6
- };
7
- export declare type CustomerHook<T extends CustomerTypes = CustomerTypes> = {
8
- data: T['customer'] | null;
9
- fetchData: {
10
- customer: T['customer'];
11
- } | null;
12
- };
13
- export declare type CustomerSchema<T extends CustomerTypes = CustomerTypes> = {
14
- endpoint: {
15
- options: {};
16
- handlers: {
17
- getLoggedInCustomer: {
18
- data: {
19
- customer: T['customer'];
20
- } | null;
21
- };
22
- };
23
- };
24
- };
1
+ export * as Card from './card';
2
+ export * as Address from './address';
3
+ export declare type Customer = any;
4
+ export declare type CustomerTypes = {
5
+ customer: Customer;
6
+ };
7
+ export declare type CustomerHook<T extends CustomerTypes = CustomerTypes> = {
8
+ data: T['customer'] | null;
9
+ fetchData: {
10
+ customer: T['customer'];
11
+ } | null;
12
+ };
13
+ export declare type CustomerSchema<T extends CustomerTypes = CustomerTypes> = {
14
+ endpoint: {
15
+ options: {};
16
+ handlers: {
17
+ getLoggedInCustomer: {
18
+ data: {
19
+ customer: T['customer'];
20
+ } | null;
21
+ };
22
+ };
23
+ };
24
+ };
@@ -1,12 +1,12 @@
1
- import * as Cart from './cart';
2
- import * as Checkout from './checkout';
3
- import * as Common from './common';
4
- import * as Customer from './customer';
5
- import * as Login from './login';
6
- import * as Logout from './logout';
7
- import * as Page from './page';
8
- import * as Product from './product';
9
- import * as Signup from './signup';
10
- import * as Site from './site';
11
- import * as Wishlist from './wishlist';
12
- export type { Cart, Checkout, Common, Customer, Login, Logout, Page, Product, Signup, Site, Wishlist, };
1
+ import * as Cart from './cart';
2
+ import * as Checkout from './checkout';
3
+ import * as Common from './common';
4
+ import * as Customer from './customer';
5
+ import * as Login from './login';
6
+ import * as Logout from './logout';
7
+ import * as Page from './page';
8
+ import * as Product from './product';
9
+ import * as Signup from './signup';
10
+ import * as Site from './site';
11
+ import * as Wishlist from './wishlist';
12
+ export type { Cart, Checkout, Common, Customer, Login, Logout, Page, Product, Signup, Site, Wishlist, };
@@ -1,27 +1,27 @@
1
- export declare type LoginBody = {
2
- email: string;
3
- password: string;
4
- };
5
- export declare type LoginTypes = {
6
- body: LoginBody;
7
- };
8
- export declare type LoginHook<T extends LoginTypes = LoginTypes> = {
9
- data: null;
10
- actionInput: LoginBody;
11
- fetcherInput: LoginBody;
12
- body: T['body'];
13
- };
14
- export declare type LoginSchema<T extends LoginTypes = LoginTypes> = {
15
- endpoint: {
16
- options: {};
17
- handlers: {
18
- login: LoginHook<T>;
19
- };
20
- };
21
- };
22
- export declare type LoginOperation = {
23
- data: {
24
- result?: string;
25
- };
26
- variables: unknown;
27
- };
1
+ export declare type LoginBody = {
2
+ email: string;
3
+ password: string;
4
+ };
5
+ export declare type LoginTypes = {
6
+ body: LoginBody;
7
+ };
8
+ export declare type LoginHook<T extends LoginTypes = LoginTypes> = {
9
+ data: null;
10
+ actionInput: LoginBody;
11
+ fetcherInput: LoginBody;
12
+ body: T['body'];
13
+ };
14
+ export declare type LoginSchema<T extends LoginTypes = LoginTypes> = {
15
+ endpoint: {
16
+ options: {};
17
+ handlers: {
18
+ login: LoginHook<T>;
19
+ };
20
+ };
21
+ };
22
+ export declare type LoginOperation = {
23
+ data: {
24
+ result?: string;
25
+ };
26
+ variables: unknown;
27
+ };
@@ -1,17 +1,17 @@
1
- export declare type LogoutTypes = {
2
- body: {
3
- redirectTo?: string;
4
- };
5
- };
6
- export declare type LogoutHook<T extends LogoutTypes = LogoutTypes> = {
7
- data: null;
8
- body: T['body'];
9
- };
10
- export declare type LogoutSchema<T extends LogoutTypes = LogoutTypes> = {
11
- endpoint: {
12
- options: {};
13
- handlers: {
14
- logout: LogoutHook<T>;
15
- };
16
- };
17
- };
1
+ export declare type LogoutTypes = {
2
+ body: {
3
+ redirectTo?: string;
4
+ };
5
+ };
6
+ export declare type LogoutHook<T extends LogoutTypes = LogoutTypes> = {
7
+ data: null;
8
+ body: T['body'];
9
+ };
10
+ export declare type LogoutSchema<T extends LogoutTypes = LogoutTypes> = {
11
+ endpoint: {
12
+ options: {};
13
+ handlers: {
14
+ logout: LogoutHook<T>;
15
+ };
16
+ };
17
+ };
@@ -1,24 +1,24 @@
1
- export declare type Page = {
2
- id: string;
3
- name: string;
4
- url?: string;
5
- body: string;
6
- is_visible?: boolean;
7
- sort_order?: number;
8
- };
9
- export declare type PageTypes = {
10
- page: Page;
11
- };
12
- export declare type GetAllPagesOperation<T extends PageTypes = PageTypes> = {
13
- data: {
14
- pages: T['page'][];
15
- };
16
- };
17
- export declare type GetPageOperation<T extends PageTypes = PageTypes> = {
18
- data: {
19
- page?: T['page'];
20
- };
21
- variables: {
22
- id: string;
23
- };
24
- };
1
+ export declare type Page = {
2
+ id: string;
3
+ name: string;
4
+ url?: string;
5
+ body: string;
6
+ is_visible?: boolean;
7
+ sort_order?: number;
8
+ };
9
+ export declare type PageTypes = {
10
+ page: Page;
11
+ };
12
+ export declare type GetAllPagesOperation<T extends PageTypes = PageTypes> = {
13
+ data: {
14
+ pages: T['page'][];
15
+ };
16
+ };
17
+ export declare type GetPageOperation<T extends PageTypes = PageTypes> = {
18
+ data: {
19
+ page?: T['page'];
20
+ };
21
+ variables: {
22
+ id: string;
23
+ };
24
+ };
@@ -1,99 +1,102 @@
1
- export declare type ProductImage = {
2
- url: string;
3
- alt?: string;
4
- };
5
- export declare type ProductPrice = {
6
- value: number;
7
- currencyCode?: 'USD' | 'EUR' | 'ARS' | string;
8
- retailPrice?: number;
9
- salePrice?: number;
10
- listPrice?: number;
11
- extendedSalePrice?: number;
12
- extendedListPrice?: number;
13
- };
14
- export declare type ProductOption = {
15
- __typename?: 'MultipleChoiceOption';
16
- id: string;
17
- displayName: string;
18
- values: ProductOptionValues[];
19
- };
20
- export declare type ProductOptionValues = {
21
- label: string;
22
- hexColors?: string[];
23
- };
24
- export declare type ProductVariant = {
25
- id: string | number;
26
- options: ProductOption[];
27
- availableForSale?: boolean;
28
- };
29
- export declare type Product = {
30
- id: string;
31
- name: string;
32
- description: string;
33
- descriptionHtml?: string;
34
- sku?: string;
35
- slug?: string;
36
- path?: string;
37
- images: ProductImage[];
38
- variants: ProductVariant[];
39
- price: ProductPrice;
40
- options: ProductOption[];
41
- };
42
- export declare type SearchProductsBody = {
43
- search?: string;
44
- categoryId?: string | number;
45
- brandId?: string | number;
46
- sort?: string;
47
- locale?: string;
48
- };
49
- export declare type ProductTypes = {
50
- product: Product;
51
- searchBody: SearchProductsBody;
52
- };
53
- export declare type SearchProductsHook<T extends ProductTypes = ProductTypes> = {
54
- data: {
55
- products: T['product'][];
56
- found: boolean;
57
- };
58
- body: T['searchBody'];
59
- input: T['searchBody'];
60
- fetcherInput: T['searchBody'];
61
- };
62
- export declare type ProductsSchema<T extends ProductTypes = ProductTypes> = {
63
- endpoint: {
64
- options: {};
65
- handlers: {
66
- getProducts: SearchProductsHook<T>;
67
- };
68
- };
69
- };
70
- export declare type GetAllProductPathsOperation<T extends ProductTypes = ProductTypes> = {
71
- data: {
72
- products: Pick<T['product'], 'path'>[];
73
- };
74
- variables: {
75
- first?: number;
76
- };
77
- };
78
- export declare type GetAllProductsOperation<T extends ProductTypes = ProductTypes> = {
79
- data: {
80
- products: T['product'][];
81
- };
82
- variables: {
83
- relevance?: 'featured' | 'best_selling' | 'newest';
84
- ids?: string[];
85
- first?: number;
86
- };
87
- };
88
- export declare type GetProductOperation<T extends ProductTypes = ProductTypes> = {
89
- data: {
90
- product?: T['product'];
91
- };
92
- variables: {
93
- path: string;
94
- slug?: never;
95
- } | {
96
- path?: never;
97
- slug: string;
98
- };
99
- };
1
+ export declare type ProductImage = {
2
+ url: string;
3
+ alt?: string;
4
+ };
5
+ export declare type ProductPrice = {
6
+ value: number;
7
+ currencyCode?: 'USD' | 'EUR' | 'ARS' | string;
8
+ retailPrice?: number;
9
+ salePrice?: number;
10
+ listPrice?: number;
11
+ extendedSalePrice?: number;
12
+ extendedListPrice?: number;
13
+ };
14
+ export declare type ProductOption = {
15
+ __typename?: 'MultipleChoiceOption';
16
+ id: string;
17
+ displayName: string;
18
+ values: ProductOptionValues[];
19
+ };
20
+ export declare type ProductOptionValues = {
21
+ label: string;
22
+ hexColors?: string[];
23
+ };
24
+ export declare type ProductVariant = {
25
+ id: string | number;
26
+ options: ProductOption[];
27
+ availableForSale?: boolean;
28
+ name: string;
29
+ price?: number;
30
+ };
31
+ export declare type Product = {
32
+ id: string;
33
+ name: string;
34
+ description: string;
35
+ descriptionHtml?: string;
36
+ sku?: string;
37
+ slug?: string;
38
+ path?: string;
39
+ images: ProductImage[];
40
+ variants: ProductVariant[];
41
+ price: ProductPrice;
42
+ options: ProductOption[];
43
+ };
44
+ export declare type SearchProductsBody = {
45
+ search?: string;
46
+ categoryId?: string | number;
47
+ brandId?: string | number;
48
+ sort?: string;
49
+ locale?: string;
50
+ count?: number;
51
+ };
52
+ export declare type ProductTypes = {
53
+ product: Product;
54
+ searchBody: SearchProductsBody;
55
+ };
56
+ export declare type SearchProductsHook<T extends ProductTypes = ProductTypes> = {
57
+ data: {
58
+ products: T['product'][];
59
+ found: boolean;
60
+ };
61
+ body: T['searchBody'];
62
+ input: T['searchBody'];
63
+ fetcherInput: T['searchBody'];
64
+ };
65
+ export declare type ProductsSchema<T extends ProductTypes = ProductTypes> = {
66
+ endpoint: {
67
+ options: {};
68
+ handlers: {
69
+ getProducts: SearchProductsHook<T>;
70
+ };
71
+ };
72
+ };
73
+ export declare type GetAllProductPathsOperation<T extends ProductTypes = ProductTypes> = {
74
+ data: {
75
+ products: Pick<T['product'], 'path'>[];
76
+ };
77
+ variables: {
78
+ first?: number;
79
+ };
80
+ };
81
+ export declare type GetAllProductsOperation<T extends ProductTypes = ProductTypes> = {
82
+ data: {
83
+ products: T['product'][];
84
+ };
85
+ variables: {
86
+ relevance?: 'featured' | 'best_selling' | 'newest';
87
+ ids?: string[];
88
+ first?: number;
89
+ };
90
+ };
91
+ export declare type GetProductOperation<T extends ProductTypes = ProductTypes> = {
92
+ data: {
93
+ product?: T['product'];
94
+ };
95
+ variables: {
96
+ path: string;
97
+ slug?: never;
98
+ } | {
99
+ path?: never;
100
+ slug: string;
101
+ };
102
+ };