@experteam-mx/ngx-services 16.1.1 → 18.0.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/README.md +8 -8
- package/esm2022/lib/apis/api-companies.service.mjs +9 -7
- package/esm2022/lib/apis/api-security.service.mjs +15 -12
- package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +2 -0
- package/esm2022/lib/apis/models/api-companies.interfaces.mjs +1 -1
- package/esm2022/lib/apis/models/api-security.interfaces.mjs +1 -1
- package/esm2022/lib/apis/models/api.models.mjs +1 -1
- package/esm2022/lib/helpers/http.mjs +4 -2
- package/esm2022/lib/interceptors/api-headers.interceptor.mjs +4 -4
- package/esm2022/lib/interceptors/api-token.interceptor.mjs +14 -8
- package/esm2022/lib/interceptors/http-caching.interceptor.mjs +8 -7
- package/esm2022/lib/ngx-services.models.mjs +1 -1
- package/esm2022/lib/ngx-services.module.mjs +7 -11
- package/esm2022/public-api.mjs +2 -9
- package/fesm2022/experteam-mx-ngx-services.mjs +53 -165
- package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/apis/api-companies.service.d.ts +163 -163
- package/lib/apis/api-security.service.d.ts +79 -79
- package/lib/apis/models/{api-catalogs.interfaces.d.ts → api-catalog.interfaces.d.ts} +71 -75
- package/lib/apis/models/api-companies.interfaces.d.ts +380 -380
- package/lib/apis/models/api-companies.types.d.ts +75 -75
- package/lib/apis/models/api-security.interfaces.d.ts +55 -55
- package/lib/apis/models/api-security.types.d.ts +30 -30
- package/lib/apis/models/api.models.d.ts +23 -23
- package/lib/helpers/http.d.ts +38 -38
- package/lib/interceptors/api-headers.interceptor.d.ts +16 -16
- package/lib/interceptors/api-token.interceptor.d.ts +21 -19
- package/lib/interceptors/http-caching.interceptor.d.ts +12 -12
- package/lib/ngx-services.models.d.ts +6 -9
- package/lib/ngx-services.module.d.ts +16 -17
- package/package.json +10 -16
- package/public-api.d.ts +12 -19
- package/esm2020/experteam-mx-ngx-services.mjs +0 -5
- package/esm2020/lib/apis/api-catalogs.service.mjs +0 -42
- package/esm2020/lib/apis/api-companies.service.mjs +0 -255
- package/esm2020/lib/apis/api-external-ops.service.mjs +0 -53
- package/esm2020/lib/apis/api-security.service.mjs +0 -128
- package/esm2020/lib/apis/models/api-catalogs.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-catalogs.types.mjs +0 -2
- package/esm2020/lib/apis/models/api-companies.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-companies.types.mjs +0 -2
- package/esm2020/lib/apis/models/api-external-ops.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-external-ops.types.mjs +0 -2
- package/esm2020/lib/apis/models/api-security.interfaces.mjs +0 -2
- package/esm2020/lib/apis/models/api-security.types.mjs +0 -2
- package/esm2020/lib/apis/models/api.models.mjs +0 -2
- package/esm2020/lib/helpers/http.mjs +0 -64
- package/esm2020/lib/interceptors/api-headers.interceptor.mjs +0 -34
- package/esm2020/lib/interceptors/api-key.interceptor.mjs +0 -38
- package/esm2020/lib/interceptors/api-token.interceptor.mjs +0 -35
- package/esm2020/lib/interceptors/http-caching.interceptor.mjs +0 -38
- package/esm2020/lib/ngx-services.models.mjs +0 -2
- package/esm2020/lib/ngx-services.module.mjs +0 -37
- package/esm2020/public-api.mjs +0 -27
- package/esm2022/lib/apis/api-catalogs.service.mjs +0 -42
- package/esm2022/lib/apis/api-external-ops.service.mjs +0 -53
- package/esm2022/lib/apis/models/api-catalogs.interfaces.mjs +0 -2
- package/esm2022/lib/apis/models/api-catalogs.types.mjs +0 -2
- package/esm2022/lib/apis/models/api-external-ops.interfaces.mjs +0 -2
- package/esm2022/lib/apis/models/api-external-ops.types.mjs +0 -2
- package/esm2022/lib/interceptors/api-key.interceptor.mjs +0 -38
- package/fesm2015/experteam-mx-ngx-services.mjs +0 -723
- package/fesm2015/experteam-mx-ngx-services.mjs.map +0 -1
- package/fesm2020/experteam-mx-ngx-services.mjs +0 -705
- package/fesm2020/experteam-mx-ngx-services.mjs.map +0 -1
- package/lib/apis/api-catalogs.service.d.ts +0 -26
- package/lib/apis/api-external-ops.service.d.ts +0 -34
- package/lib/apis/models/api-catalogs.types.d.ts +0 -5
- package/lib/apis/models/api-external-ops.interfaces.d.ts +0 -23
- package/lib/apis/models/api-external-ops.types.d.ts +0 -18
- package/lib/interceptors/api-key.interceptor.d.ts +0 -19
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { ChangeLanguageIn, CreateSessionIn, CreateSessionOut, GetUserOut, LoginIn, LoginOut, MeOut } from './models/api-security.types';
|
|
2
|
-
import { HttpClient } from '@angular/common/http';
|
|
3
|
-
import { Environment } from '../ngx-services.models';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { CookieService } from 'ngx-cookie-service';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class ApiSecurityService {
|
|
8
|
-
private environments;
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
constructor(environments: Environment,
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves the API security URL from the environments configuration.
|
|
14
|
-
*
|
|
15
|
-
* @return {string} The API security URL.
|
|
16
|
-
*/
|
|
17
|
-
get url(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Authenticates a user with the provided credentials and role.
|
|
20
|
-
*
|
|
21
|
-
* @param {Object} param0 - The login input object.
|
|
22
|
-
* @param {string} param0.username - The username of the user.
|
|
23
|
-
* @param {string} param0.password - The password of the user.
|
|
24
|
-
* @param {string} param0.role - The role of the user.
|
|
25
|
-
* @return {Observable<LoginOut>} An observable emitting the login output object.
|
|
26
|
-
*/
|
|
27
|
-
login({ username, password, role, }: LoginIn): Observable<LoginOut>;
|
|
28
|
-
/**
|
|
29
|
-
* Logs out the current user by making a POST request to the logout endpoint.
|
|
30
|
-
*
|
|
31
|
-
* This method deletes all cookies after a successful logout.
|
|
32
|
-
*
|
|
33
|
-
* @return {Observable<{}>} An observable that emits the server's response to the logout request.
|
|
34
|
-
*/
|
|
35
|
-
logout(): Observable<{}>;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a new session for a specified model.
|
|
38
|
-
*
|
|
39
|
-
* @param {Object} params - The parameters for creating the session.
|
|
40
|
-
* @param {string} params.modelType - The type of the model.
|
|
41
|
-
* @param {string} params.modelId - The ID of the model.
|
|
42
|
-
* @param {string} [params.token] - Optional authorization token.
|
|
43
|
-
*
|
|
44
|
-
* @return {Observable<CreateSessionOut>} An observable containing the created session details.
|
|
45
|
-
*/
|
|
46
|
-
createSession({ modelType, modelId, token, }: CreateSessionIn): Observable<CreateSessionOut>;
|
|
47
|
-
/**
|
|
48
|
-
* Fetches the authenticated user's information.
|
|
49
|
-
* Sends a GET request to the endpoint '/auth/me' to retrieve information
|
|
50
|
-
* about the currently authenticated user.
|
|
51
|
-
*
|
|
52
|
-
* @return {Observable<MeOut>} An observable that emits the authenticated user's data.
|
|
53
|
-
*/
|
|
54
|
-
me(): Observable<MeOut>;
|
|
55
|
-
/**
|
|
56
|
-
* Fetches the authenticated user's details from the server.
|
|
57
|
-
*
|
|
58
|
-
* @param token The JWT token used for authorization.
|
|
59
|
-
* @return An Observable that emits the user's details encapsulated in a MeOut object.
|
|
60
|
-
*/
|
|
61
|
-
otherMe(token: string): Observable<MeOut>;
|
|
62
|
-
/**
|
|
63
|
-
* Fetches a user by their unique ID.
|
|
64
|
-
*
|
|
65
|
-
* @param {number} id - The unique identifier of the user to be fetched.
|
|
66
|
-
* @return {Observable<GetUserOut>} An observable containing the user information.
|
|
67
|
-
*/
|
|
68
|
-
user(id: number): Observable<GetUserOut>;
|
|
69
|
-
/**
|
|
70
|
-
* Changes the language for the authenticated user.
|
|
71
|
-
*
|
|
72
|
-
* @param {Object} params - The input parameters for changing the language.
|
|
73
|
-
* @param {string} params.languageId - The ID of the new language to be set.
|
|
74
|
-
* @return {Observable<ApiSuccess<MeOut>>} An observable that emits the result of the language change request.
|
|
75
|
-
*/
|
|
76
|
-
changeLanguage({ languageId }: ChangeLanguageIn): Observable<MeOut>;
|
|
77
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApiSecurityService, never>;
|
|
78
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ApiSecurityService>;
|
|
79
|
-
}
|
|
1
|
+
import { ChangeLanguageIn, CreateSessionIn, CreateSessionOut, GetUserOut, LoginIn, LoginOut, MeOut } from './models/api-security.types';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { Environment } from '../ngx-services.models';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { CookieService } from 'ngx-cookie-service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ApiSecurityService {
|
|
8
|
+
private environments;
|
|
9
|
+
private cookie;
|
|
10
|
+
private http;
|
|
11
|
+
constructor(environments: Environment, cookie: CookieService, http: HttpClient);
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves the API security URL from the environments configuration.
|
|
14
|
+
*
|
|
15
|
+
* @return {string} The API security URL.
|
|
16
|
+
*/
|
|
17
|
+
get url(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Authenticates a user with the provided credentials and role.
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} param0 - The login input object.
|
|
22
|
+
* @param {string} param0.username - The username of the user.
|
|
23
|
+
* @param {string} param0.password - The password of the user.
|
|
24
|
+
* @param {string} param0.role - The role of the user.
|
|
25
|
+
* @return {Observable<LoginOut>} An observable emitting the login output object.
|
|
26
|
+
*/
|
|
27
|
+
login({ username, password, role, }: LoginIn): Observable<LoginOut>;
|
|
28
|
+
/**
|
|
29
|
+
* Logs out the current user by making a POST request to the logout endpoint.
|
|
30
|
+
*
|
|
31
|
+
* This method deletes all cookies after a successful logout.
|
|
32
|
+
*
|
|
33
|
+
* @return {Observable<{}>} An observable that emits the server's response to the logout request.
|
|
34
|
+
*/
|
|
35
|
+
logout(): Observable<{}>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new session for a specified model.
|
|
38
|
+
*
|
|
39
|
+
* @param {Object} params - The parameters for creating the session.
|
|
40
|
+
* @param {string} params.modelType - The type of the model.
|
|
41
|
+
* @param {string} params.modelId - The ID of the model.
|
|
42
|
+
* @param {string} [params.token] - Optional authorization token.
|
|
43
|
+
*
|
|
44
|
+
* @return {Observable<CreateSessionOut>} An observable containing the created session details.
|
|
45
|
+
*/
|
|
46
|
+
createSession({ modelType, modelId, token, }: CreateSessionIn): Observable<CreateSessionOut>;
|
|
47
|
+
/**
|
|
48
|
+
* Fetches the authenticated user's information.
|
|
49
|
+
* Sends a GET request to the endpoint '/auth/me' to retrieve information
|
|
50
|
+
* about the currently authenticated user.
|
|
51
|
+
*
|
|
52
|
+
* @return {Observable<MeOut>} An observable that emits the authenticated user's data.
|
|
53
|
+
*/
|
|
54
|
+
me(): Observable<MeOut>;
|
|
55
|
+
/**
|
|
56
|
+
* Fetches the authenticated user's details from the server.
|
|
57
|
+
*
|
|
58
|
+
* @param token The JWT token used for authorization.
|
|
59
|
+
* @return An Observable that emits the user's details encapsulated in a MeOut object.
|
|
60
|
+
*/
|
|
61
|
+
otherMe(token: string): Observable<MeOut>;
|
|
62
|
+
/**
|
|
63
|
+
* Fetches a user by their unique ID.
|
|
64
|
+
*
|
|
65
|
+
* @param {number} id - The unique identifier of the user to be fetched.
|
|
66
|
+
* @return {Observable<GetUserOut>} An observable containing the user information.
|
|
67
|
+
*/
|
|
68
|
+
user(id: number): Observable<GetUserOut>;
|
|
69
|
+
/**
|
|
70
|
+
* Changes the language for the authenticated user.
|
|
71
|
+
*
|
|
72
|
+
* @param {Object} params - The input parameters for changing the language.
|
|
73
|
+
* @param {string} params.languageId - The ID of the new language to be set.
|
|
74
|
+
* @return {Observable<ApiSuccess<MeOut>>} An observable that emits the result of the language change request.
|
|
75
|
+
*/
|
|
76
|
+
changeLanguage({ languageId }: ChangeLanguageIn): Observable<MeOut>;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApiSecurityService, never>;
|
|
78
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApiSecurityService>;
|
|
79
|
+
}
|
|
@@ -1,75 +1,71 @@
|
|
|
1
|
-
import { SymfonyModel } from './api.models';
|
|
2
|
-
export interface Country extends SymfonyModel {
|
|
3
|
-
name: string;
|
|
4
|
-
code: string;
|
|
5
|
-
codeAndName: string;
|
|
6
|
-
isoCode: string;
|
|
7
|
-
codePhone: string;
|
|
8
|
-
locale: string;
|
|
9
|
-
locationType: LocationType;
|
|
10
|
-
unit: Unit;
|
|
11
|
-
timezone: string;
|
|
12
|
-
hasImportService: boolean;
|
|
13
|
-
phoneDigits: number;
|
|
14
|
-
locationTypeFields: LocationTypeFields;
|
|
15
|
-
postalCodeSuffixRegex: string;
|
|
16
|
-
decimalPoint: number;
|
|
17
|
-
max_quantity_document_piece: number;
|
|
18
|
-
max_quantity_package_piece: number;
|
|
19
|
-
weight_restriction_piece: number;
|
|
20
|
-
restriction_shipment: number;
|
|
21
|
-
restriction_dimension: number;
|
|
22
|
-
max_declared_value: number;
|
|
23
|
-
decimal_separator: string;
|
|
24
|
-
thousands_separator: string;
|
|
25
|
-
label_printer_name: string;
|
|
26
|
-
receipt_printer_name: string;
|
|
27
|
-
others_printer_name: string;
|
|
28
|
-
territories: number[];
|
|
29
|
-
use_billing?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface LocationType extends SymfonyModel {
|
|
32
|
-
code: string;
|
|
33
|
-
name: string;
|
|
34
|
-
priority: number;
|
|
35
|
-
}
|
|
36
|
-
export interface Unit extends SymfonyModel {
|
|
37
|
-
name: string;
|
|
38
|
-
weight: string;
|
|
39
|
-
dimension: string;
|
|
40
|
-
}
|
|
41
|
-
export interface LocationTypeFields {
|
|
42
|
-
city: City;
|
|
43
|
-
postalCode: PostalCode;
|
|
44
|
-
suburb: Suburb;
|
|
45
|
-
}
|
|
46
|
-
export interface City {
|
|
47
|
-
enabled: boolean;
|
|
48
|
-
required: boolean;
|
|
49
|
-
}
|
|
50
|
-
export interface PostalCode {
|
|
51
|
-
enabled: boolean;
|
|
52
|
-
required: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface Suburb {
|
|
55
|
-
enabled: boolean;
|
|
56
|
-
required: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface Language extends SymfonyModel {
|
|
59
|
-
code: string;
|
|
60
|
-
name: string;
|
|
61
|
-
}
|
|
62
|
-
export interface State extends SymfonyModel {
|
|
63
|
-
country: Country;
|
|
64
|
-
code: string;
|
|
65
|
-
name: string;
|
|
66
|
-
}
|
|
67
|
-
export interface Currency extends SymfonyModel {
|
|
68
|
-
code: string;
|
|
69
|
-
name: string;
|
|
70
|
-
symbol: string;
|
|
71
|
-
}
|
|
72
|
-
export interface Language extends SymfonyModel {
|
|
73
|
-
code: string;
|
|
74
|
-
name: string;
|
|
75
|
-
}
|
|
1
|
+
import { SymfonyModel } from './api.models';
|
|
2
|
+
export interface Country extends SymfonyModel {
|
|
3
|
+
name: string;
|
|
4
|
+
code: string;
|
|
5
|
+
codeAndName: string;
|
|
6
|
+
isoCode: string;
|
|
7
|
+
codePhone: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
locationType: LocationType;
|
|
10
|
+
unit: Unit;
|
|
11
|
+
timezone: string;
|
|
12
|
+
hasImportService: boolean;
|
|
13
|
+
phoneDigits: number;
|
|
14
|
+
locationTypeFields: LocationTypeFields;
|
|
15
|
+
postalCodeSuffixRegex: string;
|
|
16
|
+
decimalPoint: number;
|
|
17
|
+
max_quantity_document_piece: number;
|
|
18
|
+
max_quantity_package_piece: number;
|
|
19
|
+
weight_restriction_piece: number;
|
|
20
|
+
restriction_shipment: number;
|
|
21
|
+
restriction_dimension: number;
|
|
22
|
+
max_declared_value: number;
|
|
23
|
+
decimal_separator: string;
|
|
24
|
+
thousands_separator: string;
|
|
25
|
+
label_printer_name: string;
|
|
26
|
+
receipt_printer_name: string;
|
|
27
|
+
others_printer_name: string;
|
|
28
|
+
territories: number[];
|
|
29
|
+
use_billing?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface LocationType extends SymfonyModel {
|
|
32
|
+
code: string;
|
|
33
|
+
name: string;
|
|
34
|
+
priority: number;
|
|
35
|
+
}
|
|
36
|
+
export interface Unit extends SymfonyModel {
|
|
37
|
+
name: string;
|
|
38
|
+
weight: string;
|
|
39
|
+
dimension: string;
|
|
40
|
+
}
|
|
41
|
+
export interface LocationTypeFields {
|
|
42
|
+
city: City;
|
|
43
|
+
postalCode: PostalCode;
|
|
44
|
+
suburb: Suburb;
|
|
45
|
+
}
|
|
46
|
+
export interface City {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
required: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface PostalCode {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
required: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface Suburb {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
required: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface Language extends SymfonyModel {
|
|
59
|
+
code: string;
|
|
60
|
+
name: string;
|
|
61
|
+
}
|
|
62
|
+
export interface State extends SymfonyModel {
|
|
63
|
+
country: Country;
|
|
64
|
+
code: string;
|
|
65
|
+
name: string;
|
|
66
|
+
}
|
|
67
|
+
export interface Currency extends SymfonyModel {
|
|
68
|
+
code: string;
|
|
69
|
+
name: string;
|
|
70
|
+
symbol: string;
|
|
71
|
+
}
|