@plasmicpkgs/commerce 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/auth/use-login.d.ts +6 -0
- package/dist/auth/use-login.js +9 -0
- package/dist/auth/use-logout.d.ts +6 -0
- package/dist/auth/use-logout.js +9 -0
- package/dist/auth/use-signup.d.ts +6 -0
- package/dist/auth/use-signup.js +9 -0
- package/dist/cart/use-add-item.d.ts +6 -0
- package/dist/cart/use-add-item.js +9 -0
- package/dist/cart/use-cart.d.ts +6 -0
- package/dist/cart/use-cart.js +18 -0
- package/dist/cart/use-remove-item.d.ts +6 -0
- package/dist/cart/use-remove-item.js +9 -0
- package/dist/cart/use-update-item.d.ts +6 -0
- package/dist/cart/use-update-item.js +9 -0
- package/dist/checkout/use-checkout.d.ts +6 -0
- package/dist/checkout/use-checkout.js +18 -0
- package/dist/checkout/use-submit-checkout.d.ts +6 -0
- package/dist/checkout/use-submit-checkout.js +9 -0
- package/dist/contexts.d.ts +7 -0
- package/dist/contexts.js +46 -0
- package/dist/customer/address/use-add-item.d.ts +6 -0
- package/dist/customer/address/use-add-item.js +9 -0
- package/dist/customer/address/use-addresses.d.ts +6 -0
- package/dist/customer/address/use-addresses.js +18 -0
- package/dist/customer/address/use-remove-item.d.ts +6 -0
- package/dist/customer/address/use-remove-item.js +9 -0
- package/dist/customer/address/use-update-item.d.ts +6 -0
- package/dist/customer/address/use-update-item.js +9 -0
- package/dist/customer/card/use-add-item.d.ts +6 -0
- package/dist/customer/card/use-add-item.js +9 -0
- package/dist/customer/card/use-cards.d.ts +6 -0
- package/dist/customer/card/use-cards.js +18 -0
- package/dist/customer/card/use-remove-item.d.ts +6 -0
- package/dist/customer/card/use-remove-item.js +9 -0
- package/dist/customer/card/use-update-item.d.ts +6 -0
- package/dist/customer/card/use-update-item.js +9 -0
- package/dist/customer/use-customer.d.ts +6 -0
- package/dist/customer/use-customer.js +9 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +29 -0
- package/dist/product/use-price.d.ts +26 -0
- package/dist/product/use-price.js +33 -0
- package/dist/product/use-search.d.ts +6 -0
- package/dist/product/use-search.js +9 -0
- package/dist/registerProductCollection.d.ts +11 -0
- package/dist/registerProductCollection.js +42 -0
- package/dist/registerProductImage.d.ts +13 -0
- package/dist/registerProductImage.js +37 -0
- package/dist/registerable.d.ts +4 -0
- package/dist/registerable.js +0 -0
- package/dist/tsconfig.tsbuildinfo +2970 -0
- package/dist/types/cart.d.ts +157 -0
- package/dist/types/cart.js +0 -0
- package/dist/types/checkout.d.ts +57 -0
- package/dist/types/checkout.js +0 -0
- package/dist/types/common.d.ts +13 -0
- package/dist/types/common.js +0 -0
- package/dist/types/customer/address.d.ts +110 -0
- package/dist/types/customer/address.js +0 -0
- package/dist/types/customer/card.d.ts +113 -0
- package/dist/types/customer/card.js +0 -0
- package/dist/types/customer/index.d.ts +24 -0
- package/dist/types/customer/index.js +2 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +11 -0
- package/dist/types/login.d.ts +27 -0
- package/dist/types/login.js +0 -0
- package/dist/types/logout.d.ts +17 -0
- package/dist/types/logout.js +0 -0
- package/dist/types/page.d.ts +24 -0
- package/dist/types/page.js +0 -0
- package/dist/types/product.d.ts +99 -0
- package/dist/types/product.js +0 -0
- package/dist/types/signup.d.ts +23 -0
- package/dist/types/signup.js +0 -0
- package/dist/types/site.d.ts +17 -0
- package/dist/types/site.js +0 -0
- package/dist/types/wishlist.d.ts +83 -0
- package/dist/types/wishlist.js +0 -0
- package/dist/utils/default-fetcher.d.ts +4 -0
- package/dist/utils/default-fetcher.js +3 -0
- package/dist/utils/define-property.d.ts +21 -0
- package/dist/utils/define-property.js +4 -0
- package/dist/utils/errors.d.ts +27 -0
- package/dist/utils/errors.js +24 -0
- package/dist/utils/types.d.ts +94 -0
- package/dist/utils/types.js +0 -0
- package/dist/utils/use-data.d.ts +12 -0
- package/dist/utils/use-data.js +43 -0
- package/dist/utils/use-hook.d.ts +6 -0
- package/dist/utils/use-hook.js +37 -0
- package/package.json +42 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { Discount, Measurement, Image } from './common';
|
|
2
|
+
export declare type SelectedOption = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type LineItem = {
|
|
8
|
+
id: string;
|
|
9
|
+
variantId: string;
|
|
10
|
+
productId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
quantity: number;
|
|
13
|
+
discounts: Discount[];
|
|
14
|
+
path: string;
|
|
15
|
+
variant: ProductVariant;
|
|
16
|
+
options?: SelectedOption[];
|
|
17
|
+
};
|
|
18
|
+
export declare type ProductVariant = {
|
|
19
|
+
id: string;
|
|
20
|
+
sku: string;
|
|
21
|
+
name: string;
|
|
22
|
+
requiresShipping: boolean;
|
|
23
|
+
price: number;
|
|
24
|
+
listPrice: number;
|
|
25
|
+
image?: Image;
|
|
26
|
+
isInStock?: boolean;
|
|
27
|
+
availableForSale?: boolean;
|
|
28
|
+
weight?: Measurement;
|
|
29
|
+
height?: Measurement;
|
|
30
|
+
width?: Measurement;
|
|
31
|
+
depth?: Measurement;
|
|
32
|
+
};
|
|
33
|
+
export declare type Cart = {
|
|
34
|
+
id: string;
|
|
35
|
+
customerId?: string;
|
|
36
|
+
email?: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
currency: {
|
|
39
|
+
code: string;
|
|
40
|
+
};
|
|
41
|
+
taxesIncluded: boolean;
|
|
42
|
+
lineItems: LineItem[];
|
|
43
|
+
lineItemsSubtotalPrice: number;
|
|
44
|
+
subtotalPrice: number;
|
|
45
|
+
totalPrice: number;
|
|
46
|
+
discounts?: Discount[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Base cart item body used for cart mutations
|
|
50
|
+
*/
|
|
51
|
+
export declare type CartItemBody = {
|
|
52
|
+
variantId: string;
|
|
53
|
+
productId?: string;
|
|
54
|
+
quantity?: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Hooks schema
|
|
58
|
+
*/
|
|
59
|
+
export declare type CartTypes = {
|
|
60
|
+
cart?: Cart;
|
|
61
|
+
item: LineItem;
|
|
62
|
+
itemBody: CartItemBody;
|
|
63
|
+
};
|
|
64
|
+
export declare type CartHooks<T extends CartTypes = CartTypes> = {
|
|
65
|
+
getCart: GetCartHook<T>;
|
|
66
|
+
addItem: AddItemHook<T>;
|
|
67
|
+
updateItem: UpdateItemHook<T>;
|
|
68
|
+
removeItem: RemoveItemHook<T>;
|
|
69
|
+
};
|
|
70
|
+
export declare type GetCartHook<T extends CartTypes = CartTypes> = {
|
|
71
|
+
data: T['cart'] | null;
|
|
72
|
+
input: {};
|
|
73
|
+
fetcherInput: {
|
|
74
|
+
cartId?: string;
|
|
75
|
+
};
|
|
76
|
+
swrState: {
|
|
77
|
+
isEmpty: boolean;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export declare type AddItemHook<T extends CartTypes = CartTypes> = {
|
|
81
|
+
data: T['cart'];
|
|
82
|
+
input?: T['itemBody'];
|
|
83
|
+
fetcherInput: T['itemBody'];
|
|
84
|
+
body: {
|
|
85
|
+
item: T['itemBody'];
|
|
86
|
+
};
|
|
87
|
+
actionInput: T['itemBody'];
|
|
88
|
+
};
|
|
89
|
+
export declare type UpdateItemHook<T extends CartTypes = CartTypes> = {
|
|
90
|
+
data: T['cart'] | null;
|
|
91
|
+
input: {
|
|
92
|
+
item?: T['item'];
|
|
93
|
+
wait?: number;
|
|
94
|
+
};
|
|
95
|
+
fetcherInput: {
|
|
96
|
+
itemId: string;
|
|
97
|
+
item: T['itemBody'];
|
|
98
|
+
};
|
|
99
|
+
body: {
|
|
100
|
+
itemId: string;
|
|
101
|
+
item: T['itemBody'];
|
|
102
|
+
};
|
|
103
|
+
actionInput: T['itemBody'] & {
|
|
104
|
+
id: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
export declare type RemoveItemHook<T extends CartTypes = CartTypes> = {
|
|
108
|
+
data: T['cart'] | null;
|
|
109
|
+
input: {
|
|
110
|
+
item?: T['item'];
|
|
111
|
+
};
|
|
112
|
+
fetcherInput: {
|
|
113
|
+
itemId: string;
|
|
114
|
+
};
|
|
115
|
+
body: {
|
|
116
|
+
itemId: string;
|
|
117
|
+
};
|
|
118
|
+
actionInput: {
|
|
119
|
+
id: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* API Schema
|
|
124
|
+
*/
|
|
125
|
+
export declare type CartSchema<T extends CartTypes = CartTypes> = {
|
|
126
|
+
endpoint: {
|
|
127
|
+
options: {};
|
|
128
|
+
handlers: CartHandlers<T>;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export declare type CartHandlers<T extends CartTypes = CartTypes> = {
|
|
132
|
+
getCart: GetCartHandler<T>;
|
|
133
|
+
addItem: AddItemHandler<T>;
|
|
134
|
+
updateItem: UpdateItemHandler<T>;
|
|
135
|
+
removeItem: RemoveItemHandler<T>;
|
|
136
|
+
};
|
|
137
|
+
export declare type GetCartHandler<T extends CartTypes = CartTypes> = GetCartHook<T> & {
|
|
138
|
+
body: {
|
|
139
|
+
cartId?: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
export declare type AddItemHandler<T extends CartTypes = CartTypes> = AddItemHook<T> & {
|
|
143
|
+
body: {
|
|
144
|
+
cartId: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export declare type UpdateItemHandler<T extends CartTypes = CartTypes> = UpdateItemHook<T> & {
|
|
148
|
+
data: T['cart'];
|
|
149
|
+
body: {
|
|
150
|
+
cartId: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export declare type RemoveItemHandler<T extends CartTypes = CartTypes> = RemoveItemHook<T> & {
|
|
154
|
+
body: {
|
|
155
|
+
cartId: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { UseSubmitCheckout } from '../checkout/use-submit-checkout';
|
|
2
|
+
import type { Address, AddressFields } from './customer/address';
|
|
3
|
+
import type { Card, CardFields } from './customer/card';
|
|
4
|
+
export declare type Checkout = any;
|
|
5
|
+
export declare type CheckoutTypes = {
|
|
6
|
+
card?: Card | CardFields;
|
|
7
|
+
address?: Address | AddressFields;
|
|
8
|
+
checkout?: Checkout;
|
|
9
|
+
hasPayment?: boolean;
|
|
10
|
+
hasShipping?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare type SubmitCheckoutHook<T extends CheckoutTypes = CheckoutTypes> = {
|
|
13
|
+
data: T;
|
|
14
|
+
input?: T;
|
|
15
|
+
fetcherInput: T;
|
|
16
|
+
body: {
|
|
17
|
+
item: T;
|
|
18
|
+
};
|
|
19
|
+
actionInput: T;
|
|
20
|
+
};
|
|
21
|
+
export declare type GetCheckoutHook<T extends CheckoutTypes = CheckoutTypes> = {
|
|
22
|
+
data: T['checkout'] | null;
|
|
23
|
+
input: {};
|
|
24
|
+
fetcherInput: {
|
|
25
|
+
cartId?: string;
|
|
26
|
+
};
|
|
27
|
+
swrState: {
|
|
28
|
+
isEmpty: boolean;
|
|
29
|
+
};
|
|
30
|
+
mutations: {
|
|
31
|
+
submit: UseSubmitCheckout;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare type CheckoutHooks<T extends CheckoutTypes = CheckoutTypes> = {
|
|
35
|
+
submitCheckout?: SubmitCheckoutHook<T>;
|
|
36
|
+
getCheckout: GetCheckoutHook<T>;
|
|
37
|
+
};
|
|
38
|
+
export declare type GetCheckoutHandler<T extends CheckoutTypes = CheckoutTypes> = GetCheckoutHook<T> & {
|
|
39
|
+
body: {
|
|
40
|
+
cartId: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export declare type SubmitCheckoutHandler<T extends CheckoutTypes = CheckoutTypes> = SubmitCheckoutHook<T> & {
|
|
44
|
+
body: {
|
|
45
|
+
cartId: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare type CheckoutHandlers<T extends CheckoutTypes = CheckoutTypes> = {
|
|
49
|
+
getCheckout: GetCheckoutHandler<T>;
|
|
50
|
+
submitCheckout?: SubmitCheckoutHandler<T>;
|
|
51
|
+
};
|
|
52
|
+
export declare type CheckoutSchema<T extends CheckoutTypes = CheckoutTypes> = {
|
|
53
|
+
endpoint: {
|
|
54
|
+
options: {};
|
|
55
|
+
handlers: CheckoutHandlers<T>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare type Discount = {
|
|
2
|
+
value: number;
|
|
3
|
+
};
|
|
4
|
+
export declare type Measurement = {
|
|
5
|
+
value: number;
|
|
6
|
+
unit: 'KILOGRAMS' | 'GRAMS' | 'POUNDS' | 'OUNCES';
|
|
7
|
+
};
|
|
8
|
+
export declare type Image = {
|
|
9
|
+
url: string;
|
|
10
|
+
altText?: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export interface Address {
|
|
2
|
+
id: string;
|
|
3
|
+
mask: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AddressFields {
|
|
6
|
+
type: string;
|
|
7
|
+
firstName: string;
|
|
8
|
+
lastName: string;
|
|
9
|
+
company: string;
|
|
10
|
+
streetNumber: string;
|
|
11
|
+
apartments: string;
|
|
12
|
+
zipCode: string;
|
|
13
|
+
city: string;
|
|
14
|
+
country: string;
|
|
15
|
+
}
|
|
16
|
+
export declare type CustomerAddressTypes = {
|
|
17
|
+
address?: Address;
|
|
18
|
+
fields: AddressFields;
|
|
19
|
+
};
|
|
20
|
+
export declare type GetAddressesHook<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
21
|
+
data: T['address'][] | null;
|
|
22
|
+
input: {};
|
|
23
|
+
fetcherInput: {
|
|
24
|
+
cartId?: string;
|
|
25
|
+
};
|
|
26
|
+
swrState: {
|
|
27
|
+
isEmpty: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare type AddItemHook<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
31
|
+
data: T['address'];
|
|
32
|
+
input?: T['fields'];
|
|
33
|
+
fetcherInput: T['fields'];
|
|
34
|
+
body: {
|
|
35
|
+
item: T['fields'];
|
|
36
|
+
};
|
|
37
|
+
actionInput: T['fields'];
|
|
38
|
+
};
|
|
39
|
+
export declare type UpdateItemHook<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
40
|
+
data: T['address'] | null;
|
|
41
|
+
input: {
|
|
42
|
+
item?: T['fields'];
|
|
43
|
+
wait?: number;
|
|
44
|
+
};
|
|
45
|
+
fetcherInput: {
|
|
46
|
+
itemId: string;
|
|
47
|
+
item: T['fields'];
|
|
48
|
+
};
|
|
49
|
+
body: {
|
|
50
|
+
itemId: string;
|
|
51
|
+
item: T['fields'];
|
|
52
|
+
};
|
|
53
|
+
actionInput: T['fields'] & {
|
|
54
|
+
id: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare type RemoveItemHook<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
58
|
+
data: T['address'] | null;
|
|
59
|
+
input: {
|
|
60
|
+
item?: T['address'];
|
|
61
|
+
};
|
|
62
|
+
fetcherInput: {
|
|
63
|
+
itemId: string;
|
|
64
|
+
};
|
|
65
|
+
body: {
|
|
66
|
+
itemId: string;
|
|
67
|
+
};
|
|
68
|
+
actionInput: {
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare type CustomerAddressHooks<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
73
|
+
getAddresses: GetAddressesHook<T>;
|
|
74
|
+
addItem: AddItemHook<T>;
|
|
75
|
+
updateItem: UpdateItemHook<T>;
|
|
76
|
+
removeItem: RemoveItemHook<T>;
|
|
77
|
+
};
|
|
78
|
+
export declare type AddressHandler<T extends CustomerAddressTypes = CustomerAddressTypes> = GetAddressesHook<T> & {
|
|
79
|
+
body: {
|
|
80
|
+
cartId?: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export declare type AddItemHandler<T extends CustomerAddressTypes = CustomerAddressTypes> = AddItemHook<T> & {
|
|
84
|
+
body: {
|
|
85
|
+
cartId: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare type UpdateItemHandler<T extends CustomerAddressTypes = CustomerAddressTypes> = UpdateItemHook<T> & {
|
|
89
|
+
data: T['address'];
|
|
90
|
+
body: {
|
|
91
|
+
cartId: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export declare type RemoveItemHandler<T extends CustomerAddressTypes = CustomerAddressTypes> = RemoveItemHook<T> & {
|
|
95
|
+
body: {
|
|
96
|
+
cartId: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export declare type CustomerAddressHandlers<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
100
|
+
getAddresses: GetAddressesHook<T>;
|
|
101
|
+
addItem: AddItemHandler<T>;
|
|
102
|
+
updateItem: UpdateItemHandler<T>;
|
|
103
|
+
removeItem: RemoveItemHandler<T>;
|
|
104
|
+
};
|
|
105
|
+
export declare type CustomerAddressSchema<T extends CustomerAddressTypes = CustomerAddressTypes> = {
|
|
106
|
+
endpoint: {
|
|
107
|
+
options: {};
|
|
108
|
+
handlers: CustomerAddressHandlers<T>;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
File without changes
|
|
@@ -0,0 +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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +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, };
|
|
@@ -0,0 +1,11 @@
|
|
|
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';
|
|
@@ -0,0 +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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,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
|
+
};
|
|
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
|
+
};
|
|
File without changes
|