UNPKG

@experteam-mx/ngx-services

Version:

Angular common services for Experteam apps

1 lines 412 kB
{"version":3,"file":"experteam-mx-ngx-services.mjs","sources":["../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.models.ts","../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.providers.ts","../../../../projects/experteam-mx/ngx-services/src/lib/ngx-services.module.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-co.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-do.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-gt.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-mx.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-pa.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-billing-sv.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-cash-operations.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-catalogs.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-companies.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-composition.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-customs.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-discounts.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-e-tools-auto-billing.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-events.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-external-ops.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-inventories.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-invoices.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-notifications.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-open-items.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-quote.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-reports.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-security.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-services.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-shipments.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-supplies.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/api-surveys.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-cash-operations.enum.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-catalog.enum.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-events.enum.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-inventories.enum.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-invoices.enum.ts","../../../../projects/experteam-mx/ngx-services/src/lib/apis/models/api-invoices.interfaces.ts","../../../../projects/experteam-mx/ngx-services/src/lib/websockets/web-sockets.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/cypher/crypto.service.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-headers.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-key.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/api-token.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/interceptors/http-caching.interceptor.ts","../../../../projects/experteam-mx/ngx-services/src/lib/helpers/files.ts","../../../../projects/experteam-mx/ngx-services/src/lib/helpers/http.ts","../../../../projects/experteam-mx/ngx-services/src/public-api.ts","../../../../projects/experteam-mx/ngx-services/src/experteam-mx-ngx-services.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\n/**\n * Represents the configuration settings for the application's environment.\n * This type includes various API endpoint URLs, authentication details, caching options, and other relevant settings.\n *\n * Properties:\n * - apiCompaniesUrl: The URL for the companies API endpoint.\n * - apiEventsUrl: The URL for the events API endpoint.\n * - apiInvoicesUrl: The URL for the invoices API endpoint.\n * - apiReportsUrl: The URL for the reports API endpoint.\n * - apiSecurityUrl: The URL for the security-related API endpoint.\n * - apiShipmentUrl: The URL for the shipment API endpoint.\n * - authCookie: The name of the authentication cookie used for user sessions.\n * - cacheTtl: Optional. Specifies the time-to-live (TTL) for cached items.\n * - printUrl: Optional. The URL used for generating or downloading printable documents.\n * - secretKey: A secret key used for authentication or other secure operations.\n */\nexport type Environment = {\n apiBillingCO?: string\n apiBillingDO?: string\n apiBillingGT?: string\n apiBillingMX?: string\n apiBillingPA?: string\n apiBillingSV?: string\n apiCashOperationsUrl?: string\n apiCatalogsUrl?: string\n apiCompaniesUrl?: string\n apiCompositionUrl?: string\n apiCustomsUrl?: string\n apiDiscountsUrl?: string\n apiEToolsAutoBilling?: string\n apiEventsUrl?: string\n apiExternalOperationsKey?: string\n apiExternalOperationsUrl?: string\n apiInventoriesUrl?: string\n apiInvoicesUrl?: string\n apiNotificationsUrl?: string\n apiOpenItemsUrl?: string\n apiQuotesUrl?: string\n apiReportsUrl?: string\n apiSecurityUrl?: string\n apiServicesUrl?: string\n apiShipmentUrl?: string\n apiSuppliesUrl?: string\n apiSurveysKey?: string\n apiSurveysUrl?: string\n authCookie?: string\n cacheTtl?: number\n printUrl?: string\n secretKey?: string\n sockets?: {\n app_key: string\n debug?: boolean\n port: number\n url: string\n }\n}\n\n/**\n * Injection token used to inject environment configurations.\n *\n * `ENVIRONMENT_TOKEN` is a dependency injection token that allows\n * for the provision and retrieval of environment-specific configurations\n * within the application. This token is typically associated with an\n * `Environment` type that defines the structure of the configuration.\n */\nexport const ENVIRONMENT_TOKEN = new InjectionToken<Environment>('ENVIRONMENT_TOKEN')\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'\nimport { ENVIRONMENT_TOKEN, type Environment } from './ngx-services.models'\n\n/**\n * Provides ngx-services dependencies for standalone Angular applications.\n *\n * Register this provider in `ApplicationConfig.providers` so all services in\n * this library can resolve the environment-based configuration.\n */\nexport function provideNgxServices (environment: Environment): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: ENVIRONMENT_TOKEN,\n useValue: environment\n }\n ])\n}\n","import { provideHttpClient } from '@angular/common/http'\nimport type { ModuleWithProviders } from '@angular/core'\nimport { NgModule } from '@angular/core'\nimport type { Environment } from './ngx-services.models'\nimport { provideNgxServices } from './ngx-services.providers'\n\n@NgModule({\n providers: [provideHttpClient()]\n})\nexport class NgxServicesModule {\n /**\n * Returns a module with providers for the NgxServicesModule.\n *\n * @param {Environment} environment - The environment configuration object.\n *\n * @return {ModuleWithProviders<NgxServicesModule>} The module with providers for the NgxServicesModule.\n *\n * @deprecated Use `provideNgxServices(environment)` in `ApplicationConfig.providers`\n * for standalone applications. This API will be removed in `20.2.0`.\n */\n public static forRoot (environment: Environment): ModuleWithProviders<NgxServicesModule> {\n return {\n ngModule: NgxServicesModule,\n providers: [provideNgxServices(environment)]\n }\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type {\n CoCustomerIn,\n CoDepartmentsOut,\n CoFiscalRegimesOut,\n CoFiscalResponsibilitiesOut,\n CoGetCustomerOut,\n CoMunicipalitiesOut,\n CoPostalCodesOut,\n CoPostCustomerOut,\n CoTributesOut\n} from './models/api-billing-co.types'\nimport type { ApiSuccess, QueryParams } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiBillingCOService {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Retrieves the URL for the billing API.\n * If the URL is not defined in the environments configuration, returns an empty string.\n *\n * @returns {string} The billing API URL or an empty string if not set.\n */\n get url (): string {\n return this.environments.apiBillingCO ?? ''\n }\n\n /**\n * Retrieves the information of a customer by its identifier.\n *\n * @param {number} id - Unique customer identifier.\n * @returns {Observable<CoGetCustomerOut>}\n * Observable emitting the customer information.\n */\n getCustomer (id: number): Observable<CoGetCustomerOut> {\n return this.http.get<ApiSuccess<CoGetCustomerOut>>(`${this.url}/customer/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a new customer.\n *\n * @param {CoCustomerIn} body - Customer data to be created.\n * @returns {Observable<CoPostCustomerOut>}\n * Observable emitting the created customer information.\n */\n postCustomer (body: CoCustomerIn): Observable<CoPostCustomerOut> {\n return this.http.post<ApiSuccess<CoPostCustomerOut>>(`${this.url}/customer`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of departments based on the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters used to filter or paginate the request.\n * @returns {Observable<CoDepartmentsOut>}\n * Observable emitting the departments list.\n */\n getDepartments (params: QueryParams): Observable<CoDepartmentsOut> {\n return this.http.get<ApiSuccess<CoDepartmentsOut>>(`${this.url}/departments`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of municipalities based on the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters used to filter or paginate the request.\n * @returns {Observable<CoMunicipalitiesOut>}\n * Observable emitting the municipalities list.\n */\n getMunicipalities (params: QueryParams): Observable<CoMunicipalitiesOut> {\n return this.http.get<ApiSuccess<CoMunicipalitiesOut>>(`${this.url}/municipalities`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of postal codes based on the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters used to filter or paginate the request.\n * @returns {Observable<CoPostalCodesOut>}\n * Observable emitting the postal codes list.\n */\n getPostalCodes (params: QueryParams): Observable<CoPostalCodesOut> {\n return this.http.get<ApiSuccess<CoPostalCodesOut>>(`${this.url}/postal-codes`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of fiscal regimes based on the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters used to filter or paginate the request.\n * @returns {Observable<CoFiscalRegimesOut>}\n * Observable emitting the fiscal regimes list.\n */\n getFiscalRegimes (params: QueryParams): Observable<CoFiscalRegimesOut> {\n return this.http.get<ApiSuccess<CoFiscalRegimesOut>>(`${this.url}/fiscal-regimes`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of fiscal responsibilities based on the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters used to filter or paginate the request.\n * @returns {Observable<CoFiscalResponsibilitiesOut>}\n * Observable emitting the fiscal responsibilities list.\n */\n getFiscalResponsibilities (params: QueryParams): Observable<CoFiscalResponsibilitiesOut> {\n return this.http.get<ApiSuccess<CoFiscalResponsibilitiesOut>>(`${this.url}/fiscal-responsibilities`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of tributes based on the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters used to filter or paginate the request.\n * @returns {Observable<CoTributesOut>}\n * Observable emitting the tributes list.\n */\n getTributes (params: QueryParams): Observable<CoTributesOut> {\n return this.http.get<ApiSuccess<CoTributesOut>>(`${this.url}/tributes`, { params })\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type { IncomeTypesOut } from './models/api-billing-do.types'\nimport type { ApiSuccess } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiBillingDOService {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Gets the base URL for Billing DO API endpoints.\n *\n * @returns {string} Billing DO API base URL, or an empty string when it is not configured.\n */\n get url (): string {\n return this.environments.apiBillingDO ?? ''\n }\n\n /**\n * Retrieves the list of income types from Billing DO.\n *\n * @returns {Observable<IncomeTypesOut>} Observable that emits the income types payload.\n */\n getIncomeTypes (): Observable<IncomeTypesOut> {\n return this.http.get<ApiSuccess<IncomeTypesOut>>(`${this.url}/income-types`)\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type {\n ApiBillingConfigurable,\n BillingConfigIn,\n BillingConfigOut,\n BillingConfigsOut\n} from './models/api-billing.models'\nimport type { ApiSuccess } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiBillingGtService implements ApiBillingConfigurable {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Gets the base URL for Billing GT API endpoints.\n *\n * @returns {string} Billing GT API base URL, or an empty string when it is not configured.\n */\n get url (): string {\n return this.environments.apiBillingGT ?? ''\n }\n\n /**\n * Retrieves the list of billing configurations by location.\n *\n * @returns {Observable<BillingConfigsOut>} Observable that emits the billing configurations payload.\n */\n getConfigs (): Observable<BillingConfigsOut> {\n return this.http.get<ApiSuccess<BillingConfigsOut>>(`${this.url}/location/configs`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves billing configuration details for a location.\n *\n * @param {number} id - Location identifier to fetch.\n * @returns {Observable<BillingConfigOut>} Observable that emits the location billing configuration payload.\n */\n getConfig (id: number): Observable<BillingConfigOut> {\n return this.http.get<ApiSuccess<BillingConfigOut>>(`${this.url}/locations/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a billing configuration for a location.\n *\n * @param {BillingConfigIn} body - Billing configuration payload for the location.\n * @returns {Observable<BillingConfigOut>} Observable that emits the created billing configuration payload.\n */\n postConfigs (body: BillingConfigIn): Observable<BillingConfigOut> {\n return this.http.post<ApiSuccess<BillingConfigOut>>(`${this.url}/locations`, body)\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type { FiscalRegimensAcceptedOut, FiscalRegimensOut, PostalCodesOut } from './models/api-billing-mx.types'\nimport type { ApiSuccess, QueryParams } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiBillingMxService {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Gets the base URL for Billing MX API endpoints.\n *\n * @returns {string} Billing MX API base URL, or an empty string when it is not configured.\n */\n get url (): string {\n return this.environments.apiBillingMX ?? ''\n }\n\n /**\n * Retrieves the list of fiscal regimens from Billing MX.\n *\n * @returns {Observable<FiscalRegimensOut>} Observable that emits the fiscal regimens payload.\n */\n getFiscalRegimens (): Observable<FiscalRegimensOut> {\n return this.http.get<ApiSuccess<FiscalRegimensOut>>(`${this.url}/fiscal-regimens`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the CFDI uses accepted for a fiscal regimen.\n *\n * @param {number} fiscalRegimen Fiscal regimen identifier used to filter accepted CFDI uses.\n * @returns {Observable<FiscalRegimensAcceptedOut>} Observable that emits the accepted CFDI uses payload.\n */\n getFiscalRegimensAccepted (fiscalRegimen: number): Observable<FiscalRegimensAcceptedOut> {\n const params = { 'fiscal-regimen': fiscalRegimen }\n\n return this.http.get<ApiSuccess<FiscalRegimensAcceptedOut>>(`${this.url}/cfdi-uses/fiscal-regimen-accepted/list`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves postal code information from Billing MX.\n *\n * @param {QueryParams} params Query parameters used by the postal codes endpoint.\n * @returns {Observable<PostalCodesOut>} Observable that emits the postal code data payload.\n */\n getPostalCodes (params: QueryParams): Observable<PostalCodesOut> {\n return this.http.get<ApiSuccess<PostalCodesOut>>(`${this.url}/postal-codes`, { params })\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type { BillingPaCustomerOut, DistrictsOut, ParishesOut, ProvincesOut } from './models/api-billing-pa.types'\nimport type { ApiBillingConfigurable, BillingConfigIn, BillingConfigOut, BillingConfigsOut } from './models/api-billing.models'\nimport type { ApiSuccess, QueryParams } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiBillingPaService implements ApiBillingConfigurable {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Gets the base URL for Billing PA API endpoints.\n *\n * @returns {string} Billing PA API base URL, or an empty string when it is not configured.\n */\n get url (): string {\n return this.environments.apiBillingPA ?? ''\n }\n\n /**\n * Retrieves the list of districts.\n *\n * @param {QueryParams} params Query parameters used by the districts endpoint.\n * @returns {Observable<DistrictsOut>} Observable that emits the districts payload.\n */\n getDistricts (params: QueryParams): Observable<DistrictsOut> {\n return this.http.get<ApiSuccess<DistrictsOut>>(`${this.url}/districts`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of parishes.\n *\n * @param {QueryParams} params Query parameters used by the parishes endpoint.\n * @returns {Observable<ParishesOut>} Observable that emits the parishes payload.\n */\n getParishes (params: QueryParams): Observable<ParishesOut> {\n return this.http.get<ApiSuccess<ParishesOut>>(`${this.url}/parishes`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of provinces.\n *\n * @param {QueryParams} params Query parameters used by the provinces endpoint.\n * @returns {Observable<ProvincesOut>} Observable that emits the provinces payload.\n */\n getProvinces (params: QueryParams): Observable<ProvincesOut> {\n return this.http.get<ApiSuccess<ProvincesOut>>(`${this.url}/provinces`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Validates a customer using Billing PA.\n *\n * @param {QueryParams} params Query parameters used by the customer validation endpoint.\n * @returns {Observable<BillingPaCustomerOut>} Observable that emits customer validation data.\n */\n getValidateCustomer (params: QueryParams): Observable<BillingPaCustomerOut> {\n return this.http.get<ApiSuccess<BillingPaCustomerOut>>(`${this.url}/validate-customer`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves billing configurations by location.\n *\n * @returns {Observable<BillingConfigsOut>} Observable that emits billing configuration items.\n */\n getConfigs (): Observable<BillingConfigsOut> {\n return this.http.get<ApiSuccess<BillingConfigsOut>>(`${this.url}/location/configs`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the billing configuration for a location.\n *\n * @param {number} id Location identifier.\n * @returns {Observable<BillingConfigOut>} Observable that emits the location billing configuration payload.\n */\n getConfig (id: number): Observable<BillingConfigOut> {\n return this.http.get<ApiSuccess<BillingConfigOut>>(`${this.url}/locations/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a billing configuration for a location.\n *\n * @param {BillingConfigIn} body Billing configuration payload for the new location.\n * @returns {Observable<BillingConfigOut>} Observable that emits the created billing configuration payload.\n */\n postConfigs (body: BillingConfigIn): Observable<BillingConfigOut> {\n return this.http.post<ApiSuccess<BillingConfigOut>>(`${this.url}/locations`, body)\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type {\n DepartmentsOut,\n EconomicActivitiesOut,\n EstablishmentTypesOut,\n MunicipalitiesOut,\n PersonTypesOut\n} from './models/api-billing-sv.types'\nimport type { ApiSuccess, QueryParams } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiBillingSvService {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Retrieves the URL for the billing API.\n * If the URL is not defined in the environments configuration, returns an empty string.\n *\n * @returns {string} The billing API URL or an empty string if not set.\n */\n get url (): string {\n return this.environments.apiBillingSV ?? ''\n }\n\n /**\n * Fetches the list of economic activities based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter the economic activities.\n * @returns {Observable<EconomicActivitiesOut>} An observable that emits the list of economic activities.\n */\n getEconomicActivities (params: QueryParams): Observable<EconomicActivitiesOut> {\n return this.http.get<ApiSuccess<EconomicActivitiesOut>>(`${this.url}/economic-activities`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of person types based on given query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter the person types.\n * @returns {Observable<PersonTypesOut>} An observable that emits a list of person types.\n */\n getPersonTypes (params: QueryParams): Observable<PersonTypesOut> {\n return this.http.get<ApiSuccess<PersonTypesOut>>(`${this.url}/person-types`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the list of establishment types.\n *\n * @param {QueryParams} params The query parameters to be sent with the HTTP request.\n * @returns {Observable<EstablishmentTypesOut>} An observable that emits the establishment types data.\n */\n getEstablishmentTypes (params: QueryParams): Observable<EstablishmentTypesOut> {\n return this.http.get<ApiSuccess<EstablishmentTypesOut>>(`${this.url}/establishment-types`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the list of departments based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter or modify the departments fetch request.\n * @returns {Observable<DepartmentsOut>} An observable emitting the list of departments.\n */\n getDepartments (params: QueryParams): Observable<DepartmentsOut> {\n return this.http.get<ApiSuccess<DepartmentsOut>>(`${this.url}/departments`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a list of municipalities based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter the municipalities.\n * @returns {Observable<MunicipalitiesOut>} An observable that emits the retrieved municipalities data.\n */\n getMunicipalities (params: QueryParams): Observable<MunicipalitiesOut> {\n return this.http.get<ApiSuccess<MunicipalitiesOut>>(`${this.url}/municipalities`, { params })\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type {\n BankAccountsOut,\n CashValueSummaryOut,\n ClosingIn,\n ClosingOut,\n DepositIn,\n DepositOut,\n DepositSlipOut,\n InstallationCountryReferenceCurrenciesOut,\n InstallationCountryReferenceCurrencyIn,\n InstallationCountryReferenceCurrencyOut, OpeningIn, OpeningOut, OpeningPreClosingRequestIn, OpeningsOut, OpeningTransferenceIn, OpeningTransferenceOut, ReceiptFileOut\n} from './models/api-cash-operations.types'\nimport type { ApiSuccess, QueryParams } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiCashOperationsService {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Retrieves the URL for the cash operations API from the environment configurations.\n *\n * @returns {string} The URL of the cash operations API.\n */\n get url (): string {\n return this.environments.apiCashOperationsUrl ?? ''\n }\n\n /**\n * Creates a new installation country reference currency.\n *\n * @param {InstallationCountryReferenceCurrencyIn} body - The data for the new reference currency.\n * @returns {Observable<InstallationCountryReferenceCurrencyOut>} The created reference currency.\n */\n postInstallationCountryReferenceCurrency (body: InstallationCountryReferenceCurrencyIn): Observable<InstallationCountryReferenceCurrencyOut> {\n return this.http.post<ApiSuccess<InstallationCountryReferenceCurrencyOut>>(`${this.url}/installation-country-reference-currencies`,\n body\n ).pipe(\n map(({ data }) => data)\n )\n }\n\n /**\n * Updates an existing installation country reference currency.\n *\n * @param {number} id - The ID of the reference currency to update.\n * @param {InstallationCountryReferenceCurrencyIn} body - The updated data for the reference currency.\n * @returns {Observable<InstallationCountryReferenceCurrencyOut>} The updated reference currency.\n */\n putInstallationCountryReferenceCurrency (id: number, body: InstallationCountryReferenceCurrencyIn): Observable<InstallationCountryReferenceCurrencyOut> {\n return this.http.put<ApiSuccess<InstallationCountryReferenceCurrencyOut>>(`${this.url}/installation-country-reference-currencies/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a list of installation country reference currencies based on query parameters.\n *\n * @param {QueryParams} params - Query parameters for filtering the currencies.\n * @returns {Observable<InstallationCountryReferenceCurrenciesOut>} The list of reference currencies.\n */\n getInstallationCompanyCountryCurrencies (params: QueryParams): Observable<InstallationCountryReferenceCurrenciesOut> {\n return this.http.get<ApiSuccess<InstallationCountryReferenceCurrenciesOut>>(`${this.url}/installation-country-reference-currencies`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the cash value summary for a specific opening ID.\n *\n * @param {number} id - The ID of the opening for which to retrieve the cash value summary.\n * @returns {Observable<CashValueSummaryOut>} An observable that emits the cash value summary data.\n */\n getOpeningCashValueSummary (id: number): Observable<CashValueSummaryOut> {\n return this.http.get<ApiSuccess<CashValueSummaryOut>>(`${this.url}/openings/${id}/cash-value-summary`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a new opening transference record.\n *\n * @param {OpeningTransferenceIn} body - The data to create the new opening transference.\n * @returns {Observable<OpeningTransferenceOut>} An observable that emits the newly created opening transference.\n */\n postOpeningTransferences (body: OpeningTransferenceIn): Observable<OpeningTransferenceOut> {\n return this.http.post<ApiSuccess<OpeningTransferenceOut>>(`${this.url}/opening-transferences`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the receipt file associated with the given opening transference ID.\n *\n * @param {number} id - The ID of the opening transference whose receipt is to be retrieved.\n * @returns {Observable<ReceiptFileOut>} An observable that emits the receipt file data.\n */\n getOpeningTransferenceReceipt (id: number): Observable<ReceiptFileOut> {\n return this.http.get<ApiSuccess<ReceiptFileOut>>(`${this.url}/opening-transferences/${id}/receipt`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a deposit slip by its ID.\n * @param id - The unique identifier of the deposit slip to retrieve\n * @returns An Observable that emits the deposit slip data\n */\n getDepositSlip (id: number): Observable<DepositSlipOut> {\n return this.http.get<ApiSuccess<DepositSlipOut>>(`${this.url}/deposits/${id}/slip`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a batch deposit slip for the provided deposit IDs.\n *\n * @param {number[]} ids - The deposit IDs to include in the batch slip.\n * @returns {Observable<DepositSlipOut>} The generated deposit slip.\n */\n postDepositsBatchSlip (ids: number[]): Observable<DepositSlipOut> {\n return this.http.post<ApiSuccess<DepositSlipOut>>(`${this.url}/deposits/batch/slip`, { ids })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a new opening.\n *\n * @param {OpeningIn} body - The data to create the new opening.\n * @returns {Observable<OpeningOut>} An observable that emits the newly created opening.\n */\n postOpening (body: OpeningIn): Observable<OpeningOut> {\n return this.http.post<ApiSuccess<OpeningOut>>(`${this.url}/openings`, { body })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a specific opening by its ID.\n *\n * @param {number} id - The ID of the opening to retrieve.\n * @returns {Observable<OpeningOut>} The requested opening.\n */\n getOpening (id: number): Observable<OpeningOut> {\n return this.http.get<ApiSuccess<OpeningOut>>(`${this.url}/openings/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves openings using the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters for filtering openings.\n * @returns {Observable<OpeningsOut>} The list of openings.\n */\n getOpenings (params: QueryParams): Observable<OpeningsOut> {\n return this.http.get<ApiSuccess<OpeningsOut>>(`${this.url}/openings`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves bank accounts using the provided query parameters.\n *\n * @param {QueryParams} params - Query parameters for filtering bank accounts.\n * @returns {Observable<BankAccountsOut>} The list of bank accounts.\n */\n getBankAccounts (params: QueryParams): Observable<BankAccountsOut> {\n return this.http.get<ApiSuccess<BankAccountsOut>>(`${this.url}/bank-accounts`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a pre-closing request for the current opening.\n *\n * @returns {Observable<{}>} The pre-closing request response.\n */\n postOpeningPreClosingRequest (): Observable<{}> {\n return this.http.post<ApiSuccess<{}>>(`${this.url}/openings/pre-closing-request`, {})\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates a pre-closing request for the specified opening.\n *\n * @param {number} id - The ID of the opening to update.\n * @param {OpeningPreClosingRequestIn} body - The updated pre-closing request data.\n * @returns {Observable<OpeningOut>} The updated opening.\n */\n patchOpeningPreClosingRequest (id: number, body: OpeningPreClosingRequestIn): Observable<OpeningOut> {\n return this.http.patch<ApiSuccess<OpeningOut>>(`${this.url}/openings/pre-closing-request/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a pre-closing for the current opening.\n *\n * @returns {Observable<{}>} The pre-closing response.\n */\n postOpeningPreClosing (): Observable<{}> {\n return this.http.post<ApiSuccess<{}>>(`${this.url}/openings/pre-closing`, {})\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Creates a closing record.\n *\n * @param {ClosingIn} body - The closing data to submit.\n * @returns {Observable<ClosingOut>} The created closing record.\n */\n postClosing (body: ClosingIn): Observable<ClosingOut> {\n return this.http.post<ApiSuccess<ClosingOut>>(`${this.url}/closings`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates an existing deposit.\n *\n * @param {number} id - The ID of the deposit to update.\n * @param {DepositIn} body - The updated deposit data.\n * @returns {Observable<DepositOut>} The updated deposit.\n */\n patchDeposit (id: number, body: DepositIn): Observable<DepositOut> {\n return this.http.patch<ApiSuccess<DepositOut>>(`${this.url}/deposits/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n}\n","import { HttpClient } from '@angular/common/http'\nimport { inject, Injectable } from '@angular/core'\nimport type { Observable } from 'rxjs'\nimport { map } from 'rxjs'\nimport { ENVIRONMENT_TOKEN } from '../ngx-services.models'\nimport type {\n BusinessPartyTraderTypesOut,\n CancellationReasonIn,\n CancellationReasonOut,\n CancellationReasonsOut,\n CountriesOut,\n CountryIn,\n CountryOut,\n CurrenciesOut,\n CurrencyOut, ExportReasonIn, ExportReasonOut, ExportReasonsOut, ExportReasonTypesOut,\n ExtraChargeIn,\n ExtraChargeOut,\n ExtraChargesOut,\n GenericFolioIn,\n GenericFolioOut,\n GenericFoliosOut,\n HolidayIn,\n HolidayOut,\n HolidaysOut,\n IdentificationTypeIn,\n IdentificationTypeNumberValidationIn,\n IdentificationTypeNumberValidationOut,\n IdentificationTypeOut,\n IdentificationTypesOut,\n LanguagesOut,\n ManagementAreasOut,\n OperationTypesOut,\n PackageLocationsData,\n ProductIn,\n ProductOut,\n QuestionIn,\n QuestionOut,\n QuestionsOut,\n RegionsOut,\n ShipmentContentTypesOut,\n ShipmentGroupsOut,\n ShipmentIncomeTypeIn,\n ShipmentIncomeTypeOut,\n ShipmentIncomeTypesOut,\n ShipmentScopesOut,\n ShipmentStatusesOut,\n UniqueFolioIn,\n UniqueFolioOut,\n UniqueFoliosOut,\n UnitsOut,\n ZonesOut\n} from './models/api-catalog.types'\nimport type { ApiSuccess, QueryParams } from './models/api.models'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiCatalogsService {\n private environments = inject(ENVIRONMENT_TOKEN)\n private http = inject(HttpClient)\n\n /**\n * Retrieves the URL for the reports API from the environment configurations.\n *\n * @return {string} The URL of the reports API.\n */\n get url (): string {\n return this.environments.apiCatalogsUrl ?? ''\n }\n\n /**\n * Retrieves the list of collection payments\n *\n * @param {QueryParams} params - The query parameters used to fetch the operation types.\n * @return {Observable<OperationTypesOut[]>} An observable that emits an array of operation type.\n */\n getOperationTypes (params: QueryParams): Observable<OperationTypesOut> {\n return this.http.get<ApiSuccess<OperationTypesOut>>(`${this.url}/operation-types`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the list of identificatios types\n *\n * @param {QueryParams} params - The query parameters used to fetch the identification types.\n * @return {Observable<IdentificationTypesOut[]>} An observable that emits an array of identification type.\n */\n getIdentificationTypes (params: QueryParams): Observable<IdentificationTypesOut> {\n return this.http.get<ApiSuccess<IdentificationTypesOut>>(`${this.url}/identification-types`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieve a single identification type by its id.\n *\n * Sends an HTTP GET request to the indentification type endpoint and returns an Observable that emits\n * the IdentificationTypeOut payload extracted from the API success envelope.\n *\n * @param id - The numeric identifier of the identification type to fetch.\n * @returns An Observable that emits the requested IdentificationTypeOut. The Observable will error\n * if the HTTP request fails (for example network issues or non-2xx responses).\n */\n getIdentificationType (id: number): Observable<IdentificationTypeOut> {\n return this.http.get<ApiSuccess<IdentificationTypeOut>>(`${this.url}/identification-types/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a POST request to create a new identification type and returns the created resource.\n *\n * The request payload is sent as an object with a `body` property containing the provided\n * IdentificationTypeIn value (i.e. { body: IdentificationTypeIn }). On success the HTTP response is expected\n * to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`\n * object and emits it as a IdentificationTypeOut.\n *\n * @param body - The identification type payload to create (IdentificationTypeIn).\n * @returns Observable<IdentificationTypeOut> that emits the created identification type on success.\n */\n postIdentificationType (body: IdentificationTypeIn): Observable<IdentificationTypeOut> {\n return this.http.post<ApiSuccess<IdentificationTypeOut>>(`${this.url}/identification-types`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Update a identification type by its ID.\n *\n * Sends an HTTP PUT to `${this.url}/identification-types/${id}` with the provided payload.\n * The request body is sent as an object with a `body` property containing the\n * `IdentificationTypeIn` data. The server response is expected to be an `ApiSuccess<IdentificationTypeOut>`\n * and this method returns an Observable that emits the unwrapped `IdentificationTypeOut`.\n *\n * @param id - The identifier of the identification type to update.\n * @param body - The update payload for the identification type.\n * @returns An Observable that emits the updated `IdentificationTypeOut` on success.\n */\n putIdentificationType (id: number, body: IdentificationTypeIn): Observable<IdentificationTypeOut> {\n return this.http.put<ApiSuccess<IdentificationTypeOut>>(`${this.url}/identification-types/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Delete a identification type by its ID.\n *\n * Sends an HTTP DELETE request to the backend endpoint `/identification-types/{id}` and\n * returns an Observable that emits the API response's `data` payload (typically an empty object).\n *\n * The implementation maps an ApiSuccess wrapper to its `data` property before emitting.\n *\n * @param id - The numeric identifier of the identification type to delete.\n * @returns An Observable that emits the deleted resource payload ({} expected) on success.\n * The Observable will emit an error if the HTTP request fails.\n */\n deleteIdentificationType (id: number): Observable<{}> {\n return this.http.delete<ApiSuccess<{}>>(`${this.url}/identification-types/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a POST request to validate identification type number.\n *\n * The request payload is sent as an object with a `body` property containing the provided\n * IdentificationTypeNumberValidationIn value (i.e. { body: IdentificationTypeNumberValidationIn }). On success the HTTP response is expected\n * to follow the ApiSuccess<T> shape; the operator maps that response to the inner `data`\n * object and emits it as a IdentificationTypeNumberValidationOut.\n *\n * @param body - The identification type number validation payload to validate (IdentificationTypeNumberValidationIn).\n * @returns Observable<IdentificationTypeNumberValidationOut> that emits the validate status.\n */\n postIdentificationTypeNumberValidation (body: IdentificationTypeNumberValidationIn): Observable<IdentificationTypeNumberValidationOut> {\n return this.http.post<ApiSuccess<IdentificationTypeNumberValidationOut>>(`${this.url}/identification-types/number-validation`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the extra charges based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter the results.\n * @return {Observable<ExtraChargesOut>} An observable emitting the extra charges data.\n */\n getExtraCharges (params: QueryParams): Observable<ExtraChargesOut> {\n return this.http.get<ApiSuccess<ExtraChargesOut>>(`${this.url}/extracharges`, {\n params\n }).pipe(map(({ data }) => data))\n }\n\n /**\n * Submits an extra charge request to the server and returns the created extra charge details.\n *\n * @param {ExtraChargeIn} body - The data for the extra charge to be created.\n * @return {Observable<ExtraChargeOut>} An observable that emits the details of the created extra charge.\n */\n postExtraCharge (body: ExtraChargeIn): Observable<ExtraChargeOut> {\n return this.http.post<ApiSuccess<ExtraChargeOut>>(`${this.url}/extracharges`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates an extra charge entity with new data and returns the updated entity.\n *\n * @param {number} id - The unique identifier of the extra charge to update.\n * @param {ExtraChargeIn} body - The new data for the extra charge.\n * @return {Observable<ExtraChargeOut>} An observable emitting the updated extra charge entity.\n */\n putExtraCharge (id: number, body: ExtraChargeIn): Observable<ExtraChargeOut> {\n return this.http.put<ApiSuccess<ExtraChargeOut>>(`${this.url}/extracharges/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches a list of countries from the API.\n *\n * @param {QueryParams} params - The query parameters to be passed to the API request.\n * @return {Observable<CountriesOut>} An observable containing the list of countries.\n */\n getCountries (params: QueryParams): Observable<CountriesOut> {\n return this.http.get<ApiSuccess<CountriesOut>>(`${this.url}/countries`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the details of a country based on its ID.\n *\n * @param {number} id - The identifier of the country to fetch.\n * @return {Observable<CountryOut>} An observable that emits the country data.\n */\n getCountry (id: number): Observable<CountryOut> {\n return this.http.get<ApiSuccess<CountryOut>>(`${this.url}/countries/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates the details of a specific country by its ID.\n *\n * @param {number} id - The unique identifier of the country to be updated.\n * @param {CountryIn} body - The data to update the country with.\n * @return {Observable<CountryOut>} An observable that emits the updated country data.\n */\n putCountry (id: number, body: CountryIn): Observable<CountryOut> {\n return this.http.put<ApiSuccess<CountryOut>>(`${this.url}/countries/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches a list of regions based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter the regions.\n * @return {Observable<RegionsOut>} An observable that emits the list of regions.\n */\n getRegions (params: QueryParams): Observable<RegionsOut> {\n return this.http.get<ApiSuccess<RegionsOut>>(`${this.url}/regions`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the zones data based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter the zones data.\n * @return {Observable<ZonesOut>} An observable that emits the fetched zones data.\n */\n getZones (params: QueryParams): Observable<ZonesOut> {\n return this.http.get<ApiSuccess<ZonesOut>>(`${this.url}/zones`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the management areas based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter the management areas.\n * @return {Observable<ManagementAreasOut>} An observable that emits the management areas data.\n */\n getManagementAreas (params: QueryParams): Observable<ManagementAreasOut> {\n return this.http.get<ApiSuccess<ManagementAreasOut>>(`${this.url}/management-areas`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves cancellation reasons from the server based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter the cancellation reasons.\n * @return {Observable<CancellationReasonsOut>} An observable containing the retrieved cancellation reasons.\n */\n getCancellationReasons (params: QueryParams): Observable<CancellationReasonsOut> {\n return this.http.get<ApiSuccess<CancellationReasonsOut>>(`${this.url}/cancellation-reasons`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a cancellation reason to the server.\n *\n * @param {CancellationReasonIn} body - The cancellation reason object to be sent.\n * @return {Observable<CancellationReasonOut>} An observable containing the server's response with the processed cancellation reason.\n */\n postCancellationReason (body: CancellationReasonIn): Observable<CancellationReasonOut> {\n return this.http.post<ApiSuccess<CancellationReasonOut>>(`${this.url}/cancellation-reasons`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates the cancellation reason for the specified ID with the provided data.\n *\n * @param {number} id - The unique identifier of the cancellation reason to update.\n * @param {CancellationReasonIn} body - The details of the cancellation reason to be updated.\n * @return {Observable<CancellationReasonOut>} An observable containing the updated cancellation reason.\n */\n putCancellationReason (id: number, body: CancellationReasonIn): Observable<CancellationReasonOut> {\n return this.http.put<ApiSuccess<CancellationReasonOut>>(`${this.url}/cancellation-reasons/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a list of currencies based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to customize the currency retrieval request.\n * @return {Observable<CurrenciesOut>} An observable that emits the retrieved currencies data.\n */\n getCurrencies (params: QueryParams): Observable<CurrenciesOut> {\n return this.http.get<ApiSuccess<CurrenciesOut>>(`${this.url}/currencies`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves currency information by ID.\n * @param id - The unique identifier of the currency to retrieve.\n * @returns An Observable that emits the currency data.\n */\n getCurrency (id: number): Observable<CurrencyOut> {\n return this.http.get<ApiSuccess<CurrencyOut>>(`${this.url}/currencies/${id}`)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the list of available languages based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to pass with the HTTP request.\n * @return {Observable<LanguagesOut>} An observable that emits the available languages.\n */\n getLanguages (params: QueryParams): Observable<LanguagesOut> {\n return this.http.get<ApiSuccess<LanguagesOut>>(`${this.url}