apirocket 0.9.6 → 0.10.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/lib/api.d.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
- import type { CartType, InputCartRemoveItem, InputCartUpdate, InputCartUpdateItem, OrderType } from '@src/types/types';
3
2
  import type { CustomerService } from '@src/services/customer.service';
4
- declare const ID_ESPANA = 199;
5
- export { cartRemoveItem, cartUpdate, cartUpdateItem, geolocation, orderSummary, states, ID_ESPANA };
6
- declare const cartRemoveItem: (input: InputCartRemoveItem, customer: CustomerService) => Observable<CartType>;
7
- declare const cartUpdate: (input: InputCartUpdate, customer: CustomerService) => Observable<CartType>;
8
- declare const cartUpdateItem: (input: InputCartUpdateItem, customer: CustomerService) => Observable<CartType>;
9
- declare const orderSummary: (id: number, hash: string, customer: CustomerService) => Observable<OrderType>;
3
+ export { geolocation, getCountryId, states, };
10
4
  declare const geolocation: () => Observable<any>;
11
5
  declare const states: (countryId: number, customer: CustomerService) => Observable<Array<StateType>>;
6
+ declare const getCountryId: (countryIso: string) => Promise<number>;
@@ -1,4 +1,4 @@
1
- export { account, asFloat, asInteger, backToShopping, buildQuery, cart, checkout, createAccount, dataset, euroPrice, euros, isBoolean, isNumber, isString, millares, orderError, orderSummary, price, rememberPassword, round, signIn, storageAvailable };
1
+ export { account, asFloat, asInteger, backToShopping, buildQuery, cart, checkout, clearHtml, createAccount, dataset, euroPrice, euros, isBoolean, isNumber, isString, millares, orderError, orderSummary, price, rememberPassword, round, signIn, storageAvailable };
2
2
  declare const buildQuery: (data: {
3
3
  [key: string]: any;
4
4
  }) => string;
@@ -23,3 +23,4 @@ declare const rememberPassword: () => void;
23
23
  declare const orderError: () => void;
24
24
  declare const orderSummary: () => void;
25
25
  declare const account: () => void;
26
+ declare const clearHtml: (cadena: string) => string;
@@ -6,6 +6,7 @@ export declare class CartService {
6
6
  #private;
7
7
  readonly change$: Observable<CartService>;
8
8
  get count(): number;
9
+ get countryId(): number;
9
10
  get items(): Array<CartItem>;
10
11
  get lastOrder(): LastOrder;
11
12
  get numItems(): number;
@@ -20,20 +21,23 @@ export declare class CartService {
20
21
  private getItems;
21
22
  private restoreStorage;
22
23
  private saveStorage;
23
- setCustomerService(customer: CustomerService): void;
24
+ setServices(customer: CustomerService, checkout: CheckoutService): void;
24
25
  subscribe(cb: (cart: CartService) => void): () => void;
25
26
  private changeCart;
26
27
  add(data: CartItem): void;
27
28
  close(): void;
28
29
  open(fullScreen: boolean): void;
29
- orderSummary(id: number, hash: string): Observable<OrderType>;
30
+ orderSummary(id: number, hash: string): Observable<OrderType & {
31
+ __errors: any;
32
+ }>;
30
33
  addFromTarget(target: HTMLElement): void;
31
34
  private setStatus;
32
35
  clear(): void;
33
- remove(item: CartItem): Promise<void>;
34
- update(): Promise<void>;
35
- updateItem(item: CartItem, quantity: number): Promise<void>;
36
36
  private updateCart;
37
37
  cartToOrder(checkoutService: CheckoutService, customer: CustomerService): Observable<PaymentInfo>;
38
+ removeItem(item: CartItem): void;
39
+ updateItem(item: CartItem, quantity: number): void;
38
40
  private addItemCart;
41
+ setCountryId(countryId: number): void;
42
+ update(): void;
39
43
  }
@@ -21,6 +21,7 @@ export declare class CheckoutService {
21
21
  get steps(): Set<CheckoutStatus>;
22
22
  get taxAmount(): number;
23
23
  get total(): number;
24
+ private getShippingAddress;
24
25
  constructor(cartService: CartService, customer: CustomerService);
25
26
  private saveStorage;
26
27
  setStatus(newStatus: CheckoutStatus): void;
@@ -19,7 +19,7 @@ export declare class EcommerceService {
19
19
  signIn(): void;
20
20
  close(): void;
21
21
  rememberPassword(): void;
22
- config(value: EcommerceConfig): void;
23
22
  updateEvents(): void;
24
23
  private ready;
24
+ config(value: EcommerceConfig): Promise<void>;
25
25
  }
@@ -77,6 +77,7 @@ export type CartType = {
77
77
  taxAmount: number;
78
78
  taxBase: number;
79
79
  total: number;
80
+ units: number;
80
81
  uuid: string;
81
82
  };
82
83
  export type CartStatus = 'loaded' | 'loading';
@@ -99,6 +100,7 @@ export type InputCartRemoveItem = {
99
100
  customerId?: number;
100
101
  email?: string;
101
102
  itemUuid: string;
103
+ priceTaxIncluded?: boolean;
102
104
  };
103
105
  export type InputCartUpdateItem = {
104
106
  cartUuid: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apirocket",
3
- "version": "0.9.6",
3
+ "version": "0.10.0",
4
4
  "description": " ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- export declare const ADDRESS = "{\n address\n address2\n city\n country {\n id\n name\n }\n firstName\n lastName\n postalCode\n state {\n id\n name\n }\n}";
2
- export declare const BILLING_ADDRESS = "{\n address\n address2\n city\n country {\n id\n name\n }\n name\n postalCode\n state {\n id\n name\n }\n taxCode\n}\n";
3
- export declare const CART_RESPONSE: string;
4
- export declare const ORDER_CUSTOMER = "\n{\n email\n id\n phone\n}\n";
5
- export declare const ORDER_ITEM: string;
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}";