UNPKG

@experteam-mx/ngx-services

Version:

Angular common services for Experteam apps

260 lines (259 loc) 14.1 kB
import { Environment } from '../ngx-services.models'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { QueryParams } from './models/api.models'; import { CancellationReasonIn, CancellationReasonOut, CancellationReasonsOut, CountriesOut, CountryIn, CountryOut, CurrenciesOut, ExtraChargeIn, ExtraChargeOut, ExtraChargesOut, GenericFolioIn, GenericFolioOut, GenericFoliosOut, IdentificationTypesOut, LanguagesOut, ManagementAreasOut, OperationTypesOut, PostalLocationsOut, ProductIn, ProductOut, RegionsOut, ShipmentContentTypesOut, ShipmentIncomeTypeIn, ShipmentIncomeTypeOut, ShipmentIncomeTypesOut, ShipmentScopesOut, UniqueFolioIn, UniqueFolioOut, UniqueFoliosOut, UnitsOut, ZonesOut } from './models/api-catalog.types'; import * as i0 from "@angular/core"; export declare class ApiCatalogsService { private environments; private http; constructor(environments: Environment, http: HttpClient); /** * Retrieves the URL for the reports API from the environment configurations. * * @return {string} The URL of the reports API. */ get url(): string; /** * Retrieves the list of collection payments * * @param {QueryParams} params - The query parameters used to fetch the operation types. * @return {Observable<OperationTypesOut[]>} An observable that emits an array of operation type. */ getOperationTypes(params: QueryParams): Observable<OperationTypesOut>; /** * Retrieves the list of identificatios types * * @param {QueryParams} params - The query parameters used to fetch the identification types. * @return {Observable<IdentificationTypesOut[]>} An observable that emits an array of identification type. */ getIdentificationTypes(params: QueryParams): Observable<IdentificationTypesOut>; /** * Fetches the extra charges based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter the results. * @return {Observable<ExtraChargesOut>} An observable emitting the extra charges data. */ getExtraCharges(params: QueryParams): Observable<ExtraChargesOut>; /** * Submits an extra charge request to the server and returns the created extra charge details. * * @param {ExtraChargeIn} body - The data for the extra charge to be created. * @return {Observable<ExtraChargeOut>} An observable that emits the details of the created extra charge. */ postExtraCharge(body: ExtraChargeIn): Observable<ExtraChargeOut>; /** * Updates an extra charge entity with new data and returns the updated entity. * * @param {number} id - The unique identifier of the extra charge to update. * @param {ExtraChargeIn} body - The new data for the extra charge. * @return {Observable<ExtraChargeOut>} An observable emitting the updated extra charge entity. */ putExtraCharge(id: number, body: ExtraChargeIn): Observable<ExtraChargeOut>; /** * Fetches a list of countries from the API. * * @param {QueryParams} params - The query parameters to be passed to the API request. * @return {Observable<CountriesOut>} An observable containing the list of countries. */ getCountries(params: QueryParams): Observable<CountriesOut>; /** * Retrieves the details of a country based on its ID. * * @param {number} id - The identifier of the country to fetch. * @return {Observable<CountryOut>} An observable that emits the country data. */ getCountry(id: number): Observable<CountryOut>; /** * Updates the details of a specific country by its ID. * * @param {number} id - The unique identifier of the country to be updated. * @param {CountryIn} body - The data to update the country with. * @return {Observable<CountryOut>} An observable that emits the updated country data. */ putCountry(id: number, body: CountryIn): Observable<CountryOut>; /** * Fetches postal location details based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter and fetch postal location data. * @return {Observable<PostalLocationsOut>} An observable that emits the postal location details. */ getPostalLocations(params: QueryParams): Observable<PostalLocationsOut>; /** * Fetches a list of regions based on the provided query parameters. * * @param {QueryParams} params - The query parameters used to filter the regions. * @return {Observable<RegionsOut>} An observable that emits the list of regions. */ getRegions(params: QueryParams): Observable<RegionsOut>; /** * Fetches the zones data based on the provided query parameters. * * @param {QueryParams} params - The query parameters used to filter the zones data. * @return {Observable<ZonesOut>} An observable that emits the fetched zones data. */ getZones(params: QueryParams): Observable<ZonesOut>; /** * Fetches the management areas based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter the management areas. * @return {Observable<ManagementAreasOut>} An observable that emits the management areas data. */ getManagementAreas(params: QueryParams): Observable<ManagementAreasOut>; /** * Retrieves cancellation reasons from the server based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter the cancellation reasons. * @return {Observable<CancellationReasonsOut>} An observable containing the retrieved cancellation reasons. */ getCancellationReasons(params: QueryParams): Observable<CancellationReasonsOut>; /** * Sends a cancellation reason to the server. * * @param {CancellationReasonIn} body - The cancellation reason object to be sent. * @return {Observable<CancellationReasonOut>} An observable containing the server's response with the processed cancellation reason. */ postCancellationReason(body: CancellationReasonIn): Observable<CancellationReasonOut>; /** * Updates the cancellation reason for the specified ID with the provided data. * * @param {number} id - The unique identifier of the cancellation reason to update. * @param {CancellationReasonIn} body - The details of the cancellation reason to be updated. * @return {Observable<CancellationReasonOut>} An observable containing the updated cancellation reason. */ putCancellationReason(id: number, body: CancellationReasonIn): Observable<CancellationReasonOut>; /** * Retrieves a list of currencies based on the provided query parameters. * * @param {QueryParams} params - The query parameters to customize the currency retrieval request. * @return {Observable<CurrenciesOut>} An observable that emits the retrieved currencies data. */ getCurrencies(params: QueryParams): Observable<CurrenciesOut>; /** * Fetches the list of available languages based on the provided query parameters. * * @param {QueryParams} params - The query parameters to pass with the HTTP request. * @return {Observable<LanguagesOut>} An observable that emits the available languages. */ getLanguages(params: QueryParams): Observable<LanguagesOut>; /** * Fetches the available units from the API based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter the units being fetched. * @return {Observable<UnitsOut>} An observable that emits the retrieved units data. */ getUnits(params: QueryParams): Observable<UnitsOut>; /** * Retrieves the shipment scopes based on the provided query parameters. * * @param {QueryParams} params The query parameters to filter or modify the request for shipment scopes. * @return {Observable<ShipmentScopesOut>} An observable that emits the shipment scopes data. */ getShipmentScopes(params: QueryParams): Observable<ShipmentScopesOut>; /** * Fetches the available shipment content types based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter the shipment content types. * @return {Observable<ShipmentContentTypesOut>} An observable that emits the shipment content types data. */ getShipmentContentTypes(params: QueryParams): Observable<ShipmentContentTypesOut>; /** * Fetches a list of generic folios based on the given query parameters. * * @param {QueryParams} params - The query parameters used to filter the generic folios. * @return {Observable<GenericFoliosOut>} An observable containing the fetched generic folios. */ getGenericFolios(params: QueryParams): Observable<GenericFoliosOut>; /** * Sends a POST request to create or update a generic folio. * * @param {GenericFolioIn} body - The payload containing the details of the generic folio to be created or updated. * @return {Observable<GenericFolioOut>} An observable containing the response data of the created or updated generic folio. */ postGenericFolio(body: GenericFolioIn): Observable<GenericFolioOut>; /** * Updates a generic folio with the specified ID using the provided data. * * @param {number} id - The unique identifier of the generic folio to update. * @param {GenericFolioIn} body - The data to update the generic folio with. * @return {Observable<GenericFolioOut>} An observable containing the updated generic folio. */ putGenericFolio(id: number, body: GenericFolioIn): Observable<GenericFolioOut>; /** * Sends a PUT request to update a Generic Folio resource with the specified ID and body data, and returns the updated resource. * * @param {number} id - The unique identifier of the Generic Folio to be updated. * @param {Partial<GenericFolioIn>} body - The partial data representing the changes to be applied to the Generic Folio. * @return {Observable<GenericFolioOut>} An observable containing the updated Generic Folio resource. */ pathGenericFolio(id: number, body: Partial<GenericFolioIn>): Observable<GenericFolioOut>; /** * Sends a POST request to create a new product. * * @param {ProductIn} body - The product data to be sent in the request body. * @return {Observable<ProductOut>} An observable emitting the created product data. */ postProduct(body: ProductIn): Observable<ProductOut>; /** * Updates an existing product with the given ID using the provided data. * * @param {number} id - The unique identifier of the product to update. * @param {ProductIn} body - The product data to update. * @return {Observable<ProductOut>} An observable containing the updated product data. */ putProduct(id: number, body: ProductIn): Observable<ProductOut>; /** * Retrieves a list of shipment income types based on the provided query parameters. * * @param {QueryParams} params - The query parameters to filter the shipment income types. * @return {Observable<ShipmentIncomeTypesOut>} An observable containing the shipment income types data. */ getShipmentIncomeTypes(params: QueryParams): Observable<ShipmentIncomeTypesOut>; /** * Sends a POST request to create a new shipment income type. * * @param {ShipmentIncomeTypeIn} body The payload containing the details of the shipment income type to be created. * @return {Observable<ShipmentIncomeTypeOut>} An observable that emits the created shipment income type data. */ postShipmentIncomeType(body: ShipmentIncomeTypeIn): Observable<ShipmentIncomeTypeOut>; /** * Updates the shipment income type with the specified ID. * * @param {number} id - The identifier of the shipment income type to update. * @param {ShipmentIncomeTypeIn} body - The data to update the shipment income type with. * @return {Observable<ShipmentIncomeTypeOut>} An observable emitting the updated shipment income type. */ putShipmentIncomeType(id: number, body: ShipmentIncomeTypeIn): Observable<ShipmentIncomeTypeOut>; /** * Retrieves a list of unique folios based on the provided query parameters. * * @param {QueryParams} params - The query parameters used to filter and fetch unique folios. * @return {Observable<UniqueFoliosOut>} An observable that emits the unique folios data. */ getUniqueFolios(params: QueryParams): Observable<UniqueFoliosOut>; /** * Sends a POST request to create a unique folio. * * @param {UniqueFolioIn} body - The data object containing details for the unique folio to be created. * @return {Observable<UniqueFolioOut>} An observable that emits the created unique folio details. */ postUniqueFolio(body: UniqueFolioIn): Observable<UniqueFolioOut>; /** * Updates a unique folio with the given data using the provided ID. * * @param {number} id - The ID of the unique folio to be updated. * @param {UniqueFolioIn} body - The payload containing the details of the unique folio to update. * @return {Observable<UniqueFolioOut>} An observable that emits the updated unique folio. */ putUniqueFolio(id: number, body: UniqueFolioIn): Observable<UniqueFolioOut>; /** * Updates a unique folio by its identifier with the provided data. * * @param {number} id - The identifier of the unique folio to update. * @param {Partial<UniqueFolioIn>} body - The partial data of the unique folio to update. * @return {Observable<UniqueFolioOut>} An observable emitting the updated unique folio data. */ pathUniqueFolio(id: number, body: Partial<UniqueFolioIn>): Observable<UniqueFolioOut>; static ɵfac: i0.ɵɵFactoryDeclaration<ApiCatalogsService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ApiCatalogsService>; }