@experteam-mx/ngx-services 18.8.22 → 18.8.24

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 (27) hide show
  1. package/esm2022/lib/apis/api-companies.service.mjs +1 -11
  2. package/esm2022/lib/apis/api-external-ops.service.mjs +87 -0
  3. package/esm2022/lib/apis/api-quote.service.mjs +87 -0
  4. package/esm2022/lib/apis/models/api-companies.interfaces.mjs +1 -1
  5. package/esm2022/lib/apis/models/api-companies.types.mjs +1 -1
  6. package/esm2022/lib/apis/models/api-external-ops.interfaces.mjs +2 -0
  7. package/esm2022/lib/apis/models/api-external-ops.types.mjs +2 -0
  8. package/esm2022/lib/apis/models/api-quote.interfaces.mjs +2 -0
  9. package/esm2022/lib/apis/models/api-quote.types.mjs +2 -0
  10. package/esm2022/lib/interceptors/api-key.interceptor.mjs +48 -0
  11. package/esm2022/lib/ngx-services.models.mjs +1 -1
  12. package/esm2022/public-api.mjs +5 -2
  13. package/fesm2022/experteam-mx-ngx-services.mjs +133 -60
  14. package/fesm2022/experteam-mx-ngx-services.mjs.map +1 -1
  15. package/lib/apis/api-companies.service.d.ts +1 -8
  16. package/lib/apis/api-external-ops.service.d.ts +54 -0
  17. package/lib/apis/api-quote.service.d.ts +65 -0
  18. package/lib/apis/models/api-companies.interfaces.d.ts +0 -10
  19. package/lib/apis/models/api-companies.types.d.ts +4 -10
  20. package/lib/apis/models/api-external-ops.interfaces.d.ts +21 -0
  21. package/lib/apis/models/api-external-ops.types.d.ts +35 -0
  22. package/lib/apis/models/api-quote.interfaces.d.ts +13 -0
  23. package/lib/apis/models/api-quote.types.d.ts +17 -0
  24. package/lib/interceptors/api-key.interceptor.d.ts +35 -0
  25. package/lib/ngx-services.models.d.ts +2 -1
  26. package/package.json +1 -1
  27. package/public-api.d.ts +4 -1
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '../ngx-services.models';
2
2
  import { HttpClient } from '@angular/common/http';
3
- import { AccountCategoriesOut, AccountEntitiesIn, AccountEntitiesOut, AccountIn, AccountOut, AccountsOut, AccountTypeIn, AccountTypeOut, AccountTypesOut, BoardingProcessIdIn, BoardingProcessIn, CompanyCountriesOut, CompanyCountryIn, CompanyCountryOut, CompanyCountryTaxesOut, CompanyIn, CompanyOut, CountryReferenceCurrenciesOut, CountryReferenceCurrencyIn, CountryReferenceCurrencyOut, CountryReferenceExtraChargeIn, CountryReferenceExtraChargeOut, CountryReferenceIn, CountryReferenceOut, CountryReferenceProductIn, CountryReferenceProductOut, CountryReferenceProductsOut, CountryReferencesOut, EmployeeCustomersIn, EmployeeCustomersOut, EmployeeIn, EmployeeOut, EmployeesCustomersOut, EmployeesOut, ExchangeIn, ExchangeOut, ExchangesOut, ExtraChargeEntitiesIn, ExtraChargeEntitiesOut, ExtraChargeEntityGlobalConfigIn, ExtraChargeEntityGlobalConfigOut, InstallationIn, InstallationOut, InstallationsOut, LocationEmployeeBatchIn, LocationEmployeeOut, LocationEmployeesOut, LocationIn, LocationOut, LocationsOut, ParameterConfigIn, ParameterConfigOut, ParameterConfigsOut, ParametersByLevelIn, ParametersOut, ParametersValuesIn, ParametersValuesOut, ParameterValueIn, ParameterValueOut, ProductEntitiesIn, ProductEntitiesOut, SupplyEntitiesIn, SupplyEntitiesOut, SystemEntitiesIn, SystemEntitiesOut, SystemIn, SystemOut, SystemsOut, TDXAccountSettingsIn, TDXAccountSettingsOut, TDXAccountsSettingsOut, WorkflowConfigsBatchIn, WorkflowConfigsOut, WorkflowsOut } from './models/api-companies.types';
3
+ import { AccountCategoriesOut, AccountEntitiesIn, AccountEntitiesOut, AccountIn, AccountOut, AccountsOut, AccountTypeIn, AccountTypeOut, AccountTypesOut, BoardingProcessIdIn, BoardingProcessIn, CompanyCountriesOut, CompanyCountryIn, CompanyCountryOut, CompanyCountryTaxesOut, CompanyIn, CompanyOut, CountryReferenceCurrenciesOut, CountryReferenceCurrencyIn, CountryReferenceCurrencyOut, CountryReferenceExtraChargeIn, CountryReferenceExtraChargeOut, CountryReferenceIn, CountryReferenceOut, CountryReferenceProductIn, CountryReferenceProductOut, CountryReferenceProductsOut, CountryReferencesOut, EmployeeCustomersIn, EmployeeCustomersOut, EmployeeIn, EmployeeOut, EmployeesCustomersOut, EmployeesOut, ExchangeIn, ExchangeOut, ExchangesOut, ExtraChargeEntitiesIn, ExtraChargeEntitiesOut, InstallationIn, InstallationOut, InstallationsOut, LocationEmployeeBatchIn, LocationEmployeeOut, LocationEmployeesOut, LocationIn, LocationOut, LocationsOut, ParameterConfigIn, ParameterConfigOut, ParameterConfigsOut, ParametersByLevelIn, ParametersOut, ParametersValuesIn, ParametersValuesOut, ParameterValueIn, ParameterValueOut, ProductEntitiesIn, ProductEntitiesOut, SupplyEntitiesIn, SupplyEntitiesOut, SystemEntitiesIn, SystemEntitiesOut, SystemIn, SystemOut, SystemsOut, TDXAccountSettingsIn, TDXAccountSettingsOut, TDXAccountsSettingsOut, WorkflowConfigsBatchIn, WorkflowConfigsOut, WorkflowsOut } from './models/api-companies.types';
4
4
  import { QueryParams } from './models/api.models';
5
5
  import { Observable } from 'rxjs';
6
6
  import { CountryCurrencyRate, CountryReferenceExtraCharge, EmployeeCustomerDhl } from './models/api-companies.interfaces';
@@ -709,13 +709,6 @@ export declare class ApiCompaniesService {
709
709
  token: string;
710
710
  queryParams: QueryParams;
711
711
  }): Observable<LocationEmployeesOut>;
712
- /**
713
- * Sends a POST request to create the global configuration for extra charge entities.
714
- *
715
- * @param {ExtraChargeEntityGlobalConfigIn} body - The request body containing the global configuration data for extra charge entities.
716
- * @return {Observable<ExtraChargeEntityGlobalConfigOut>} An observable that emits the created global configuration for extra charge entities.
717
- */
718
- postExtraChargeEntityGlobalConfig(body: ExtraChargeEntityGlobalConfigIn): Observable<ExtraChargeEntityGlobalConfigOut>;
719
712
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiCompaniesService, never>;
720
713
  static ɵprov: i0.ɵɵInjectableDeclaration<ApiCompaniesService>;
721
714
  }
@@ -0,0 +1,54 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { Environment } from '../ngx-services.models';
4
+ import { DeliveryConfirmationCompleteIn, DeliveryConfirmationGenerateIn, DeliveryConfirmationGenerateOut, DeliveryConfirmationIn, DeliveryConfirmationSearchOut } from './models/api-external-ops.types';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ApiExternalOperationsService {
7
+ private http;
8
+ private environment;
9
+ private appKey;
10
+ constructor(http: HttpClient, environment: Environment);
11
+ /**
12
+ * Getter method to retrieve the API's external operations URL.
13
+ * Fetches the URL from the `apiExternalOperationsUrl` property of the environment object.
14
+ * Defaults to an empty string if the property is undefined or null.
15
+ *
16
+ * @return {string} The external operations URL or an empty string if unavailable.
17
+ */
18
+ get url(): string;
19
+ /**
20
+ * Retrieves delivery confirmation details based on the provided OTP code.
21
+ *
22
+ * @param {string} otpCode - The OTP code used to search for delivery confirmation.
23
+ * @return {Observable<DeliveryConfirmationData>} An observable containing the delivery confirmation data.
24
+ */
25
+ getDeliveryConfirmation(otpCode: string): Observable<DeliveryConfirmationSearchOut>;
26
+ /**
27
+ * Generates a delivery confirmation by sending the provided payload to the API.
28
+ *
29
+ * @param {DeliveryConfirmationGenerateIn} payload - The input payload required to generate the delivery confirmation.
30
+ * @return {Observable<DeliveryConfirmationGenerateOut>} An observable that emits the generated delivery confirmation data.
31
+ */
32
+ postDeliveryConfirmationGenerate(payload: DeliveryConfirmationGenerateIn): Observable<DeliveryConfirmationGenerateOut>;
33
+ /**
34
+ * Confirms the completion of a delivery operation by making a PATCH request.
35
+ *
36
+ * @param {Object} input - The input parameters for the method.
37
+ * @param {string} input.operationId - The unique identifier of the delivery operation to be confirmed.
38
+ * @param {string} input.keyOTP - The one-time password (OTP) key associated with the delivery confirmation.
39
+ * @return {Observable<Object>} - An observable containing the response data from the API.
40
+ */
41
+ patchDeliveryConfirmationComplete({ keyOTP, operationId, }: DeliveryConfirmationCompleteIn): Observable<{}>;
42
+ /**
43
+ * Cancels a delivery confirmation by sending an OTP and additional data to the server.
44
+ *
45
+ * @param {Object} param0 - The parameter object containing the required properties.
46
+ * @param {string} param0.otp - The one-time password to authenticate the cancellation request.
47
+ * @param {Object} param0.body - Additional body data required for cancellation.
48
+ * @return {Observable<Object>} An observable that emits the server's response when the cancellation is processed.
49
+ */
50
+ putDeliveryConfirmation({ otp, ...body }: DeliveryConfirmationIn): Observable<{}>;
51
+ private getAppKeyHeader;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiExternalOperationsService, never>;
53
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiExternalOperationsService>;
54
+ }
@@ -0,0 +1,65 @@
1
+ import { Environment } from '../ngx-services.models';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { QueryParams } from './models/api.models';
4
+ import { Observable } from 'rxjs';
5
+ import { QuoteEventIn, QuoteEventOut, QuoteEventsOut, QuoteEventTypesOut } from './models/api-quote.types';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Service to manage quote-related events.
9
+ *
10
+ * This service provides methods to retrieve, create, and get event types
11
+ * related to quote processes.
12
+ */
13
+ export declare class ApiQuoteService {
14
+ private environments;
15
+ private http;
16
+ constructor(environments: Environment, http: HttpClient);
17
+ /**
18
+ * Base URL for the Quotes API.
19
+ */
20
+ get url(): string;
21
+ /**
22
+ * Retrieves all registered events for a specific quote.
23
+ *
24
+ * @param id - Quote identifier.
25
+ * @param params - Optional query parameters such as pagination or filtering.
26
+ * @returns Observable containing the list of quote events.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * this.apiQuoteService.getQuoteEvents(10, { page: 1 })
31
+ * .subscribe((events) => console.log(events))
32
+ * ```
33
+ */
34
+ getQuoteEvents(id: number, params: QueryParams): Observable<QuoteEventsOut>;
35
+ /**
36
+ * Registers a new event related to a specific quote.
37
+ *
38
+ * @param id - Quote identifier.
39
+ * @param body - Event payload to be created.
40
+ * @returns Observable containing the newly created event.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const event: QuoteEventIn = { code: 'WON', note: 'Client approved' }
45
+ * this.apiQuoteService.postQuoteEvents(10, event)
46
+ * .subscribe((response) => console.log(response))
47
+ * ```
48
+ */
49
+ postQuoteEvents(id: number, body: QuoteEventIn): Observable<QuoteEventOut>;
50
+ /**
51
+ * Retrieves the available quote event types.
52
+ *
53
+ * @param params - Optional query parameters such as pagination or filtering.
54
+ * @returns Observable containing the list of event types.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * this.apiQuoteService.getQuoteEventTypes({ page: 1 })
59
+ * .subscribe((types) => console.log(types))
60
+ * ```
61
+ */
62
+ getQuoteEventTypes(params: QueryParams): Observable<QuoteEventTypesOut>;
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiQuoteService, never>;
64
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiQuoteService>;
65
+ }
@@ -339,13 +339,3 @@ export interface SupplyEntityPacking {
339
339
  created_at: string;
340
340
  updated_at: string;
341
341
  }
342
- export interface ExtraChargeEntityConfigGlobal extends LaravelModel {
343
- extracharge_id: number;
344
- entity_id: number;
345
- entity: EntityExtraCharge;
346
- }
347
- export interface EntityExtraCharge extends LaravelModel {
348
- level: string;
349
- model_type: string;
350
- model_id: string;
351
- }
@@ -1,4 +1,4 @@
1
- import { Account, AccountCategory, AccountType, BoardingProcess, Company, CompanyCountry, CompanyCountryTax, CountryExchange, CountryReference, CountryReferenceCurrency, CountryReferenceExtraCharge, CountryReferenceProduct, Employee, EmployeeCustomerDhl, ExtraChargeEntity, ExtraChargeEntityConfigGlobal, Installation, Location, LocationEmployee, Parameter, ParameterConfig, ProductEntity, SupplyEntity, System, TDXAccountSetting, WorkflowConfig } from './api-companies.interfaces';
1
+ import { Account, AccountCategory, AccountType, BoardingProcess, Company, CompanyCountry, CompanyCountryTax, CountryExchange, CountryReference, CountryReferenceCurrency, CountryReferenceExtraCharge, CountryReferenceProduct, Employee, EmployeeCustomerDhl, ExtraChargeEntity, Installation, Location, LocationEmployee, Parameter, ParameterConfig, ProductEntity, SupplyEntity, System, TDXAccountSetting, WorkflowConfig } from './api-companies.interfaces';
2
2
  import { QueryParams } from './api.models';
3
3
  export type LocationEmployeesOut = {
4
4
  location_employees: LocationEmployee[];
@@ -411,12 +411,13 @@ export type CountryReferenceProductOut = {
411
411
  country_reference_product: CountryReferenceProduct;
412
412
  };
413
413
  export type ExtraChargeEntitiesIn = {
414
- model_type: string;
415
- model_id: number;
414
+ model_type?: string;
415
+ model_id?: number;
416
416
  extracharge_entities: {
417
417
  id: number;
418
418
  is_active: boolean;
419
419
  }[];
420
+ check_all?: boolean;
420
421
  };
421
422
  export type ExtraChargeEntitiesOut = {
422
423
  extracharge_entities: ExtraChargeEntity[];
@@ -455,10 +456,3 @@ export type TDXAccountSettingsIn = {
455
456
  export type LocationEmployeesIn = {
456
457
  token: string;
457
458
  } & QueryParams;
458
- export type ExtraChargeEntityGlobalConfigIn = {
459
- extracharge_id: number;
460
- is_active?: boolean;
461
- };
462
- export type ExtraChargeEntityGlobalConfigOut = {
463
- extracharge_entities: ExtraChargeEntityConfigGlobal;
464
- };
@@ -0,0 +1,21 @@
1
+ import { LaravelModel } from './api.models';
2
+ export interface Operation extends LaravelModel {
3
+ _id: string;
4
+ operation_id: number;
5
+ status: 'Pending' | 'Completed' | 'Canceled';
6
+ code: number;
7
+ signature: {
8
+ signature_base_64: string;
9
+ mime_type: 'image/png';
10
+ client: {
11
+ full_name: string;
12
+ };
13
+ package_detail: {
14
+ shipment_tracking_number: string;
15
+ pieces: {
16
+ tracking_number: string;
17
+ status: null | 'damaged' | 'lost';
18
+ }[];
19
+ }[];
20
+ };
21
+ }
@@ -0,0 +1,35 @@
1
+ import { Operation } from './api-external-ops.interfaces';
2
+ export type DeliveryConfirmationGenerateOut = {
3
+ code: string;
4
+ };
5
+ export type DeliveryConfirmationGenerateIn = {
6
+ operation_id: number;
7
+ signature: {
8
+ client: {
9
+ full_name: string;
10
+ };
11
+ package_detail: {
12
+ shipment_tracking_number: string;
13
+ pieces: {
14
+ tracking_number: string;
15
+ status: string;
16
+ }[];
17
+ }[];
18
+ };
19
+ };
20
+ export type DeliveryConfirmationCompleteIn = {
21
+ operationId: number;
22
+ keyOTP: string;
23
+ };
24
+ export type DeliveryConfirmationIn = {
25
+ signature: {
26
+ status: string;
27
+ operation_id: number;
28
+ signature_base_64: string;
29
+ mime_type: string;
30
+ };
31
+ otp?: string;
32
+ };
33
+ export type DeliveryConfirmationSearchOut = {
34
+ operation: Operation;
35
+ };
@@ -0,0 +1,13 @@
1
+ import { ActiveLessSymfonyModel, SymfonyModel } from './api.models';
2
+ export interface QuoteEvent extends ActiveLessSymfonyModel {
3
+ date: string;
4
+ quoteEventType: QuoteEventType;
5
+ comment: string;
6
+ userId: number;
7
+ userUsername: string;
8
+ userName: string;
9
+ }
10
+ export interface QuoteEventType extends SymfonyModel {
11
+ code: string;
12
+ name: string;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { QuoteEvent, QuoteEventType } from './api-quote.interfaces';
2
+ export type QuoteEventsOut = {
3
+ total: number;
4
+ quoteEvents: QuoteEvent[];
5
+ };
6
+ export type QuoteEventIn = {
7
+ date: string;
8
+ quoteEventTypeId: number;
9
+ comment: string;
10
+ };
11
+ export interface QuoteEventOut {
12
+ quoteEvent: QuoteEvent;
13
+ }
14
+ export interface QuoteEventTypesOut {
15
+ total: number;
16
+ quoteEventTypes: QuoteEventType[];
17
+ }
@@ -0,0 +1,35 @@
1
+ import { HttpEvent, HttpHandlerFn, HttpRequest } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ /**
4
+ * HTTP interceptor that injects the external operations API key into outbound requests.
5
+ *
6
+ * The interceptor:
7
+ * 1. Reads `apiExternalOperationsKey` from the injected `ENVIRONMENT_TOKEN`.
8
+ * 2. Skips modification if the key is absent.
9
+ * 3. Leaves the request unchanged if it already contains an `AppKey` header (caller override).
10
+ * 4. Otherwise clones the request adding `AppKey: apiExternalOperationsKey`.
11
+ *
12
+ * This enables centralized, transparent authentication for services targeting external
13
+ * operations endpoints while allowing explicit per-request overrides.
14
+ *
15
+ * Example:
16
+ * ```ts
17
+ * provideHttpClient(
18
+ * withInterceptors([apiKeyInterceptor])
19
+ * );
20
+ * ```
21
+ *
22
+ * @param request The original immutable `HttpRequest` instance.
23
+ * @param next The next handler in the interceptor chain, used to forward the (possibly cloned) request.
24
+ * @returns An `Observable` stream of the HTTP events for the (potentially augmented) request.
25
+ *
26
+ * @remarks
27
+ * - If you need to intentionally send a different key for a specific request, set the `AppKey`
28
+ * header manually before this interceptor runs.
29
+ * - If `apiExternalOperationsKey` is undefined (e.g., missing configuration), the request is passed through unchanged.
30
+ * - Order matters: place this interceptor before others that rely on the presence of the `AppKey` header.
31
+ *
32
+ * @see HttpRequest
33
+ * @see HttpHandlerFn
34
+ */
35
+ export declare function apiKeyInterceptor(request: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>>;
@@ -27,14 +27,15 @@ export type Environment = {
27
27
  apiCompositionUrl?: string;
28
28
  apiCustomsUrl?: string;
29
29
  apiDiscountsUrl?: string;
30
- apiEventsUrl?: string;
31
30
  apiEToolsAutoBilling?: string;
31
+ apiEventsUrl?: string;
32
32
  apiExternalOperationsKey?: string;
33
33
  apiExternalOperationsUrl?: string;
34
34
  apiInventoriesUrl?: string;
35
35
  apiInvoicesUrl?: string;
36
36
  apiNotificationsUrl?: string;
37
37
  apiOpenItemsUrl?: string;
38
+ apiQuotesUrl?: string;
38
39
  apiReportsUrl?: string;
39
40
  apiSecurityUrl?: string;
40
41
  apiServicesUrl?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.8.22",
3
+ "version": "18.8.24",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [
package/public-api.d.ts CHANGED
@@ -11,13 +11,14 @@ export * from './lib/apis/api-companies.service';
11
11
  export * from './lib/apis/api-composition.service';
12
12
  export * from './lib/apis/api-customs.service';
13
13
  export * from './lib/apis/api-discounts.service';
14
- export * from './lib/apis/api-events.service';
15
14
  export * from './lib/apis/api-e-tools-auto-billing.service';
15
+ export * from './lib/apis/api-events.service';
16
16
  export * from './lib/apis/api-external-pickups.service';
17
17
  export * from './lib/apis/api-inventories.service';
18
18
  export * from './lib/apis/api-invoices.service';
19
19
  export * from './lib/apis/api-notifications.service';
20
20
  export * from './lib/apis/api-open-items.service';
21
+ export * from './lib/apis/api-quote.service';
21
22
  export * from './lib/apis/api-reports.service';
22
23
  export * from './lib/apis/api-security.service';
23
24
  export * from './lib/apis/api-services.service';
@@ -60,6 +61,8 @@ export * from './lib/apis/models/api-notifications.interfaces';
60
61
  export * from './lib/apis/models/api-notifications.types';
61
62
  export * from './lib/apis/models/api-open-items.interfaces';
62
63
  export * from './lib/apis/models/api-open-items.types';
64
+ export * from './lib/apis/models/api-quote.interfaces';
65
+ export * from './lib/apis/models/api-quote.types';
63
66
  export * from './lib/apis/models/api-reports.interfaces';
64
67
  export * from './lib/apis/models/api-reports.types';
65
68
  export * from './lib/apis/models/api-security.interfaces';