apirocket 0.9.1 → 0.9.3

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
@@ -2,13 +2,10 @@ import { Observable } from 'rxjs';
2
2
  import type { CartType, InputCartRemoveItem, InputCartUpdate, InputCartUpdateItem, OrderType } from '@src/types/types';
3
3
  import type { CustomerService } from '@src/services/customer.service';
4
4
  declare const ID_ESPANA = 199;
5
- export { cartRemoveItem, cartUpdate, cartUpdateItem, geolocation, myAccount, orderSummary, paymentMethods, shippingMethods, states, ID_ESPANA };
5
+ export { cartRemoveItem, cartUpdate, cartUpdateItem, geolocation, orderSummary, states, ID_ESPANA };
6
6
  declare const cartRemoveItem: (input: InputCartRemoveItem, customer: CustomerService) => Observable<CartType>;
7
7
  declare const cartUpdate: (input: InputCartUpdate, customer: CustomerService) => Observable<CartType>;
8
8
  declare const cartUpdateItem: (input: InputCartUpdateItem, customer: CustomerService) => Observable<CartType>;
9
9
  declare const orderSummary: (id: number, hash: string, customer: CustomerService) => Observable<OrderType>;
10
- declare const paymentMethods: (customer: CustomerService) => Observable<Array<PaymentMethodOption>>;
11
- declare const myAccount: (customer: CustomerService) => Observable<CustomerAccount>;
12
10
  declare const geolocation: () => Observable<any>;
13
11
  declare const states: (countryId: number, customer: CustomerService) => Observable<Array<StateType>>;
14
- declare const shippingMethods: (customer: CustomerService, cartUuid: string) => Observable<Array<ShippingMethodType> | false>;
@@ -12,8 +12,14 @@ export type QueryOptions = {
12
12
  retry?: number;
13
13
  };
14
14
  export { getApi, getEcommerce, post, postEcommerce, query };
15
- declare const getEcommerce: (url: string, data: any, customer: CustomerService | undefined) => Observable<AjaxResponse<any>>;
16
- declare const postEcommerce: <T>(url: string, data: any, customer?: CustomerService) => Observable<T>;
15
+ declare const getEcommerce: <T>(url: string, inputData: any, customer: CustomerService | undefined) => Observable<{
16
+ __errors: any;
17
+ status: number;
18
+ } & T>;
19
+ declare const postEcommerce: <T>(url: string, inputData: any, customer?: CustomerService) => Observable<{
20
+ __errors: any;
21
+ status: number;
22
+ } & T>;
17
23
  declare const post: <T>(url: string, data: any, customer?: CustomerService) => Observable<{
18
24
  __errors: any;
19
25
  status: number;
@@ -1,11 +1,14 @@
1
- export { account, asFloat, asInteger, backToShopping, buildQuery, cart, checkout, dataset, euroPrice, euros, millares, orderError, orderSummary, price, rememberPassword, round, signIn, storageAvailable };
2
- declare function buildQuery(data: {
1
+ export { account, asFloat, asInteger, backToShopping, buildQuery, cart, checkout, createAccount, dataset, euroPrice, euros, isBoolean, isNumber, isString, millares, orderError, orderSummary, price, rememberPassword, round, signIn, storageAvailable };
2
+ declare const buildQuery: (data: {
3
3
  [key: string]: any;
4
- }): string;
4
+ }) => string;
5
5
  declare const dataset: (element: HTMLElement, property: string) => any;
6
+ declare const euroPrice: (taxBase: number, taxAmount: number, pricesTaxIncluded: boolean, decimales: number, cero?: boolean) => string;
6
7
  declare const euros: (valor: number, decimales: number, cero?: boolean) => string;
8
+ declare const isBoolean: (value: any) => boolean;
9
+ declare const isNumber: (value: any) => number;
10
+ declare const isString: (value: any, defaultValue?: string) => string;
7
11
  declare const price: (taxBase: number, taxAmount: number, pricesTaxIncluded: boolean) => number;
8
- declare const euroPrice: (taxBase: number, taxAmount: number, pricesTaxIncluded: boolean, decimales: number, cero?: boolean) => string;
9
12
  declare const millares: (valor: number, decimales: number, cero?: boolean) => string;
10
13
  declare const asFloat: (value: string | number | Array<string> | undefined, decimales?: number) => number;
11
14
  declare const asInteger: (value: string | number | Array<string> | boolean | undefined) => number;
@@ -13,6 +16,7 @@ declare const round: (num: number, precision: number) => number;
13
16
  declare const storageAvailable: (type: "sessionStorage" | "localStorage") => boolean;
14
17
  declare const backToShopping: () => void;
15
18
  declare const cart: (fullScreen?: boolean) => void;
19
+ declare const createAccount: () => void;
16
20
  declare const signIn: () => void;
17
21
  declare const checkout: () => void;
18
22
  declare const rememberPassword: () => void;
@@ -2,12 +2,15 @@ import { Observable } from "rxjs";
2
2
  import { type FormControl } from "@e-xisto/form-control";
3
3
  import type { CustomerService } from "./customer.service";
4
4
  import type { ShippingAddress } from "@src/models/shipping-address.model";
5
+ import type { EcommerceService } from "./ecommerce.service";
5
6
  export declare class AccountService {
6
7
  #private;
7
8
  get myAccount$(): Observable<CustomerAccount>;
9
+ get myOrders$(): Observable<CustomerOrders>;
8
10
  constructor();
9
11
  setCustomerService(customer: CustomerService): void;
10
12
  updateShippingAddress(shippingAddress: ShippingAddress): void;
11
- personalForm(formElement: HTMLFormElement, accountService: AccountService, customerService: CustomerService): FormControl;
13
+ personalForm(formElement: HTMLFormElement, ecommerceService: EcommerceService, canUpdate: (canUpdate: boolean) => void): FormControl;
12
14
  private myAccountData;
15
+ private myOrderData;
13
16
  }
@@ -34,6 +34,7 @@ export declare class CustomerService {
34
34
  status: number;
35
35
  }>;
36
36
  private updateState;
37
- updateToken(data: LoginData): void;
38
37
  private getMyAccount;
38
+ updateToken(data: LoginData): void;
39
+ createAccount(form: FormControl): Promise<CreateAccountResponse>;
39
40
  }
@@ -1,3 +1,12 @@
1
+ export declare const EMPTY_PAYMENTMETHOD: PaymentMethod;
2
+ export declare const EMPTY_SHIPPINGMETHOD: {
3
+ id: number;
4
+ name: string;
5
+ taxBase: number;
6
+ taxAmount: number;
7
+ total: number;
8
+ paymentMethods: never[];
9
+ };
1
10
  export declare enum CheckoutStatus {
2
11
  INFO = "info",
3
12
  SHIPPING = "shipping",
@@ -2,9 +2,11 @@ import type { InputControl } from "@e-xisto/form-control";
2
2
  import type { PublicEcommerceService } from "./types";
3
3
  export declare enum EcommerceStatus {
4
4
  ACCOUNT = "#/my-account",
5
+ ACTIVATE_ACCOUNT = "#/activate-account",
5
6
  CART = "#/cart",
6
7
  CARTLEFT = "#/cart-left",
7
8
  CHECKOUT = "#/checkout",
9
+ CREATE_ACCOUNT = "#/create-account",
8
10
  NONE = "",
9
11
  SIGNIN = "#/signin",
10
12
  ORDER_SUMMARY = "#/order-summary",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apirocket",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": " ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",