UNPKG

@experteam-mx/ngx-services

Version:

Angular common services for Experteam apps

1 lines 374 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-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-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/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 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 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 { 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 CashValueSummaryOut,\n DepositSlipOut,\n InstallationCountryReferenceCurrenciesOut,\n InstallationCountryReferenceCurrencyIn,\n InstallationCountryReferenceCurrencyOut, 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","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,\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}/languages`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the available units from the API based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter the units being fetched.\n * @return {Observable<UnitsOut>} An observable that emits the retrieved units data.\n */\n getUnits (params: QueryParams): Observable<UnitsOut> {\n return this.http.get<ApiSuccess<UnitsOut>>(`${this.url}/units`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the shipment scopes based on the provided query parameters.\n *\n * @param {QueryParams} params The query parameters to filter or modify the request for shipment scopes.\n * @return {Observable<ShipmentScopesOut>} An observable that emits the shipment scopes data.\n */\n getShipmentScopes (params: QueryParams): Observable<ShipmentScopesOut> {\n return this.http.get<ApiSuccess<ShipmentScopesOut>>(`${this.url}/shipment-scopes`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches the available shipment content types based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter the shipment content types.\n * @return {Observable<ShipmentContentTypesOut>} An observable that emits the shipment content types data.\n */\n getShipmentContentTypes (params: QueryParams): Observable<ShipmentContentTypesOut> {\n return this.http.get<ApiSuccess<ShipmentContentTypesOut>>(`${this.url}/shipment-content-types`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Fetches a list of generic folios based on the given query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter the generic folios.\n * @return {Observable<GenericFoliosOut>} An observable containing the fetched generic folios.\n */\n getGenericFolios (params: QueryParams): Observable<GenericFoliosOut> {\n return this.http.get<ApiSuccess<GenericFoliosOut>>(`${this.url}/generic-folios`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a POST request to create or update a generic folio.\n *\n * @param {GenericFolioIn} body - The payload containing the details of the generic folio to be created or updated.\n * @return {Observable<GenericFolioOut>} An observable containing the response data of the created or updated generic folio.\n */\n postGenericFolio (body: GenericFolioIn): Observable<GenericFolioOut> {\n return this.http.post<ApiSuccess<GenericFolioOut>>(`${this.url}/generic-folios`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates a generic folio with the specified ID using the provided data.\n *\n * @param {number} id - The unique identifier of the generic folio to update.\n * @param {GenericFolioIn} body - The data to update the generic folio with.\n * @return {Observable<GenericFolioOut>} An observable containing the updated generic folio.\n */\n putGenericFolio (id: number, body: GenericFolioIn): Observable<GenericFolioOut> {\n return this.http.put<ApiSuccess<GenericFolioOut>>(`${this.url}/generic-folios/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a PUT request to update a Generic Folio resource with the specified ID and body data, and returns the updated resource.\n *\n * @param {number} id - The unique identifier of the Generic Folio to be updated.\n * @param {Partial<GenericFolioIn>} body - The partial data representing the changes to be applied to the Generic Folio.\n * @return {Observable<GenericFolioOut>} An observable containing the updated Generic Folio resource.\n */\n pathGenericFolio (id: number, body: Partial<GenericFolioIn>): Observable<GenericFolioOut> {\n return this.http.put<ApiSuccess<GenericFolioOut>>(`${this.url}/generic-folios/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a POST request to create a new product.\n *\n * @param {ProductIn} body - The product data to be sent in the request body.\n * @return {Observable<ProductOut>} An observable emitting the created product data.\n */\n postProduct (body: ProductIn): Observable<ProductOut> {\n return this.http.post<ApiSuccess<ProductOut>>(`${this.url}/products`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates an existing product with the given ID using the provided data.\n *\n * @param {number} id - The unique identifier of the product to update.\n * @param {ProductIn} body - The product data to update.\n * @return {Observable<ProductOut>} An observable containing the updated product data.\n */\n putProduct (id: number, body: ProductIn): Observable<ProductOut> {\n return this.http.put<ApiSuccess<ProductOut>>(`${this.url}/products/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a list of shipment income types based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters to filter the shipment income types.\n * @return {Observable<ShipmentIncomeTypesOut>} An observable containing the shipment income types data.\n */\n getShipmentIncomeTypes (params: QueryParams): Observable<ShipmentIncomeTypesOut> {\n return this.http.get<ApiSuccess<ShipmentIncomeTypesOut>>(`${this.url}/shipment-income-types`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a POST request to create a new shipment income type.\n *\n * @param {ShipmentIncomeTypeIn} body The payload containing the details of the shipment income type to be created.\n * @return {Observable<ShipmentIncomeTypeOut>} An observable that emits the created shipment income type data.\n */\n postShipmentIncomeType (body: ShipmentIncomeTypeIn): Observable<ShipmentIncomeTypeOut> {\n return this.http.post<ApiSuccess<ShipmentIncomeTypeOut>>(`${this.url}/shipment-income-types`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates the shipment income type with the specified ID.\n *\n * @param {number} id - The identifier of the shipment income type to update.\n * @param {ShipmentIncomeTypeIn} body - The data to update the shipment income type with.\n * @return {Observable<ShipmentIncomeTypeOut>} An observable emitting the updated shipment income type.\n */\n putShipmentIncomeType (id: number, body: ShipmentIncomeTypeIn): Observable<ShipmentIncomeTypeOut> {\n return this.http.put<ApiSuccess<ShipmentIncomeTypeOut>>(`${this.url}/shipment-income-types/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves a list of unique folios based on the provided query parameters.\n *\n * @param {QueryParams} params - The query parameters used to filter and fetch unique folios.\n * @return {Observable<UniqueFoliosOut>} An observable that emits the unique folios data.\n */\n getUniqueFolios (params: QueryParams): Observable<UniqueFoliosOut> {\n return this.http.get<ApiSuccess<UniqueFoliosOut>>(`${this.url}/unique-folios`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Sends a POST request to create a unique folio.\n *\n * @param {UniqueFolioIn} body - The data object containing details for the unique folio to be created.\n * @return {Observable<UniqueFolioOut>} An observable that emits the created unique folio details.\n */\n postUniqueFolio (body: UniqueFolioIn): Observable<UniqueFolioOut> {\n return this.http.post<ApiSuccess<UniqueFolioOut>>(`${this.url}/unique-folios`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates a unique folio with the given data using the provided ID.\n *\n * @param {number} id - The ID of the unique folio to be updated.\n * @param {UniqueFolioIn} body - The payload containing the details of the unique folio to update.\n * @return {Observable<UniqueFolioOut>} An observable that emits the updated unique folio.\n */\n putUniqueFolio (id: number, body: UniqueFolioIn): Observable<UniqueFolioOut> {\n return this.http.put<ApiSuccess<UniqueFolioOut>>(`${this.url}/unique-folios/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Updates a unique folio by its identifier with the provided data.\n *\n * @param {number} id - The identifier of the unique folio to update.\n * @param {Partial<UniqueFolioIn>} body - The partial data of the unique folio to update.\n * @return {Observable<UniqueFolioOut>} An observable emitting the updated unique folio data.\n */\n pathUniqueFolio (id: number, body: Partial<UniqueFolioIn>): Observable<UniqueFolioOut> {\n return this.http.put<ApiSuccess<UniqueFolioOut>>(`${this.url}/unique-folios/${id}`, body)\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves shipment groups based on the provided query parameters.\n *\n * @param params - The query parameters to filter the shipment groups.\n * @returns An Observable that emits the shipment groups data.\n */\n getShipmentGroups (params: QueryParams): Observable<ShipmentGroupsOut> {\n return this.http.get<ApiSuccess<ShipmentGroupsOut>>(`${this.url}/shipment-groups`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n * Retrieves the shipment statuses from the API.\n *\n * @param params - The query parameters to filter or modify the request.\n * @returns An Observable that emits the shipment statuses output.\n */\n getShipmentStatuses (params: QueryParams): Observable<ShipmentStatusesOut> {\n return this.http.get<ApiSuccess<ShipmentStatusesOut>>(`${this.url}/shipment-statuses`, { params })\n .pipe(map(({ data }) => data))\n }\n\n /**\n