apirocket 0.13.0 → 0.13.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.
- package/README.md +301 -3
- package/dist/ecommerce.js +2 -2
- package/dist/lib/proxies.d.ts +1 -1
- package/dist/services/account.service.d.ts +1 -1
- package/dist/services/cart.service.d.ts +21 -0
- package/dist/services/customer.service.d.ts +16 -1
- package/dist/types/types.d.ts +7 -24
- package/package.json +1 -1
package/dist/lib/proxies.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const proxyReadOnly: (target: any) => any;
|
|
1
|
+
declare const proxyReadOnly: (target: any, properties?: Array<string>) => any;
|
|
2
2
|
export { proxyReadOnly };
|
|
@@ -15,7 +15,7 @@ export declare class AccountService {
|
|
|
15
15
|
setCustomerService(customer: CustomerService): void;
|
|
16
16
|
updateMyAccount(form: FormControl, customer: CustomerService): Observable<void>;
|
|
17
17
|
updateShippingAddress(shippingAddress: ShippingAddress): void;
|
|
18
|
-
private myOrderData;
|
|
19
18
|
passwordChange(form: FormControl, customer: CustomerService): Observable<void>;
|
|
20
19
|
pdfOrder(orderId: number): Observable<PdfOrder>;
|
|
20
|
+
private myOrderData;
|
|
21
21
|
}
|
|
@@ -59,3 +59,24 @@ export declare class CartService {
|
|
|
59
59
|
update(): void;
|
|
60
60
|
updateShippingAddress(shippingAddress: ShippingAddress): Observable<any>;
|
|
61
61
|
}
|
|
62
|
+
export declare function cartProxy(cart: CartService): {
|
|
63
|
+
count: number;
|
|
64
|
+
country: {
|
|
65
|
+
id: number;
|
|
66
|
+
iso: string;
|
|
67
|
+
name: string;
|
|
68
|
+
};
|
|
69
|
+
numItems: number;
|
|
70
|
+
taxAmount: number;
|
|
71
|
+
taxBase: number;
|
|
72
|
+
total: number;
|
|
73
|
+
units: number;
|
|
74
|
+
add: (data: CartItem) => void;
|
|
75
|
+
clear: () => void;
|
|
76
|
+
close: () => void;
|
|
77
|
+
items: () => CartItem[];
|
|
78
|
+
open: (fullScreen: boolean) => void;
|
|
79
|
+
removeItem: (item: CartItem) => void;
|
|
80
|
+
subscribe: (cb: (cart: CartService) => void) => () => void;
|
|
81
|
+
updateItem: (item: CartItem, quantity: number) => void;
|
|
82
|
+
};
|
|
@@ -27,12 +27,12 @@ export declare class CustomerService implements Authentication {
|
|
|
27
27
|
private saveState;
|
|
28
28
|
setAccountService(account: AccountService): void;
|
|
29
29
|
setCartService(cart: CartService): void;
|
|
30
|
+
setData(email: string, phone: string, acceptEmailMarketing: boolean): void;
|
|
30
31
|
subscribe(cb: (customer: CustomerService) => void): () => void;
|
|
31
32
|
logout(): Promise<{
|
|
32
33
|
status: number;
|
|
33
34
|
}>;
|
|
34
35
|
myAccount(): Promise<CustomerAccount>;
|
|
35
|
-
setData(email: string, phone: string, acceptEmailMarketing: boolean): void;
|
|
36
36
|
login(form: FormControl): Promise<{
|
|
37
37
|
status: number;
|
|
38
38
|
}>;
|
|
@@ -40,4 +40,19 @@ export declare class CustomerService implements Authentication {
|
|
|
40
40
|
createAccount(form: FormControl): Promise<CreateAccountResponse>;
|
|
41
41
|
price(productId: number): Promise<any>;
|
|
42
42
|
updateState(data: LoginData, emitUpdated: boolean): void;
|
|
43
|
+
orders(filter?: OrdersFilter): Promise<CustomerOrders>;
|
|
44
|
+
order(id: number): Promise<Order>;
|
|
43
45
|
}
|
|
46
|
+
export declare function customerProxy(customer: CustomerService): {
|
|
47
|
+
acceptEmailMarketing: boolean;
|
|
48
|
+
firstName: string;
|
|
49
|
+
id: number;
|
|
50
|
+
phone: string;
|
|
51
|
+
type: CustomerType;
|
|
52
|
+
isLogged: boolean;
|
|
53
|
+
myAccount: () => Promise<CustomerAccount>;
|
|
54
|
+
price: (productId: number) => Promise<any>;
|
|
55
|
+
order: (id: number) => Promise<Order>;
|
|
56
|
+
orders: (filter?: OrdersFilter) => Promise<CustomerOrders>;
|
|
57
|
+
subscribe: (cb: (customer: CustomerService) => void) => () => void;
|
|
58
|
+
};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -4,34 +4,16 @@ export declare enum AccountStatus {
|
|
|
4
4
|
BILLING = "billing",
|
|
5
5
|
ORDERS = "orders"
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
priceTaxBase: number;
|
|
11
|
-
product: OrderProduct;
|
|
12
|
-
quantity: number;
|
|
13
|
-
taxes: any;
|
|
14
|
-
};
|
|
15
|
-
export type OrderProduct = {
|
|
16
|
-
barcode: string;
|
|
17
|
-
category: {
|
|
18
|
-
id: number;
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
description: string;
|
|
7
|
+
interface InputOrderCustomer {
|
|
8
|
+
acceptEmailMarketing?: boolean;
|
|
9
|
+
email: string;
|
|
22
10
|
id: number;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
noShippingCost: boolean;
|
|
26
|
-
sku: string;
|
|
27
|
-
stockManagement: boolean;
|
|
28
|
-
url?: string;
|
|
29
|
-
weight: number;
|
|
30
|
-
};
|
|
11
|
+
phone: string;
|
|
12
|
+
}
|
|
31
13
|
export interface InputCartToOrder {
|
|
32
14
|
billingAddress?: BillingAddressType;
|
|
33
15
|
cartUuid: string;
|
|
34
|
-
customer:
|
|
16
|
+
customer: InputOrderCustomer;
|
|
35
17
|
customerOrder: string;
|
|
36
18
|
discounts: Discounts;
|
|
37
19
|
geolocation: any;
|
|
@@ -124,3 +106,4 @@ export type OrderPaymentMethodType = {
|
|
|
124
106
|
id: number;
|
|
125
107
|
name: string;
|
|
126
108
|
};
|
|
109
|
+
export {};
|