apirocket 0.8.2 → 0.9.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.
@@ -1,5 +1,5 @@
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 province {\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 province {\n id\n name\n }\n taxCode\n}\n";
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
3
  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;
package/dist/lib/api.d.ts CHANGED
@@ -1,14 +1,14 @@
1
+ import { Observable } from 'rxjs';
1
2
  import type { CartType, InputCartRemoveItem, InputCartUpdate, InputCartUpdateItem, OrderType } from '@src/types/types';
2
3
  import type { CustomerService } from '@src/services/customer.service';
3
- import { Observable } from 'rxjs';
4
4
  declare const ID_ESPANA = 199;
5
- export { cartRemoveItem, cartUpdate, cartUpdateItem, countries, myAccount, orderSummary, paymentMethods, provinces, shippingMethods, ID_ESPANA };
5
+ export { cartRemoveItem, cartUpdate, cartUpdateItem, geolocation, myAccount, orderSummary, paymentMethods, shippingMethods, 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
- declare const countries: (customer: CustomerService) => Observable<Array<CountryType>>;
10
- declare const provinces: (country: number, customer: CustomerService) => Observable<Array<ProvinceType>>;
11
9
  declare const orderSummary: (id: number, hash: string, customer: CustomerService) => Observable<OrderType>;
12
- declare const shippingMethods: (customer: CustomerService) => Observable<Array<ShippingMethodType>>;
13
10
  declare const paymentMethods: (customer: CustomerService) => Observable<Array<PaymentMethodOption>>;
14
11
  declare const myAccount: (customer: CustomerService) => Observable<CustomerAccount>;
12
+ declare const geolocation: () => Observable<any>;
13
+ declare const states: (countryId: number, customer: CustomerService) => Observable<Array<StateType>>;
14
+ declare const shippingMethods: (customer: CustomerService, cartUuid: string) => Observable<Array<ShippingMethodType> | false>;
@@ -11,10 +11,12 @@ export type QueryOptions = {
11
11
  debug?: boolean;
12
12
  retry?: number;
13
13
  };
14
- export declare const post: <T>(url: string, data: any, customer?: CustomerService) => Observable<{
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>;
17
+ declare const post: <T>(url: string, data: any, customer?: CustomerService) => Observable<{
15
18
  __errors: any;
16
19
  status: number;
17
20
  } & T>;
18
- export declare const get: (url: string, data: any, customer: CustomerService | undefined) => Observable<AjaxResponse<any>>;
19
- export declare const query: <T>(query: string, variables: QueryVariables, customer?: CustomerService) => Observable<T>;
20
- export declare const postEcommerce: <T>(url: string, data: any, customer?: CustomerService) => Observable<T>;
21
+ declare const query: <T>(query: string, variables: QueryVariables, customer?: CustomerService) => Observable<T>;
22
+ declare const getApi: (url: string, data: any, customer: CustomerService | undefined) => Observable<AjaxResponse<any>>;
@@ -1,3 +1,7 @@
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: {
3
+ [key: string]: any;
4
+ }): string;
1
5
  declare const dataset: (element: HTMLElement, property: string) => any;
2
6
  declare const euros: (valor: number, decimales: number, cero?: boolean) => string;
3
7
  declare const price: (taxBase: number, taxAmount: number, pricesTaxIncluded: boolean) => number;
@@ -14,6 +18,4 @@ declare const checkout: () => void;
14
18
  declare const rememberPassword: () => void;
15
19
  declare const orderError: () => void;
16
20
  declare const orderSummary: () => void;
17
- declare const payment: () => void;
18
21
  declare const account: () => void;
19
- export { account, asFloat, asInteger, backToShopping, cart, checkout, dataset, euroPrice, euros, millares, orderError, orderSummary, payment, price, rememberPassword, round, signIn, storageAvailable };
@@ -5,7 +5,7 @@ declare class CheckoutAddress implements AddressType {
5
5
  city?: string;
6
6
  country?: CountryType;
7
7
  id: number;
8
- province?: ProvinceType;
8
+ state?: StateType;
9
9
  postalCode?: string;
10
10
  protected constructor(values: AddressType);
11
11
  private getFullAddress;
@@ -38,13 +38,12 @@ export declare class CheckoutService {
38
38
  shippingMethodForm(formElement: HTMLFormElement, shippingMethods: Array<ShippingMethodType>): FormControl;
39
39
  shippingMethodSet(form: FormControl, methods: Array<ShippingMethodType>, cartService: CartService, gotoPayment: boolean): void;
40
40
  changeShippingMethod(cartService: CartService, methods: Array<ShippingMethodType>, shippingMethodId: number): void;
41
- shippingMethods(): Observable<Array<ShippingMethodType>>;
42
41
  resetPassword(form: FormControl): void;
43
42
  private otherShippingAddress;
44
43
  stripeSettings(methodId: number): Observable<StripeSettings>;
45
44
  paymentSet(form: FormControl, payments: Array<PaymentMethodOption>): Observable<any>;
46
45
  stripePayment(orderId: number, hash: string): Observable<any>;
47
- stripePaymentConfirm(orderId: number, paymentId: string): Observable<any>;
46
+ stripePaymentConfirm(orderId: number, paymentId: string): Observable<PaymentInfo>;
48
47
  private shippingAddressSelect;
49
48
  shippingAddressSet(form: FormControl, customerService: CustomerService, account: AccountService): void;
50
49
  clearOrder(): void;
@@ -55,4 +54,5 @@ export declare class CheckoutService {
55
54
  discountCode(cartService: CartService, code: string): Observable<Discount>;
56
55
  removeDiscountCode(cartService: CartService, code: Discount): void;
57
56
  private getDiscounts;
57
+ shippingMethods(): Observable<Array<ShippingMethodType> | false>;
58
58
  }
@@ -6,7 +6,6 @@ export declare enum EcommerceStatus {
6
6
  CARTLEFT = "#/cart-left",
7
7
  CHECKOUT = "#/checkout",
8
8
  NONE = "",
9
- PAYMENT = "#/payment",
10
9
  SIGNIN = "#/signin",
11
10
  ORDER_SUMMARY = "#/order-summary",
12
11
  ORDER_ERROR = "#/order-error",
@@ -56,6 +56,7 @@ export interface InputCartToOrder {
56
56
  customer: OrderCustomer;
57
57
  customerOrder: string;
58
58
  discounts: Discounts;
59
+ geolocation: any;
59
60
  notes: string;
60
61
  numItems: number;
61
62
  paymentMethod: OrderPaymentMethodType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apirocket",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "description": " ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1 +0,0 @@
1
- export declare const SHIPPING_METHOD: ShippingMethodType;