apirocket 0.11.3 → 0.12.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/ecommerce.js +2 -2
- package/dist/lib/graphql.d.ts +11 -2
- package/dist/lib/utils.d.ts +8 -5
- package/dist/services/customer.service.d.ts +3 -3
- package/dist/services/ecommerce.service.d.ts +2 -0
- package/dist/services/sales.service.d.ts +41 -0
- package/dist/types/ecommerce.type.d.ts +3 -1
- package/package.json +2 -2
package/dist/lib/graphql.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { AjaxResponse } from 'rxjs/ajax';
|
|
3
3
|
import type { CustomerService } from '@src/services/customer.service';
|
|
4
|
+
import type { SalesService } from '@src/services/sales.service';
|
|
4
5
|
export type QueryErrors = {
|
|
5
6
|
__errors?: Array<string>;
|
|
6
7
|
};
|
|
@@ -11,7 +12,7 @@ export type QueryOptions = {
|
|
|
11
12
|
debug?: boolean;
|
|
12
13
|
retry?: number;
|
|
13
14
|
};
|
|
14
|
-
export { getApi, getEcommerce, post, post2, postEcommerce, query };
|
|
15
|
+
export { getApi, getEcommerce, getSales, post, post2, postEcommerce, postSales, query };
|
|
15
16
|
declare const getEcommerce: <T>(url: string, inputData: any, customer: CustomerService | undefined) => Observable<{
|
|
16
17
|
__errors: any;
|
|
17
18
|
status: number;
|
|
@@ -20,10 +21,18 @@ declare const postEcommerce: <T>(url: string, inputData: any, customer?: Custome
|
|
|
20
21
|
__errors: any;
|
|
21
22
|
status: number;
|
|
22
23
|
} & T>;
|
|
23
|
-
declare const post: <T>(url: string, data: any,
|
|
24
|
+
declare const post: <T>(url: string, data: any, token: string | undefined) => Observable<{
|
|
24
25
|
__errors: any;
|
|
25
26
|
status: number;
|
|
26
27
|
} & T>;
|
|
27
28
|
declare const query: <T>(query: string, variables: QueryVariables, customer?: CustomerService) => Observable<T>;
|
|
28
29
|
declare const getApi: (url: string, data: any, customer: CustomerService | undefined) => Observable<AjaxResponse<any>>;
|
|
29
30
|
declare const post2: <T>(url: string, data: any, customer?: CustomerService) => Observable<any>;
|
|
31
|
+
declare const getSales: <T>(url: string, inputData: any, sales: SalesService | undefined) => Observable<{
|
|
32
|
+
__errors: any;
|
|
33
|
+
status: number;
|
|
34
|
+
} & T>;
|
|
35
|
+
declare const postSales: <T>(url: string, inputData: any, sales: SalesService) => Observable<{
|
|
36
|
+
__errors: any;
|
|
37
|
+
status: number;
|
|
38
|
+
} & T>;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 };
|
|
1
|
+
export { account, asFloat, asInteger, autoincrement, backToShopping, buildQuery, cart, checkout, clearHtml, createAccount, dataset, euroPrice, euros, isBoolean, isNumber, isString, millares, orderError, orderSummary, price, rememberPassword, round, salesAccount, salesSignIn, signIn, storageAvailable };
|
|
2
2
|
declare const buildQuery: (data: {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
}) => string;
|
|
@@ -14,13 +14,16 @@ declare const asFloat: (value: string | number | Array<string> | undefined, deci
|
|
|
14
14
|
declare const asInteger: (value: string | number | Array<string> | boolean | undefined) => number;
|
|
15
15
|
declare const round: (num: number, precision: number) => number;
|
|
16
16
|
declare const storageAvailable: (type: "sessionStorage" | "localStorage") => boolean;
|
|
17
|
+
declare const account: () => void;
|
|
17
18
|
declare const backToShopping: () => void;
|
|
18
19
|
declare const cart: (fullScreen?: boolean) => void;
|
|
19
|
-
declare const createAccount: () => void;
|
|
20
|
-
declare const signIn: () => void;
|
|
21
20
|
declare const checkout: () => void;
|
|
22
|
-
declare const
|
|
21
|
+
declare const createAccount: () => void;
|
|
23
22
|
declare const orderError: () => void;
|
|
24
23
|
declare const orderSummary: () => void;
|
|
25
|
-
declare const
|
|
24
|
+
declare const rememberPassword: () => void;
|
|
25
|
+
declare const salesAccount: () => void;
|
|
26
|
+
declare const salesSignIn: () => void;
|
|
27
|
+
declare const signIn: () => void;
|
|
26
28
|
declare const clearHtml: (cadena: string) => string;
|
|
29
|
+
declare const autoincrement: () => number;
|
|
@@ -3,7 +3,7 @@ import type { FormControl } from "@e-xisto/form-control";
|
|
|
3
3
|
import type { CartService } from "./cart.service";
|
|
4
4
|
import type { CustomerType } from "@src/types/types";
|
|
5
5
|
import type { AccountService } from "./account.service";
|
|
6
|
-
export declare class CustomerService {
|
|
6
|
+
export declare class CustomerService implements Authentication {
|
|
7
7
|
readonly change$: Observable<CustomerService>;
|
|
8
8
|
get acceptEmailMarketing(): boolean;
|
|
9
9
|
get email(): string;
|
|
@@ -29,7 +29,6 @@ export declare class CustomerService {
|
|
|
29
29
|
setAccountService(account: AccountService): void;
|
|
30
30
|
setCartService(cart: CartService): void;
|
|
31
31
|
subscribe(cb: (customer: CustomerService) => void): () => void;
|
|
32
|
-
price(productId: number): Promise<any>;
|
|
33
32
|
logout(): Promise<{
|
|
34
33
|
status: number;
|
|
35
34
|
}>;
|
|
@@ -37,8 +36,9 @@ export declare class CustomerService {
|
|
|
37
36
|
login(form: FormControl): Promise<{
|
|
38
37
|
status: number;
|
|
39
38
|
}>;
|
|
40
|
-
private updateState;
|
|
41
39
|
private getMyAccount;
|
|
42
40
|
updateToken(data: LoginData): void;
|
|
43
41
|
createAccount(form: FormControl): Promise<CreateAccountResponse>;
|
|
42
|
+
price(productId: number): Promise<any>;
|
|
43
|
+
updateState(data: LoginData, emitUpdated: boolean): void;
|
|
44
44
|
}
|
|
@@ -3,6 +3,7 @@ import { CartService } from "@src/services/cart.service";
|
|
|
3
3
|
import { CheckoutService } from "@src/services/checkout.service";
|
|
4
4
|
import { CustomerService } from "./customer.service";
|
|
5
5
|
import { AccountService } from './account.service';
|
|
6
|
+
import { SalesService } from './sales.service';
|
|
6
7
|
export declare class EcommerceService {
|
|
7
8
|
#private;
|
|
8
9
|
get bellobath(): boolean;
|
|
@@ -11,6 +12,7 @@ export declare class EcommerceService {
|
|
|
11
12
|
get checkout(): CheckoutService;
|
|
12
13
|
get customer(): CustomerService;
|
|
13
14
|
get logo(): string;
|
|
15
|
+
get sales(): SalesService;
|
|
14
16
|
get status(): EcommerceStatus;
|
|
15
17
|
constructor();
|
|
16
18
|
private changeStatus;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FormControl } from "@e-xisto/form-control";
|
|
2
|
+
import type { CustomerService } from "./customer.service";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
4
|
+
type SalesCustomers = Array<SalesCustomer>;
|
|
5
|
+
type SalesCustomer = any;
|
|
6
|
+
export declare class SalesService implements Authentication {
|
|
7
|
+
#private;
|
|
8
|
+
readonly change$: Observable<SalesService>;
|
|
9
|
+
get email(): string;
|
|
10
|
+
get firstName(): string;
|
|
11
|
+
get id(): number;
|
|
12
|
+
get lastName(): string;
|
|
13
|
+
get phone(): string;
|
|
14
|
+
get refreshToken(): string;
|
|
15
|
+
get token(): string;
|
|
16
|
+
get isLogged(): boolean;
|
|
17
|
+
get customers$(): Observable<SalesCustomers>;
|
|
18
|
+
private _state;
|
|
19
|
+
private _subscribe$;
|
|
20
|
+
private _update$;
|
|
21
|
+
private _customers;
|
|
22
|
+
private _customers$;
|
|
23
|
+
private _customersData;
|
|
24
|
+
constructor();
|
|
25
|
+
private changeSales;
|
|
26
|
+
login(form: FormControl): Promise<{
|
|
27
|
+
status: number;
|
|
28
|
+
}>;
|
|
29
|
+
private restoreState;
|
|
30
|
+
private saveState;
|
|
31
|
+
private updateState;
|
|
32
|
+
subscribe(cb: (sales: SalesService) => void): () => void;
|
|
33
|
+
logout(): Promise<{
|
|
34
|
+
status: number;
|
|
35
|
+
}>;
|
|
36
|
+
updateToken(data: LoginData): void;
|
|
37
|
+
private customersData;
|
|
38
|
+
customerLogin(customerId: number): void;
|
|
39
|
+
setCustomerService(customer: CustomerService): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -13,7 +13,9 @@ export declare enum EcommerceStatus {
|
|
|
13
13
|
ORDER_ERROR = "#/order-error",
|
|
14
14
|
REMEMBER_PASSWORD = "#/remember-password",
|
|
15
15
|
REGISTER = "#/register",
|
|
16
|
-
RESET_PASSWORD = "#/reset-password"
|
|
16
|
+
RESET_PASSWORD = "#/reset-password",
|
|
17
|
+
SALES_ACCOUNT = "#/sales-account",
|
|
18
|
+
SALES_SIGNIN = "#/sales-signin"
|
|
17
19
|
}
|
|
18
20
|
export declare class EcommerceReadyEvent extends Event {
|
|
19
21
|
readonly ecommerce: PublicEcommerceService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apirocket",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": " ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"svelte-check": "^3.0.4",
|
|
34
34
|
"svelte-preprocess": "^5.0.1",
|
|
35
35
|
"tslib": "^2.5.0",
|
|
36
|
-
"typescript": "
|
|
36
|
+
"typescript": "4.9.5"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@e-xisto/form-control": "0.1.17",
|