@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.
Files changed (72) hide show
  1. package/README.md +8 -8
  2. package/esm2022/lib/apis/api-companies.service.mjs +9 -7
  3. package/esm2022/lib/apis/api-security.service.mjs +15 -12
  4. package/esm2022/lib/apis/models/api-catalog.interfaces.mjs +2 -0
  5. package/esm2022/lib/apis/models/api-companies.interfaces.mjs +1 -1
  6. package/esm2022/lib/apis/models/api-security.interfaces.mjs +1 -1
  7. package/esm2022/lib/apis/models/api.models.mjs +1 -1
  8. package/esm2022/lib/helpers/http.mjs +4 -2
  9. package/esm2022/lib/interceptors/api-headers.interceptor.mjs +4 -4
  10. package/esm2022/lib/interceptors/api-token.interceptor.mjs +14 -8
  11. package/esm2022/lib/interceptors/http-caching.interceptor.mjs +8 -7
  12. package/esm2022/lib/ngx-services.models.mjs +1 -1
  13. package/esm2022/lib/ngx-services.module.mjs +7 -11
  14. package/esm2022/public-api.mjs +2 -9
  15. package/fesm2022/experteam-mx-ngx-services.mjs +53 -165
  16. package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
  17. package/index.d.ts +5 -5
  18. package/lib/apis/api-companies.service.d.ts +163 -163
  19. package/lib/apis/api-security.service.d.ts +79 -79
  20. package/lib/apis/models/{api-catalogs.interfaces.d.ts → api-catalog.interfaces.d.ts} +71 -75
  21. package/lib/apis/models/api-companies.interfaces.d.ts +380 -380
  22. package/lib/apis/models/api-companies.types.d.ts +75 -75
  23. package/lib/apis/models/api-security.interfaces.d.ts +55 -55
  24. package/lib/apis/models/api-security.types.d.ts +30 -30
  25. package/lib/apis/models/api.models.d.ts +23 -23
  26. package/lib/helpers/http.d.ts +38 -38
  27. package/lib/interceptors/api-headers.interceptor.d.ts +16 -16
  28. package/lib/interceptors/api-token.interceptor.d.ts +21 -19
  29. package/lib/interceptors/http-caching.interceptor.d.ts +12 -12
  30. package/lib/ngx-services.models.d.ts +6 -9
  31. package/lib/ngx-services.module.d.ts +16 -17
  32. package/package.json +10 -16
  33. package/public-api.d.ts +12 -19
  34. package/esm2020/experteam-mx-ngx-services.mjs +0 -5
  35. package/esm2020/lib/apis/api-catalogs.service.mjs +0 -42
  36. package/esm2020/lib/apis/api-companies.service.mjs +0 -255
  37. package/esm2020/lib/apis/api-external-ops.service.mjs +0 -53
  38. package/esm2020/lib/apis/api-security.service.mjs +0 -128
  39. package/esm2020/lib/apis/models/api-catalogs.interfaces.mjs +0 -2
  40. package/esm2020/lib/apis/models/api-catalogs.types.mjs +0 -2
  41. package/esm2020/lib/apis/models/api-companies.interfaces.mjs +0 -2
  42. package/esm2020/lib/apis/models/api-companies.types.mjs +0 -2
  43. package/esm2020/lib/apis/models/api-external-ops.interfaces.mjs +0 -2
  44. package/esm2020/lib/apis/models/api-external-ops.types.mjs +0 -2
  45. package/esm2020/lib/apis/models/api-security.interfaces.mjs +0 -2
  46. package/esm2020/lib/apis/models/api-security.types.mjs +0 -2
  47. package/esm2020/lib/apis/models/api.models.mjs +0 -2
  48. package/esm2020/lib/helpers/http.mjs +0 -64
  49. package/esm2020/lib/interceptors/api-headers.interceptor.mjs +0 -34
  50. package/esm2020/lib/interceptors/api-key.interceptor.mjs +0 -38
  51. package/esm2020/lib/interceptors/api-token.interceptor.mjs +0 -35
  52. package/esm2020/lib/interceptors/http-caching.interceptor.mjs +0 -38
  53. package/esm2020/lib/ngx-services.models.mjs +0 -2
  54. package/esm2020/lib/ngx-services.module.mjs +0 -37
  55. package/esm2020/public-api.mjs +0 -27
  56. package/esm2022/lib/apis/api-catalogs.service.mjs +0 -42
  57. package/esm2022/lib/apis/api-external-ops.service.mjs +0 -53
  58. package/esm2022/lib/apis/models/api-catalogs.interfaces.mjs +0 -2
  59. package/esm2022/lib/apis/models/api-catalogs.types.mjs +0 -2
  60. package/esm2022/lib/apis/models/api-external-ops.interfaces.mjs +0 -2
  61. package/esm2022/lib/apis/models/api-external-ops.types.mjs +0 -2
  62. package/esm2022/lib/interceptors/api-key.interceptor.mjs +0 -38
  63. package/fesm2015/experteam-mx-ngx-services.mjs +0 -723
  64. package/fesm2015/experteam-mx-ngx-services.mjs.map +0 -1
  65. package/fesm2020/experteam-mx-ngx-services.mjs +0 -705
  66. package/fesm2020/experteam-mx-ngx-services.mjs.map +0 -1
  67. package/lib/apis/api-catalogs.service.d.ts +0 -26
  68. package/lib/apis/api-external-ops.service.d.ts +0 -34
  69. package/lib/apis/models/api-catalogs.types.d.ts +0 -5
  70. package/lib/apis/models/api-external-ops.interfaces.d.ts +0 -23
  71. package/lib/apis/models/api-external-ops.types.d.ts +0 -18
  72. 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 http;
10
- private cookie;
11
- constructor(environments: Environment, http: HttpClient, cookie: CookieService);
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
+ }