apirocket 0.4.3 → 0.5.0
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/config.d.ts +1 -0
- package/dist/ecommerce.js +1 -2
- package/dist/lib/api.d.ts +16 -13
- package/dist/lib/graphql.d.ts +11 -4
- package/dist/lib/utils.d.ts +2 -1
- package/dist/models/checkout-address.model.d.ts +1 -0
- package/dist/services/account.service.d.ts +3 -2
- package/dist/services/cart.service.d.ts +1 -1
- package/dist/services/checkout.service.d.ts +10 -4
- package/dist/services/customer.service.d.ts +5 -2
- package/dist/types/types.d.ts +1 -9
- package/package.json +1 -1
package/dist/lib/api.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import type { InputCartAddItem, InputCartRemoveItem, InputCartToOrderType, InputCartUpdate, InputCartUpdateItem } from '@src/types/types';
|
|
1
|
+
import type { CartType, InputCartAddItem, InputCartRemoveItem, InputCartToOrderType, InputCartUpdate, InputCartUpdateItem } from '@src/types/types';
|
|
2
|
+
import type { OrderType } from '@src/types/order';
|
|
3
|
+
import type { CustomerService } from '@src/services/customer.service';
|
|
4
|
+
import { type Observable } from 'rxjs';
|
|
2
5
|
declare const ID_ESPANA = 199;
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
6
|
+
declare const cartToOrder: (input: InputCartToOrderType, customer: CustomerService) => Observable<OrderType>;
|
|
7
|
+
declare const paymentInfo: (id: number, hash: string) => Observable<PaymentInfoType>;
|
|
8
|
+
declare const cartAddItem: (input: InputCartAddItem, customer: CustomerService) => Observable<CartType>;
|
|
9
|
+
declare const cartRemoveItem: (input: InputCartRemoveItem, customer: CustomerService) => Observable<CartType>;
|
|
10
|
+
declare const cartUpdate: (input: InputCartUpdate, customer: CustomerService) => Observable<CartType>;
|
|
11
|
+
declare const cartUpdateItem: (input: InputCartUpdateItem, customer: CustomerService) => Observable<CartType>;
|
|
12
|
+
declare const countries: (customer: CustomerService) => Observable<Array<CountryType>>;
|
|
13
|
+
declare const provinces: (country: number, customer: CustomerService) => Observable<Array<ProvinceType>>;
|
|
9
14
|
export { cartAddItem, cartRemoveItem, cartToOrder, cartUpdate, cartUpdateItem, countries, myAccount, orderSummary, paymentMethods, paymentInfo, provinces, shippingMethods, ID_ESPANA };
|
|
10
|
-
declare const orderSummary: (id: number, hash: string) => Observable<
|
|
11
|
-
declare const shippingMethods: () => Observable<
|
|
12
|
-
declare const paymentMethods: () => Observable<
|
|
13
|
-
declare const
|
|
14
|
-
declare const paymentInfo: (id: number, hash: string) => Observable<T[] & QueryErrors>;
|
|
15
|
-
declare const myAccount: (token: string) => Observable<T[] & QueryErrors>;
|
|
15
|
+
declare const orderSummary: (id: number, hash: string, customer: CustomerService) => Observable<OrderType>;
|
|
16
|
+
declare const shippingMethods: (customer: CustomerService) => Observable<Array<ShippingMethodType>>;
|
|
17
|
+
declare const paymentMethods: (customer: CustomerService) => Observable<Array<PaymentMethodOption>>;
|
|
18
|
+
declare const myAccount: (customer: CustomerService) => Observable<CustomerAccount>;
|
package/dist/lib/graphql.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { AjaxResponse } from 'rxjs/ajax';
|
|
2
2
|
import { Observable } from 'rxjs/internal/Observable';
|
|
3
|
+
import type { CustomerService } from '@src/services/customer.service';
|
|
4
|
+
export type QueryErrors = {
|
|
5
|
+
__errors?: Array<string>;
|
|
6
|
+
};
|
|
7
|
+
export type QueryVariables = {
|
|
8
|
+
[index: string]: any;
|
|
9
|
+
};
|
|
3
10
|
export type QueryOptions = {
|
|
4
11
|
debug?: boolean;
|
|
5
|
-
|
|
12
|
+
retry?: number;
|
|
6
13
|
};
|
|
7
|
-
export declare const post: <T>(url: string, data: any,
|
|
14
|
+
export declare const post: <T>(url: string, data: any, customer?: CustomerService) => Observable<{
|
|
8
15
|
__errors: any;
|
|
9
16
|
status: number;
|
|
10
17
|
} & T>;
|
|
11
|
-
export declare const get: (url: string, data: any,
|
|
12
|
-
export declare const query: <T>(query: string, variables
|
|
18
|
+
export declare const get: (url: string, data: any, customer: CustomerService) => Observable<AjaxResponse<any>>;
|
|
19
|
+
export declare const query: <T>(query: string, variables: QueryVariables, customer?: CustomerService) => Observable<T>;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ declare const cart: (fullScreen?: boolean) => void;
|
|
|
9
9
|
declare const signIn: () => void;
|
|
10
10
|
declare const checkout: () => void;
|
|
11
11
|
declare const rememberPassword: () => void;
|
|
12
|
+
declare const orderError: () => void;
|
|
12
13
|
declare const orderSummary: () => void;
|
|
13
14
|
declare const payment: () => void;
|
|
14
15
|
declare const account: () => void;
|
|
15
|
-
export { account, asFloat, asInteger, backToShopping, cart, checkout, dataset, millares, orderSummary, payment, rememberPassword, round, signIn, storageAvailable };
|
|
16
|
+
export { account, asFloat, asInteger, backToShopping, cart, checkout, dataset, millares, orderError, orderSummary, payment, rememberPassword, round, signIn, storageAvailable };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
1
2
|
import { type FormControl } from "@e-xisto/form-control";
|
|
2
3
|
import type { CustomerService } from "./customer.service";
|
|
3
|
-
import { Observable } from "rxjs";
|
|
4
4
|
export declare class AccountService {
|
|
5
5
|
#private;
|
|
6
|
+
get myAccount$(): Observable<CustomerAccount>;
|
|
6
7
|
constructor();
|
|
7
8
|
setCustomerService(customer: CustomerService): void;
|
|
8
9
|
personalForm(formElement: HTMLFormElement, accountService: AccountService, customerService: CustomerService): FormControl;
|
|
9
|
-
|
|
10
|
+
private myAccountData;
|
|
10
11
|
}
|
|
@@ -34,6 +34,6 @@ export declare class CartService {
|
|
|
34
34
|
addFromTarget(target: HTMLElement): void;
|
|
35
35
|
private setStatus;
|
|
36
36
|
clear(): void;
|
|
37
|
-
cartToOrder(customerService: CustomerService, checkoutService: CheckoutService):
|
|
37
|
+
cartToOrder(customerService: CustomerService, checkoutService: CheckoutService): Observable<PaymentInfoType>;
|
|
38
38
|
private addItemCart;
|
|
39
39
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Observable } from 'rxjs/internal/Observable';
|
|
2
2
|
import type { FormControl } from "@e-xisto/form-control";
|
|
3
3
|
import type { CartService } from '@src/services/cart.service';
|
|
4
|
+
import type { AccountService } from './account.service';
|
|
5
|
+
import type { CustomerService } from './customer.service';
|
|
4
6
|
import { CheckoutStatus } from '@src/types/checkout.type';
|
|
5
7
|
import { ShippingAddress } from "@src/models/shipping-address.model";
|
|
6
8
|
import { BillingAddress } from '@src/models/billing-address.model';
|
|
7
|
-
import type { CustomerService } from './customer.service';
|
|
8
9
|
export declare class CheckoutService {
|
|
9
10
|
#private;
|
|
10
11
|
readonly change$: Observable<CheckoutService>;
|
|
@@ -16,7 +17,7 @@ export declare class CheckoutService {
|
|
|
16
17
|
get shippingMethod(): ShippingMethodType;
|
|
17
18
|
get steps(): Set<CheckoutStatus>;
|
|
18
19
|
get total(): number;
|
|
19
|
-
constructor(cartService: CartService);
|
|
20
|
+
constructor(cartService: CartService, customer: CustomerService);
|
|
20
21
|
private saveStorage;
|
|
21
22
|
setStatus(newStatus: CheckoutStatus): void;
|
|
22
23
|
formSignIn(form: HTMLFormElement): FormControl;
|
|
@@ -32,6 +33,11 @@ export declare class CheckoutService {
|
|
|
32
33
|
updateTotal(cartService: CartService): void;
|
|
33
34
|
paymentSet(form: FormControl, payments: Array<PaymentMethodOption>): void;
|
|
34
35
|
resetPassword(form: FormControl): void;
|
|
35
|
-
|
|
36
|
+
private shippingAddressSelect;
|
|
37
|
+
shippingAddressForm(formElement: HTMLFormElement, customerService: CustomerService, account: AccountService): Observable<{
|
|
38
|
+
form: FormControl;
|
|
39
|
+
addresses: Array<AccountShippingAddress>;
|
|
40
|
+
}>;
|
|
36
41
|
shippingAddressSet(form: FormControl, customerService: CustomerService): void;
|
|
42
|
+
private otherShippingAddress;
|
|
37
43
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs/internal/Observable';
|
|
2
2
|
import type { FormControl } from "@e-xisto/form-control";
|
|
3
3
|
import type { CartService } from "./cart.service";
|
|
4
|
-
import { CustomerType } from "@src/types/types";
|
|
4
|
+
import type { CustomerType } from "@src/types/types";
|
|
5
5
|
export declare class CustomerService {
|
|
6
6
|
#private;
|
|
7
7
|
readonly change$: Observable<CustomerService>;
|
|
@@ -11,6 +11,8 @@ export declare class CustomerService {
|
|
|
11
11
|
get id(): number;
|
|
12
12
|
get lastName(): string;
|
|
13
13
|
get phone(): string;
|
|
14
|
+
get refreshToken(): string;
|
|
15
|
+
get token(): string;
|
|
14
16
|
get type(): CustomerType;
|
|
15
17
|
constructor();
|
|
16
18
|
private changeCustomer;
|
|
@@ -19,7 +21,6 @@ export declare class CustomerService {
|
|
|
19
21
|
private saveState;
|
|
20
22
|
setCartService(cart: CartService): void;
|
|
21
23
|
subscribe(cb: (customer: CustomerService) => void): () => void;
|
|
22
|
-
token(): Promise<string | undefined>;
|
|
23
24
|
price(productId: number): Promise<any>;
|
|
24
25
|
logout(): Promise<{
|
|
25
26
|
status: number;
|
|
@@ -28,4 +29,6 @@ export declare class CustomerService {
|
|
|
28
29
|
login(form: FormControl): Promise<{
|
|
29
30
|
status: number;
|
|
30
31
|
}>;
|
|
32
|
+
private updateState;
|
|
33
|
+
updateToken(data: LoginData): void;
|
|
31
34
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface InputCartToOrderType {
|
|
|
11
11
|
shippingAddress: AddressType;
|
|
12
12
|
shippingMethod: InputShippingMethodType;
|
|
13
13
|
units: number;
|
|
14
|
-
token?: string;
|
|
15
14
|
total: number;
|
|
16
15
|
}
|
|
17
16
|
export type CartItemType = {
|
|
@@ -47,10 +46,7 @@ export type CartType = {
|
|
|
47
46
|
uuid: string;
|
|
48
47
|
};
|
|
49
48
|
export type CartStatus = 'loaded' | 'loading';
|
|
50
|
-
export
|
|
51
|
-
B2C = 0,
|
|
52
|
-
B2B = 1
|
|
53
|
-
}
|
|
49
|
+
export type CustomerType = 'B2C' | 'B2B';
|
|
54
50
|
export type LastOrder = {
|
|
55
51
|
id: number;
|
|
56
52
|
hash: string;
|
|
@@ -62,14 +58,12 @@ export type InputCartAddItem = {
|
|
|
62
58
|
productId: number;
|
|
63
59
|
quantity: number;
|
|
64
60
|
url?: string;
|
|
65
|
-
token?: string;
|
|
66
61
|
};
|
|
67
62
|
export type InputCartRemoveItem = {
|
|
68
63
|
cartUuid: string;
|
|
69
64
|
customerId?: number;
|
|
70
65
|
email?: string;
|
|
71
66
|
itemUuid: string;
|
|
72
|
-
token?: string;
|
|
73
67
|
};
|
|
74
68
|
export type InputCartUpdateItem = {
|
|
75
69
|
cartUuid: string;
|
|
@@ -77,13 +71,11 @@ export type InputCartUpdateItem = {
|
|
|
77
71
|
email?: string;
|
|
78
72
|
itemUuid: string;
|
|
79
73
|
quantity: number;
|
|
80
|
-
token?: string;
|
|
81
74
|
};
|
|
82
75
|
export type InputCartUpdate = {
|
|
83
76
|
cartUuid: string;
|
|
84
77
|
customerId?: number;
|
|
85
78
|
email?: string;
|
|
86
|
-
token?: string;
|
|
87
79
|
};
|
|
88
80
|
export type PublicEcommerceService = {
|
|
89
81
|
customer: any;
|