apirocket 0.5.7 → 0.6.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/dist/ecommerce.css +48 -3
- package/dist/ecommerce.js +1 -1
- package/dist/lib/api-models.d.ts +1 -1
- package/dist/lib/api.d.ts +1 -2
- package/dist/lib/utils.d.ts +3 -1
- package/dist/services/account.service.d.ts +2 -0
- package/dist/services/cart.service.d.ts +10 -10
- package/dist/services/checkout.service.d.ts +11 -7
- package/dist/types/types.d.ts +77 -21
- package/package.json +1 -1
- package/dist/types/order.d.ts +0 -25
package/dist/lib/api-models.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export declare const CART_RESPONSE: string;
|
|
|
4
4
|
export declare const ORDER_CUSTOMER = "\n{\n email\n id\n phone\n}\n";
|
|
5
5
|
export declare const ORDER_ITEM: string;
|
|
6
6
|
export declare const ORDER_PAYMENT = "{\n authorization\n method {\n id\n name\n }\n}";
|
|
7
|
-
export declare const ORDER_SHIPPING = "{\n description,\n id\n name\n taxBase\n taxAmount\n
|
|
7
|
+
export declare const ORDER_SHIPPING = "{\n description,\n id\n name\n taxBase\n taxAmount\n}";
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { CartType, InputCartAddItem, InputCartRemoveItem, InputCartToOrderType, InputCartUpdate, InputCartUpdateItem } from '@src/types/types';
|
|
2
|
-
import type { OrderType } from '@src/types/order';
|
|
1
|
+
import type { CartType, InputCartAddItem, InputCartRemoveItem, InputCartToOrderType, InputCartUpdate, InputCartUpdateItem, OrderType } from '@src/types/types';
|
|
3
2
|
import type { CustomerService } from '@src/services/customer.service';
|
|
4
3
|
import { type Observable } from 'rxjs';
|
|
5
4
|
declare const ID_ESPANA = 199;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare const dataset: (element: HTMLElement, property: string) => any;
|
|
2
2
|
declare const euros: (valor: number, decimales: number, cero?: boolean) => string;
|
|
3
|
+
declare const price: (taxBase: number, taxAmount: number, pricesTaxIncluded: boolean) => number;
|
|
4
|
+
declare const euroPrice: (taxBase: number, taxAmount: number, pricesTaxIncluded: boolean, decimales: number, cero?: boolean) => string;
|
|
3
5
|
declare const millares: (valor: number, decimales: number, cero?: boolean) => string;
|
|
4
6
|
declare const asFloat: (value: string | number | Array<string> | undefined, decimales?: number) => number;
|
|
5
7
|
declare const asInteger: (value: string | number | Array<string> | boolean | undefined) => number;
|
|
@@ -14,4 +16,4 @@ declare const orderError: () => void;
|
|
|
14
16
|
declare const orderSummary: () => void;
|
|
15
17
|
declare const payment: () => void;
|
|
16
18
|
declare const account: () => void;
|
|
17
|
-
export { account, asFloat, asInteger, backToShopping, cart, checkout, dataset, euros, millares, orderError, orderSummary, payment, rememberPassword, round, signIn, storageAvailable };
|
|
19
|
+
export { account, asFloat, asInteger, backToShopping, cart, checkout, dataset, euroPrice, euros, millares, orderError, orderSummary, payment, price, rememberPassword, round, signIn, storageAvailable };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { type FormControl } from "@e-xisto/form-control";
|
|
3
3
|
import type { CustomerService } from "./customer.service";
|
|
4
|
+
import type { ShippingAddress } from "@src/models/shipping-address.model";
|
|
4
5
|
export declare class AccountService {
|
|
5
6
|
#private;
|
|
6
7
|
get myAccount$(): Observable<CustomerAccount>;
|
|
7
8
|
constructor();
|
|
8
9
|
setCustomerService(customer: CustomerService): void;
|
|
10
|
+
updateShippingAddress(shippingAddress: ShippingAddress): void;
|
|
9
11
|
personalForm(formElement: HTMLFormElement, accountService: AccountService, customerService: CustomerService): FormControl;
|
|
10
12
|
private myAccountData;
|
|
11
13
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import type { CustomerService } from './customer.service';
|
|
3
3
|
import type { CheckoutService } from "./checkout.service";
|
|
4
|
-
import type {
|
|
5
|
-
import type { OrderType } from "@src/types/order";
|
|
4
|
+
import type { CartItem, CartStatus, LastOrder, OrderType } from "@src/types/types";
|
|
6
5
|
export declare class CartService {
|
|
7
6
|
#private;
|
|
8
7
|
readonly change$: Observable<CartService>;
|
|
9
8
|
get count(): number;
|
|
10
|
-
get items(): Array<
|
|
9
|
+
get items(): Array<CartItem>;
|
|
11
10
|
get lastOrder(): LastOrder;
|
|
12
11
|
get numItems(): number;
|
|
13
12
|
get status(): CartStatus;
|
|
13
|
+
get taxAmount(): number;
|
|
14
14
|
get taxBase(): number;
|
|
15
15
|
get total(): number;
|
|
16
16
|
get units(): number;
|
|
17
17
|
get uuid(): string;
|
|
18
18
|
constructor();
|
|
19
|
+
clearOrder(lastOrderId: number, lastOrderHash: string): void;
|
|
19
20
|
private getItems;
|
|
20
|
-
remove(item: CartItemType): Promise<void>;
|
|
21
21
|
private restoreStorage;
|
|
22
22
|
private saveStorage;
|
|
23
23
|
setCustomerService(customer: CustomerService): void;
|
|
24
24
|
subscribe(cb: (cart: CartService) => void): () => void;
|
|
25
|
-
update(): Promise<void>;
|
|
26
|
-
updateItem(item: CartItemType, quantity: number): Promise<void>;
|
|
27
25
|
private changeCart;
|
|
28
|
-
add(data:
|
|
26
|
+
add(data: CartItem): void;
|
|
29
27
|
close(): void;
|
|
30
28
|
open(fullScreen: boolean): void;
|
|
31
|
-
private updateCart;
|
|
32
|
-
setPayment(lastOrderId: number, lastOrderHash: string): void;
|
|
33
29
|
orderSummary(id: number, hash: string): Observable<OrderType>;
|
|
34
30
|
addFromTarget(target: HTMLElement): void;
|
|
35
31
|
private setStatus;
|
|
36
32
|
clear(): void;
|
|
37
|
-
|
|
33
|
+
remove(item: CartItem): Promise<void>;
|
|
34
|
+
update(): Promise<void>;
|
|
35
|
+
updateItem(item: CartItem, quantity: number): Promise<void>;
|
|
36
|
+
private updateCart;
|
|
37
|
+
cartToOrder(checkoutService: CheckoutService): Observable<PaymentInfoType>;
|
|
38
38
|
private addItemCart;
|
|
39
39
|
}
|
|
@@ -10,16 +10,24 @@ export declare class CheckoutService {
|
|
|
10
10
|
#private;
|
|
11
11
|
readonly change$: Observable<CheckoutService>;
|
|
12
12
|
get billingAddress(): BillingAddress;
|
|
13
|
+
get customerOrder(): string;
|
|
14
|
+
get notes(): string;
|
|
13
15
|
get paymentAddress(): boolean;
|
|
14
16
|
get paymentMethod(): PaymentMethod;
|
|
15
17
|
get status(): CheckoutStatus;
|
|
16
18
|
get shippingAddress(): ShippingAddress;
|
|
17
19
|
get shippingMethod(): ShippingMethodType;
|
|
18
20
|
get steps(): Set<CheckoutStatus>;
|
|
21
|
+
get taxAmount(): number;
|
|
19
22
|
get total(): number;
|
|
20
23
|
constructor(cartService: CartService, customer: CustomerService);
|
|
21
24
|
private saveStorage;
|
|
22
25
|
setStatus(newStatus: CheckoutStatus): void;
|
|
26
|
+
private restoreStorage;
|
|
27
|
+
shippingAddressForm(formElement: HTMLFormElement, customerService: CustomerService, account: AccountService): Observable<{
|
|
28
|
+
form: FormControl;
|
|
29
|
+
addresses: Array<AccountShippingAddress>;
|
|
30
|
+
}>;
|
|
23
31
|
formSignIn(form: HTMLFormElement): FormControl;
|
|
24
32
|
signInSubmit(_form: FormControl): void;
|
|
25
33
|
close(): void;
|
|
@@ -28,19 +36,15 @@ export declare class CheckoutService {
|
|
|
28
36
|
paymentForm(formElement: HTMLFormElement, paymentMethods: Array<PaymentMethodOption>): FormControl;
|
|
29
37
|
shippingMethodForm(formElement: HTMLFormElement, shippingMethods: Array<ShippingMethodType>): FormControl;
|
|
30
38
|
shippingMethodSet(form: FormControl, methods: Array<ShippingMethodType>, cartService: CartService, gotoPayment: boolean): void;
|
|
31
|
-
private restoreStorage;
|
|
32
39
|
shippingMethods(): Observable<Array<ShippingMethodType>>;
|
|
33
40
|
updateTotal(cartService: CartService): void;
|
|
34
41
|
resetPassword(form: FormControl): void;
|
|
35
|
-
private shippingAddressSelect;
|
|
36
|
-
shippingAddressForm(formElement: HTMLFormElement, customerService: CustomerService, account: AccountService): Observable<{
|
|
37
|
-
form: FormControl;
|
|
38
|
-
addresses: Array<AccountShippingAddress>;
|
|
39
|
-
}>;
|
|
40
|
-
shippingAddressSet(form: FormControl, customerService: CustomerService): void;
|
|
41
42
|
private otherShippingAddress;
|
|
42
43
|
stripeSettings(methodId: number): Observable<StripeSettings>;
|
|
43
44
|
paymentSet(form: FormControl, payments: Array<PaymentMethodOption>): Observable<any>;
|
|
44
45
|
stripePayment(orderId: number, hash: string): Observable<any>;
|
|
45
46
|
stripePaymentConfirm(orderId: number, paymentId: string): Observable<any>;
|
|
47
|
+
private shippingAddressSelect;
|
|
48
|
+
shippingAddressSet(form: FormControl, customerService: CustomerService, account: AccountService): void;
|
|
49
|
+
clearOrder(): void;
|
|
46
50
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface InputCartToOrderType {
|
|
3
|
-
billingAddress?: BillingAddressType;
|
|
4
|
-
cartUuid: string;
|
|
5
|
-
customer: OrderCustomer;
|
|
6
|
-
customerId?: number;
|
|
7
|
-
email?: string;
|
|
8
|
-
notes: string;
|
|
9
|
-
numItems: number;
|
|
10
|
-
paymentMethod: OrderPaymentMethodType;
|
|
11
|
-
shippingAddress: AddressType;
|
|
12
|
-
shippingMethod: InputShippingMethodType;
|
|
13
|
-
units: number;
|
|
14
|
-
total: number;
|
|
15
|
-
}
|
|
16
|
-
export type CartItemType = {
|
|
17
|
-
price: number;
|
|
1
|
+
export type CartItem = {
|
|
18
2
|
product: {
|
|
19
3
|
barcode: string;
|
|
20
4
|
category: {
|
|
@@ -33,14 +17,55 @@ export type CartItemType = {
|
|
|
33
17
|
};
|
|
34
18
|
itemPrice: {
|
|
35
19
|
comparePrice: number;
|
|
36
|
-
|
|
20
|
+
taxBase: number;
|
|
37
21
|
taxAmount: number;
|
|
38
22
|
};
|
|
23
|
+
priceTaxBase: number;
|
|
24
|
+
priceTaxAmount: number;
|
|
39
25
|
quantity: number;
|
|
40
26
|
uuid: string;
|
|
41
27
|
};
|
|
28
|
+
export type OrderItem = {
|
|
29
|
+
id: number;
|
|
30
|
+
priceTaxAmount: number;
|
|
31
|
+
priceTaxBase: number;
|
|
32
|
+
product: OrderProduct;
|
|
33
|
+
quantity: number;
|
|
34
|
+
taxes: any;
|
|
35
|
+
};
|
|
36
|
+
export type OrderProduct = {
|
|
37
|
+
barcode: string;
|
|
38
|
+
category: {
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
description: string;
|
|
43
|
+
id: number;
|
|
44
|
+
image: string;
|
|
45
|
+
name: string;
|
|
46
|
+
noShippingCost: boolean;
|
|
47
|
+
sku: string;
|
|
48
|
+
stockManagement: boolean;
|
|
49
|
+
url?: string;
|
|
50
|
+
weight: number;
|
|
51
|
+
};
|
|
52
|
+
export interface InputCartToOrderType {
|
|
53
|
+
billingAddress?: BillingAddressType;
|
|
54
|
+
cartUuid: string;
|
|
55
|
+
customer: OrderCustomer;
|
|
56
|
+
customerOrder: string;
|
|
57
|
+
notes: string;
|
|
58
|
+
numItems: number;
|
|
59
|
+
paymentMethod: OrderPaymentMethodType;
|
|
60
|
+
pricesTaxIncluded: boolean;
|
|
61
|
+
shippingAddress: AddressType;
|
|
62
|
+
shippingMethod: InputShippingMethodType;
|
|
63
|
+
units: number;
|
|
64
|
+
total: number;
|
|
65
|
+
}
|
|
42
66
|
export type CartType = {
|
|
43
|
-
items: Array<
|
|
67
|
+
items: Array<CartItem>;
|
|
68
|
+
taxAmount: number;
|
|
44
69
|
taxBase: number;
|
|
45
70
|
total: number;
|
|
46
71
|
uuid: string;
|
|
@@ -53,8 +78,9 @@ export type LastOrder = {
|
|
|
53
78
|
};
|
|
54
79
|
export type InputCartAddItem = {
|
|
55
80
|
cartUuid: string;
|
|
56
|
-
customerId
|
|
57
|
-
email
|
|
81
|
+
customerId: number;
|
|
82
|
+
email: string;
|
|
83
|
+
pricesTaxIncluded: boolean;
|
|
58
84
|
productId: number;
|
|
59
85
|
quantity: number;
|
|
60
86
|
url?: string;
|
|
@@ -83,3 +109,33 @@ export type PublicEcommerceService = {
|
|
|
83
109
|
config: (value: EcommerceConfig) => void;
|
|
84
110
|
updateEvents: () => void;
|
|
85
111
|
};
|
|
112
|
+
export interface OrderType {
|
|
113
|
+
billingAddress: BillingAddressType;
|
|
114
|
+
cartTaxAmount: number;
|
|
115
|
+
cartTaxBase: number;
|
|
116
|
+
customer: OrderCustomer;
|
|
117
|
+
date: Date;
|
|
118
|
+
hash: string;
|
|
119
|
+
id: number;
|
|
120
|
+
items: Array<OrderItem>;
|
|
121
|
+
notes: string;
|
|
122
|
+
number: string;
|
|
123
|
+
payment: OrderPaymentType;
|
|
124
|
+
pricesTaxIncluded: boolean;
|
|
125
|
+
shippingAddress: ShippingAddressType;
|
|
126
|
+
shippingMethod: ShippingMethodType;
|
|
127
|
+
total: number;
|
|
128
|
+
totalTaxAmount: number;
|
|
129
|
+
totalTaxBase: number;
|
|
130
|
+
}
|
|
131
|
+
export interface OrderPaymentType {
|
|
132
|
+
authorization: string;
|
|
133
|
+
method: {
|
|
134
|
+
id: number;
|
|
135
|
+
name: string;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export type OrderPaymentMethodType = {
|
|
139
|
+
id: number;
|
|
140
|
+
name: string;
|
|
141
|
+
};
|
package/package.json
CHANGED
package/dist/types/order.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface OrderType {
|
|
2
|
-
billingAddress: BillingAddressType;
|
|
3
|
-
customer: OrderCustomer;
|
|
4
|
-
date: Date;
|
|
5
|
-
hash: string;
|
|
6
|
-
id: number;
|
|
7
|
-
items: any;
|
|
8
|
-
notes: string;
|
|
9
|
-
number: string;
|
|
10
|
-
payment: OrderPaymentType;
|
|
11
|
-
shippingAddress: ShippingAddressType;
|
|
12
|
-
shippingMethod: ShippingMethodType;
|
|
13
|
-
total: number;
|
|
14
|
-
}
|
|
15
|
-
export interface OrderPaymentType {
|
|
16
|
-
authorization: string;
|
|
17
|
-
method: {
|
|
18
|
-
id: number;
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export type OrderPaymentMethodType = {
|
|
23
|
-
id: number;
|
|
24
|
-
name: string;
|
|
25
|
-
};
|