apirocket 0.15.0 → 0.16.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,2 +1,3 @@
1
+ export { deepFreeze, proxyReadOnly };
2
+ declare const deepFreeze: (obj: any) => any;
1
3
  declare const proxyReadOnly: (target: any, properties?: Array<string>) => any;
2
- export { proxyReadOnly };
@@ -4,9 +4,11 @@ import type { CheckoutService } from "./checkout.service";
4
4
  import type { LastOrder } from "@src/types/types";
5
5
  import type { ShippingAddress } from "@src/models/addresses-models";
6
6
  export declare class CartService {
7
+ #private;
7
8
  readonly change$: Observable<CartService>;
8
9
  get count(): number;
9
10
  get country(): Country;
11
+ get discounts(): CartDiscounts;
10
12
  get items(): Array<CartItem>;
11
13
  get lastOrder(): LastOrder;
12
14
  get numItems(): number;
@@ -16,47 +18,40 @@ export declare class CartService {
16
18
  get total(): number;
17
19
  get units(): number;
18
20
  get uuid(): string;
19
- private _checkoutService;
20
- private _count;
21
- private _country;
22
- private _customerService;
23
- private _items;
24
- private _lastOrder;
25
- private _taxAmount;
26
- private _taxBase;
27
- private _total;
28
- private _units;
29
- private _update$;
30
- private _uuid;
31
- private _status;
32
- private _subscribe$;
33
21
  constructor();
34
22
  private changeCart;
23
+ discountCode(code: string): Observable<Cart & {
24
+ __errors: any;
25
+ }>;
26
+ discountCodeRemove(discountId: number): Observable<Cart & {
27
+ __errors: any;
28
+ }>;
29
+ private getDiscounts;
30
+ private restoreStorage;
31
+ private saveStorage;
32
+ private updateCart;
35
33
  clear(): void;
36
34
  clearOrder(lastOrderId: number, lastOrderHash: string, purchaseEvent: boolean): void;
37
35
  close(): void;
38
36
  private getItems;
39
37
  open(fullScreen: boolean): void;
40
38
  private purchaseEvent;
41
- private restoreStorage;
42
- private saveStorage;
43
- setServices(customer: CustomerService, checkout: CheckoutService): void;
39
+ setServices(customer: CustomerService): void;
44
40
  add(data: CartItem): void;
45
41
  orderSummary(id: number, hash: string): Observable<Order & {
46
42
  __errors: any;
47
43
  }>;
48
44
  addFromTarget(target: HTMLElement): void;
49
45
  private setStatus;
50
- private updateCart;
51
46
  cartToOrder(checkoutService: CheckoutService, customer: CustomerService): Observable<PaymentInfo>;
52
47
  removeItem(item: CartItem): void;
53
- updateItem(item: CartItem, quantity: number): void;
54
48
  private addItemCart;
55
49
  setCountryData(country: Country): void;
56
50
  private updateShippingData;
57
51
  private cartUpdate;
58
52
  update(): void;
59
- updateShippingAddress(shippingAddress: ShippingAddress): Observable<any>;
53
+ updateShippingAddress(shippingAddress: ShippingAddress): Observable<void>;
54
+ updateItem(item: CartItem, quantity: number): void;
60
55
  }
61
56
  export declare function cartProxy(cart: CartService): {
62
57
  count: number;
@@ -77,6 +72,6 @@ export declare function cartProxy(cart: CartService): {
77
72
  open: (fullScreen: boolean) => void;
78
73
  removeItem: (item: CartItem) => void;
79
74
  setCountryIso: (iso: string) => Promise<void>;
80
- subscribe: (cb: (cart: CartService) => void) => () => void;
75
+ subscribe: (cb: (cart: CartProxy) => void) => () => void;
81
76
  updateItem: (item: CartItem, quantity: number) => void;
82
77
  };
@@ -9,7 +9,6 @@ export declare class CheckoutService {
9
9
  readonly change$: Observable<CheckoutService>;
10
10
  get billingAddress(): BillingAddress;
11
11
  get customerOrder(): string;
12
- get discounts(): Discounts;
13
12
  get notes(): string;
14
13
  get paymentAddress(): boolean;
15
14
  get paymentMethod(): PaymentMethod;
@@ -20,14 +19,17 @@ export declare class CheckoutService {
20
19
  get taxAmount(): number;
21
20
  get total(): number;
22
21
  constructor(cartService: CartService, customer: CustomerService, account: AccountService);
22
+ aplazameSettings(methodId: number): Observable<AplazameSettings>;
23
23
  private getShippingAddress;
24
24
  paymentForm(formElement: HTMLFormElement, paymentMethods: Array<PaymentMethodOption>): Observable<{
25
25
  form: FormControl;
26
26
  addresses: Array<BillingAddress>;
27
27
  }>;
28
28
  paymentSet(form: FormControl, payments: Array<PaymentMethodOption>): Observable<any>;
29
+ paypalSettings(methodId: number): Observable<PaypalSettings>;
29
30
  private restoreStorage;
30
31
  setStatus(newStatus: CheckoutStatus): void;
32
+ stripeSettings(methodId: number): Observable<StripeSettings>;
31
33
  formSignIn(form: HTMLFormElement): FormControl;
32
34
  signInSubmit(_form: FormControl): void;
33
35
  close(): void;
@@ -35,17 +37,11 @@ export declare class CheckoutService {
35
37
  shippingMethodForm(formElement: HTMLFormElement, shippingMethods: Array<ShippingMethodType>): FormControl;
36
38
  shippingMethodSet(form: FormControl, methods: Array<ShippingMethodType>, cartService: CartService, gotoPayment: boolean): void;
37
39
  changeShippingMethod(cartService: CartService, methods: Array<ShippingMethodType>, shippingMethodId: number): void;
38
- stripeSettings(methodId: number): Observable<StripeSettings>;
39
40
  stripePayment(orderId: number, hash: string): Observable<any>;
40
41
  stripePaymentConfirm(orderId: number, paymentId: string): Observable<PaymentInfo>;
41
42
  clearOrder(): void;
42
- paypalSettings(methodId: number): Observable<PaypalSettings>;
43
- paypalApprobe(data: any): Observable<any>;
44
- private updateDiscounts;
43
+ paypalApprobe(data: any): Observable<void>;
45
44
  updateTotal(cartService: CartService, changeNotification: boolean): void;
46
- discountCode(cartService: CartService, code: string): Observable<Discount>;
47
- removeDiscountCode(cartService: CartService, code: Discount): void;
48
- private getDiscounts;
49
45
  shippingMethods(): Observable<Array<ShippingMethodType> | false>;
50
46
  shippingAddressForm(formElement: HTMLFormElement): Observable<{
51
47
  form: FormControl;
@@ -64,8 +64,8 @@ export declare function customerProxy(customer: CustomerService): {
64
64
  type: CustomerType;
65
65
  isLogged: boolean;
66
66
  countries: () => Promise<Country[]>;
67
- createBillingAddress: (input: Omit<BillingAddress, 'id'>) => Promise<unknown>;
68
- createShippingAddress: (input: Omit<ShippingAddress, 'id'>) => Promise<unknown>;
67
+ createBillingAddress: (input: Omit<BillingAddress, "id">) => Promise<unknown>;
68
+ createShippingAddress: (input: Omit<ShippingAddress, "id">) => Promise<unknown>;
69
69
  deleteShippingAddress: (id: number) => Promise<unknown>;
70
70
  deleteBillingAddress: (id: number) => Promise<unknown>;
71
71
  myAccount: () => Promise<CustomerAccount>;
@@ -23,6 +23,7 @@ export declare class EcommerceService {
23
23
  private legalLinks;
24
24
  private legalLink;
25
25
  private ready;
26
+ private readyEvent;
26
27
  signIn(): void;
27
28
  rememberPassword(): void;
28
29
  updateEvents(): void;
@@ -6,6 +6,7 @@ export interface LockInstance {
6
6
  }
7
7
  export interface LockConfig {
8
8
  afterClosed?: () => void;
9
+ light?: boolean;
9
10
  }
10
11
  declare class LockService {
11
12
  #private;
@@ -12,3 +12,9 @@ export declare const LAST_ORDER: {
12
12
  hash: string;
13
13
  purchaseEvent: boolean;
14
14
  };
15
+ export declare const EMPTY_DISCOUNTS: {
16
+ taxAmount: number;
17
+ taxBase: number;
18
+ total: number;
19
+ discounts: never[];
20
+ };
@@ -7,6 +7,7 @@ export declare enum EcommerceStatus {
7
7
  CARTLEFT = "#/cart-left",
8
8
  CHECKOUT = "#/checkout",
9
9
  CREATE_ACCOUNT = "#/create-account",
10
+ CUSTOMER_LOGIN = "#/customer-login",
10
11
  NONE = "",
11
12
  SIGNIN = "#/signin",
12
13
  ORDER_SUMMARY = "#/order-summary",
@@ -11,7 +11,6 @@ export interface InputCartToOrder {
11
11
  cartUuid: string;
12
12
  customer: InputOrderCustomer;
13
13
  customerOrder: string;
14
- discounts: Discounts;
15
14
  geolocation: any;
16
15
  notes: string;
17
16
  numItems: number;
@@ -22,14 +21,6 @@ export interface InputCartToOrder {
22
21
  units: number;
23
22
  total: number;
24
23
  }
25
- export type CartType = {
26
- items: Array<CartItem>;
27
- taxAmount: number;
28
- taxBase: number;
29
- total: number;
30
- units: number;
31
- uuid: string;
32
- };
33
24
  export type LastOrder = {
34
25
  id: number;
35
26
  hash: string;
@@ -75,7 +66,6 @@ export interface OrderType {
75
66
  customer: OrderCustomer;
76
67
  customerOrder: string;
77
68
  date: Date;
78
- discounts: Discounts;
79
69
  hash: string;
80
70
  id: number;
81
71
  items: Array<OrderItem>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apirocket",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": " ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,27 +17,27 @@
17
17
  "author": "",
18
18
  "license": "ISC",
19
19
  "devDependencies": {
20
- "@rollup/plugin-commonjs": "^24.0.1",
21
- "@rollup/plugin-node-resolve": "^15.0.1",
22
- "@rollup/plugin-typescript": "^11.0.0",
23
- "@tsconfig/svelte": "^3.0.0",
24
- "@types/node": "^18.14.4",
25
- "rollup": "^3.18.0",
26
- "rollup-plugin-copy": "^3.4.0",
27
- "rollup-plugin-css-only": "^4.3.0",
28
- "rollup-plugin-livereload": "^2.0.5",
29
- "rollup-plugin-minification": "^0.2.0",
30
- "rollup-plugin-svelte": "^7.1.4",
31
- "sirv-cli": "^2.0.2",
32
- "svelte": "^3.55.1",
33
- "svelte-check": "^3.0.4",
34
- "svelte-preprocess": "^5.0.1",
35
- "tslib": "^2.5.0",
36
- "typescript": "4.9.5"
20
+ "@rollup/plugin-commonjs": "24.0.1",
21
+ "@rollup/plugin-node-resolve": "15.3.1",
22
+ "@rollup/plugin-typescript": "11.1.6",
23
+ "@tsconfig/svelte": "3.0.0",
24
+ "@types/node": "22.14.1",
25
+ "rollup": "3.29.5",
26
+ "rollup-plugin-copy": "3.4.0",
27
+ "rollup-plugin-css-only": "4.3.0",
28
+ "rollup-plugin-livereload": "2.0.5",
29
+ "rollup-plugin-minification": "0.2.0",
30
+ "rollup-plugin-svelte": "7.1.4",
31
+ "sirv-cli": "2.0.2",
32
+ "svelte": "3.59.2",
33
+ "svelte-check": "3.8.6",
34
+ "svelte-preprocess": "5.1.4",
35
+ "tslib": "2.8.1",
36
+ "typescript": "5.8.3"
37
37
  },
38
38
  "dependencies": {
39
- "@e-xisto/form-control": "0.2.3",
40
- "@paypal/paypal-js": "^8.0.2",
41
- "rxjs": "^7.8.0"
39
+ "@e-xisto/form-control": "0.2.4",
40
+ "@paypal/paypal-js": "8.2.0",
41
+ "rxjs": "7.8.1"
42
42
  }
43
43
  }