@experteam-mx/ngx-services 18.2.0 → 18.3.1

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 (45) hide show
  1. package/esm2022/lib/apis/api-companies.service.mjs +35 -24
  2. package/esm2022/lib/apis/api-invoices.service.mjs +74 -0
  3. package/esm2022/lib/apis/api-reports.service.mjs +43 -0
  4. package/esm2022/lib/apis/api-security.service.mjs +66 -2
  5. package/esm2022/lib/apis/api-shipments.service.mjs +43 -0
  6. package/esm2022/lib/apis/models/api-companies.interfaces.mjs +1 -1
  7. package/esm2022/lib/apis/models/api-companies.types.mjs +1 -1
  8. package/esm2022/lib/apis/models/api-invoices.interfaces.mjs +2 -0
  9. package/esm2022/lib/apis/models/api-invoices.types.mjs +2 -0
  10. package/esm2022/lib/apis/models/api-reports.interfaces.mjs +2 -0
  11. package/esm2022/lib/apis/models/api-reports.types.mjs +2 -0
  12. package/esm2022/lib/apis/models/api-security.interfaces.mjs +1 -1
  13. package/esm2022/lib/apis/models/api-security.types.mjs +1 -1
  14. package/esm2022/lib/apis/models/api-shipments.types.mjs +2 -0
  15. package/esm2022/lib/apis/models/api.models.mjs +1 -1
  16. package/esm2022/lib/cypher/crypto.service.mjs +4 -3
  17. package/esm2022/lib/helpers/http.mjs +4 -4
  18. package/esm2022/lib/interceptors/api-headers.interceptor.mjs +15 -11
  19. package/esm2022/lib/interceptors/api-token.interceptor.mjs +8 -7
  20. package/esm2022/lib/interceptors/http-caching.interceptor.mjs +15 -4
  21. package/esm2022/lib/ngx-services.models.mjs +1 -1
  22. package/esm2022/public-api.mjs +9 -2
  23. package/fesm2022/experteam-mx-ngx-services.mjs +289 -49
  24. package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
  25. package/lib/apis/api-companies.service.d.ts +46 -39
  26. package/lib/apis/api-invoices.service.d.ts +48 -0
  27. package/lib/apis/api-reports.service.d.ts +26 -0
  28. package/lib/apis/api-security.service.d.ts +45 -1
  29. package/lib/apis/api-shipments.service.d.ts +26 -0
  30. package/lib/apis/models/api-companies.interfaces.d.ts +6 -193
  31. package/lib/apis/models/api-companies.types.d.ts +30 -22
  32. package/lib/apis/models/api-invoices.interfaces.d.ts +139 -0
  33. package/lib/apis/models/api-invoices.types.d.ts +44 -0
  34. package/lib/apis/models/api-reports.interfaces.d.ts +47 -0
  35. package/lib/apis/models/api-reports.types.d.ts +6 -0
  36. package/lib/apis/models/api-security.interfaces.d.ts +18 -7
  37. package/lib/apis/models/api-security.types.d.ts +27 -4
  38. package/lib/apis/models/api-shipments.types.d.ts +32 -0
  39. package/lib/apis/models/api.models.d.ts +5 -0
  40. package/lib/interceptors/api-headers.interceptor.d.ts +6 -5
  41. package/lib/interceptors/api-token.interceptor.d.ts +5 -5
  42. package/lib/interceptors/http-caching.interceptor.d.ts +8 -0
  43. package/lib/ngx-services.models.d.ts +6 -3
  44. package/package.json +9 -1
  45. package/public-api.d.ts +8 -1
@@ -1,4 +1,4 @@
1
- import { Session, User } from './api-security.interfaces';
1
+ import { Module, Role, RoleType, Session, User } from './api-security.interfaces';
2
2
  export type LoginIn = {
3
3
  username: string;
4
4
  password: string;
@@ -22,9 +22,32 @@ export type GetUserOut = {
22
22
  };
23
23
  export interface MeOut extends GetUserOut {
24
24
  }
25
- export type GetUserInfoIn = {
26
- token: string;
27
- };
28
25
  export type ChangeLanguageIn = {
29
26
  languageId: number;
30
27
  };
28
+ export type Pivot = {
29
+ role_id: number;
30
+ permission_id: number;
31
+ } | {
32
+ module_id: string;
33
+ permission_id: string;
34
+ };
35
+ export type RoleByIdOut = {
36
+ role: Role;
37
+ };
38
+ export type RolePermissionsIn = {
39
+ name: string;
40
+ role_type_id: number;
41
+ company_country_id: number;
42
+ regional_country_id?: number[] | null;
43
+ is_active: boolean;
44
+ permissions: string[];
45
+ };
46
+ export type RoleTypesOut = {
47
+ role_types: RoleType[];
48
+ total: number;
49
+ };
50
+ export type ModulePermissionsOut = {
51
+ modules: Module[];
52
+ total: number;
53
+ };
@@ -0,0 +1,32 @@
1
+ export type ValidateAccountIn = {
2
+ accountValue: string;
3
+ };
4
+ export type AccountResponse = {
5
+ status: true;
6
+ message: string;
7
+ name: string;
8
+ accountStatus: string;
9
+ creditStatus: string;
10
+ activityStatus: string;
11
+ country: string;
12
+ countryName: string;
13
+ isCreditStop: boolean;
14
+ isImportEnabled: boolean;
15
+ accountType: string;
16
+ isCash: boolean;
17
+ contactInfo: string | null;
18
+ registrationInfo: string | null;
19
+ users: {
20
+ id: string;
21
+ name: string;
22
+ valid: boolean;
23
+ }[];
24
+ } | {
25
+ status: false;
26
+ message: string;
27
+ users: [];
28
+ };
29
+ export type ValidateAccountOut = {
30
+ account: AccountResponse;
31
+ transactionId: string;
32
+ };
@@ -21,3 +21,8 @@ export interface SymfonyModel extends ApiModel {
21
21
  export type QueryParams = {
22
22
  [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
23
23
  };
24
+ export interface Translations {
25
+ [key: string]: {
26
+ [langCode: string]: string;
27
+ }[];
28
+ }
@@ -3,12 +3,13 @@ import { Observable } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ApiHeadersInterceptor implements HttpInterceptor {
5
5
  /**
6
- * Intercepts HTTP requests and adds common headers.
6
+ * Intercepts HTTP requests and modifies request headers to include caching, content type,
7
+ * accept language, and other HTTP-specific configurations before forwarding the request onward.
7
8
  *
8
- * @param {HttpRequest<unknown>} request - The HTTP request intercepted.
9
- * @param {HttpHandler} next - The next handler in the chain.
10
- *
11
- * @returns {Observable<HttpEvent<unknown>>} - Observable of the HTTP event after interception.
9
+ * @param {HttpRequest<unknown>} request - The HTTP request instance to be intercepted and modified.
10
+ * @param {HttpHandler} next - The next handler instance in the HTTP pipeline which processes
11
+ * the modified request and forwards it.
12
+ * @return {Observable<HttpEvent<unknown>>} An observable of the processed HTTP event.
12
13
  */
13
14
  intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiHeadersInterceptor, never>;
@@ -8,12 +8,12 @@ export declare class ApiTokenInterceptor implements HttpInterceptor {
8
8
  private cookie;
9
9
  constructor(environments: Environment, cookie: CookieService);
10
10
  /**
11
- * Intercepts the HTTP request and adds the Authorization header.
11
+ * Intercepts and modifies the outgoing HTTP request to include an authorization token
12
+ * from cookies if the request does not already have an Authorization or AppKey header.
12
13
  *
13
- * @param {HttpRequest<unknown>} request - The HTTP request to intercept.
14
- * @param {HttpHandler} next - The next HTTP handler in the chain.
15
- *
16
- * @returns {Observable<HttpEvent<unknown>>} - An observable containing the HTTP event.
14
+ * @param {HttpRequest<unknown>} request - The outgoing HTTP request to be intercepted.
15
+ * @param {HttpHandler} next - The next handler in the HTTP request processing chain.
16
+ * @return {Observable<HttpEvent<unknown>>} An observable of the HTTP event, modified or unmodified.
17
17
  */
18
18
  intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
19
19
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiTokenInterceptor, never>;
@@ -6,6 +6,14 @@ export declare class HttpCachingInterceptor implements HttpInterceptor {
6
6
  private envs;
7
7
  private cache;
8
8
  constructor(envs: Environment);
9
+ /**
10
+ * Intercepts HTTP requests to add caching functionality for GET requests.
11
+ * Non-GET requests are passed through without caching.
12
+ *
13
+ * @param {HttpRequest<any>} req - The HTTP request being intercepted.
14
+ * @param {HttpHandler} next - The next handler in the HTTP pipeline to execute the request.
15
+ * @return {Observable<HttpEvent<any>>} - An observable containing the HTTP response event, either from cache or the backend service.
16
+ */
9
17
  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
10
18
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpCachingInterceptor, never>;
11
19
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpCachingInterceptor>;
@@ -1,7 +1,10 @@
1
1
  export type Environment = {
2
+ apiCompaniesUrl: string;
3
+ apiInvoicesUrl: string;
4
+ apiReportsUrl: string;
5
+ apiSecurityUrl: string;
6
+ apiShipmentUrl: string;
2
7
  authCookie: string;
3
- secretKey: string;
4
8
  cacheTtl?: number;
5
- apiSecurityUrl: string;
6
- apiCompaniesUrl: string;
9
+ secretKey: string;
7
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.2.0",
3
+ "version": "18.3.1",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [
@@ -14,6 +14,14 @@
14
14
  {
15
15
  "name": "Iraldo Arévalo Delfín",
16
16
  "email": "iraldoarevalo@gmail.com"
17
+ },
18
+ {
19
+ "name": "Adel López Pantoja",
20
+ "email": "adellopezpantoja@gmail.com"
21
+ },
22
+ {
23
+ "name": "Byron Bladimir Taco Taco",
24
+ "email": "metal82fest@hotmail.com"
17
25
  }
18
26
  ],
19
27
  "repository": {
package/public-api.d.ts CHANGED
@@ -1,11 +1,18 @@
1
1
  export * from './lib/ngx-services.module';
2
2
  export * from './lib/apis/api-companies.service';
3
+ export * from './lib/apis/api-invoices.service';
4
+ export * from './lib/apis/api-reports.service';
3
5
  export * from './lib/apis/api-security.service';
4
- export * from './lib/apis/models/api.models';
6
+ export * from './lib/apis/api-shipments.service';
5
7
  export * from './lib/apis/models/api-companies.interfaces';
6
8
  export * from './lib/apis/models/api-companies.types';
9
+ export * from './lib/apis/models/api-invoices.interfaces';
10
+ export * from './lib/apis/models/api-invoices.types';
11
+ export * from './lib/apis/models/api-reports.interfaces';
7
12
  export * from './lib/apis/models/api-security.interfaces';
8
13
  export * from './lib/apis/models/api-security.types';
14
+ export * from './lib/apis/models/api-shipments.types';
15
+ export * from './lib/apis/models/api.models';
9
16
  export * from './lib/cypher/crypto.service';
10
17
  export * from './lib/interceptors/api-headers.interceptor';
11
18
  export * from './lib/interceptors/api-token.interceptor';