@experteam-mx/ngx-services 18.7.26 → 18.7.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1891,6 +1891,159 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1891
1891
  args: ['env']
1892
1892
  }] }, { type: i1$1.CookieService }, { type: i1.HttpClient }] });
1893
1893
 
1894
+ class ApiCustomsService {
1895
+ environments;
1896
+ http;
1897
+ constructor(environments, http) {
1898
+ this.environments = environments;
1899
+ this.http = http;
1900
+ }
1901
+ /**
1902
+ * Retrieves the URL for the cash operations API from the environment configurations.
1903
+ *
1904
+ * @return {string} The URL of the cash operations API.
1905
+ */
1906
+ get url() {
1907
+ return this.environments.apiCustomsUrl ?? '';
1908
+ }
1909
+ /**
1910
+ * Fetches the available fields for a given level.
1911
+ *
1912
+ * @return {Observable<FieldsOut>} An Observable that emits the list of fields.
1913
+ * @param params
1914
+ */
1915
+ getFields(params) {
1916
+ return this.http.get(`${this.url}/fields`, {
1917
+ params
1918
+ }).pipe(map(({ data }) => data));
1919
+ }
1920
+ /**
1921
+ * Retrieves override configurations for a given level.
1922
+ *
1923
+ * @return {Observable<OverridesOut>} An Observable that emits the overrides configuration.
1924
+ * @param params
1925
+ */
1926
+ getOverrides(params) {
1927
+ return this.http.get(`${this.url}/overrides`, {
1928
+ params
1929
+ }).pipe(map(({ data }) => data));
1930
+ }
1931
+ /**
1932
+ * Fetches the catalogs used in customs operations.
1933
+ *
1934
+ * @return {Observable<CatalogsOut>} An Observable that emits the catalogs.
1935
+ */
1936
+ getCatalogs(params) {
1937
+ return this.http.get(`${this.url}/catalogs`, {
1938
+ params
1939
+ }).pipe(map(({ data }) => data));
1940
+ }
1941
+ /**
1942
+ * Retrieves the list of rules based on the provided query parameters.
1943
+ *
1944
+ * @param {QueryParams} params - Query parameters to filter the rules.
1945
+ * @return {Observable<RulesOut>} An Observable that emits the list of rules.
1946
+ */
1947
+ getRules(params) {
1948
+ return this.http.get(`${this.url}/rules`, { params }).pipe(map(({ data }) => data));
1949
+ }
1950
+ /**
1951
+ * Retrieves the details of a specific rule by its ID.
1952
+ *
1953
+ * @param {number} id - The ID of the rule.
1954
+ * @return {Observable<RuleOut>} An Observable that emits the rule details.
1955
+ */
1956
+ getRule(id) {
1957
+ return this.http.get(`${this.url}/rules/${id}`).pipe(map(({ data }) => data));
1958
+ }
1959
+ /**
1960
+ * Creates a new criteria.
1961
+ *
1962
+ * @param {CriteriaIn} body - The criteria payload to create.
1963
+ * @return {Observable<CriteriaOut>} An Observable that emits the created criteria.
1964
+ */
1965
+ postCriteria(body) {
1966
+ return this.http.post(`${this.url}/criteria`, body).pipe(map(({ data }) => data));
1967
+ }
1968
+ /**
1969
+ * Creates a new rule.
1970
+ *
1971
+ * @param {RuleIn} body - The rule payload to create.
1972
+ * @return {Observable<RuleOut>} An Observable that emits the created rule.
1973
+ */
1974
+ postRules(body) {
1975
+ return this.http.post(`${this.url}/rules`, body).pipe(map(({ data }) => data));
1976
+ }
1977
+ /**
1978
+ * Retrieves rules that match the given criteria.
1979
+ *
1980
+ * @param {RuleCriteriaIn} params - Criteria used to search for matching rules.
1981
+ * @return {Observable<RulesByCriteriaOut>} An Observable that emits the list of matching rules.
1982
+ */
1983
+ postRulesByCriteria(params) {
1984
+ return this.http.post(`${this.url}/rules/by-criteria`, params).pipe(map(({ data }) => data));
1985
+ }
1986
+ /**
1987
+ * Enables a specific rule by its ID.
1988
+ *
1989
+ * @param {number} id - The ID of the rule to enable.
1990
+ * @return {Observable<{}>} An Observable that emits an empty array on success.
1991
+ */
1992
+ putRuleActivate(id) {
1993
+ return this.http.put(`${this.url}/rules/${id}/activate`, null).pipe(map(({ data }) => data));
1994
+ }
1995
+ /**
1996
+ * Disables (deletes) a specific rule by its ID.
1997
+ *
1998
+ * @param {number} id - The ID of the rule to disable.
1999
+ * @return {Observable<[]>} An Observable that emits an empty array on success.
2000
+ */
2001
+ deleteRule(id) {
2002
+ return this.http.delete(`${this.url}/rules/${id}`).pipe(map(({ data }) => data));
2003
+ }
2004
+ /**
2005
+ * Updates an existing criteria by its ID.
2006
+ *
2007
+ * @param {number} id - The ID of the criteria.
2008
+ * @param {CriteriaIn} body - The updated criteria payload.
2009
+ * @return {Observable<CriteriaOut>} An Observable that emits the updated criteria.
2010
+ */
2011
+ putCriteria(id, body) {
2012
+ return this.http.put(`${this.url}/criteria/${id}`, body).pipe(map(({ data }) => data));
2013
+ }
2014
+ /**
2015
+ * Updates an existing rule by its ID.
2016
+ *
2017
+ * @param {number} id - The ID of the rule.
2018
+ * @param {RulesIn} body - The updated rule payload.
2019
+ * @return {Observable<RuleOut>} An Observable that emits the updated rule.
2020
+ */
2021
+ putRule(id, body) {
2022
+ return this.http.put(`${this.url}/rules/${id}`, body).pipe(map(({ data }) => data));
2023
+ }
2024
+ /**
2025
+ * Retrieves the list of country groups used in customs operations.
2026
+ *
2027
+ * @return {Observable<CountryGroupsOut>} An Observable that emits the list of country groups.
2028
+ */
2029
+ getCountryGroups(params) {
2030
+ return this.http.get(`${this.url}/country-groups`, {
2031
+ params
2032
+ }).pipe(map(({ data }) => data));
2033
+ }
2034
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCustomsService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2035
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCustomsService, providedIn: 'root' });
2036
+ }
2037
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCustomsService, decorators: [{
2038
+ type: Injectable,
2039
+ args: [{
2040
+ providedIn: 'root'
2041
+ }]
2042
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2043
+ type: Inject,
2044
+ args: ['env']
2045
+ }] }, { type: i1.HttpClient }] });
2046
+
1894
2047
  class ApiDiscountsService {
1895
2048
  environments;
1896
2049
  http;
@@ -3615,6 +3768,56 @@ class ApiSuppliesService {
3615
3768
  return this.http.get(`${this.url}/supply-types`, { params })
3616
3769
  .pipe(map(({ data }) => data));
3617
3770
  }
3771
+ /**
3772
+ * Creates a new supply location.
3773
+ *
3774
+ * @param {SupplyLocationIn} body - The supply location data to create.
3775
+ * @return {Observable<SupplyLocationOut>} An Observable that emits the created supply location data.
3776
+ */
3777
+ postSupplyLocations(body) {
3778
+ return this.http.post(`${this.url}/supply-locations`, body)
3779
+ .pipe(map(({ data }) => data));
3780
+ }
3781
+ /**
3782
+ * Fetches the supply locations based on the provided query parameters.
3783
+ *
3784
+ * @param {QueryParams} params - The query parameters to filter the supply locations.
3785
+ * @return {Observable<SupplyLocationsOut>} An Observable that emits the supply locations data.
3786
+ */
3787
+ getSupplyLocations(params) {
3788
+ return this.http.get(`${this.url}/supply-locations`, { params })
3789
+ .pipe(map(({ data }) => data));
3790
+ }
3791
+ /**
3792
+ * Creates a new supply location transaction.
3793
+ *
3794
+ * @param {SupplyLocationTransactionIn} body - The transaction data to create.
3795
+ * @return {Observable<SupplyLocationTransactionOut>} An Observable that emits the created transaction data.
3796
+ */
3797
+ postSupplyLocationTransaction(body) {
3798
+ return this.http.post(`${this.url}/supply-location-transactions`, body)
3799
+ .pipe(map(({ data }) => data));
3800
+ }
3801
+ /**
3802
+ * Fetches the supply transaction types based on the provided query parameters.
3803
+ *
3804
+ * @param {QueryParams} params - The query parameters to filter the transaction types.
3805
+ * @return {Observable<SupplyTransactionTypesOut>} An Observable that emits the supply transaction types data.
3806
+ */
3807
+ getSupplyTransactionTypes(params) {
3808
+ return this.http.get(`${this.url}/supply-transaction-types`, { params })
3809
+ .pipe(map(({ data }) => data));
3810
+ }
3811
+ /**
3812
+ * Exports the supply locations to an Excel file.
3813
+ *
3814
+ * @param {QueryParams} params - The query parameters to filter the data before export.
3815
+ * @return {Observable<{ mime_type: string; base64: string }>} An Observable that emits the exported file's MIME type and Base64 content.
3816
+ */
3817
+ getSupplyLocationsExportToExcel(params) {
3818
+ return this.http.get(`${this.url}/supply-locations/export/excel`, { params })
3819
+ .pipe(map(({ data }) => data));
3820
+ }
3618
3821
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiSuppliesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3619
3822
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiSuppliesService, providedIn: 'root' });
3620
3823
  }
@@ -4022,5 +4225,5 @@ const downloadBase64Pdf = (base64) => window.open(base64PdfToUrl(base64));
4022
4225
  * Generated bundle index. Do not edit.
4023
4226
  */
4024
4227
 
4025
- export { AlphaNumeric, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalPickupsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, CryptoService, DefaultValueType, ENVIRONMENT_TOKEN, Event, NgxServicesModule, OperationModuleStatus, WebSocketsService, apiHeadersInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, queryString, xmlHeaders };
4228
+ export { AlphaNumeric, ApiBillingDOService, ApiBillingGtService, ApiBillingMxService, ApiBillingPaService, ApiBillingSvService, ApiCashOperationsService, ApiCatalogsService, ApiCompaniesService, ApiCompositionService, ApiCustomsService, ApiDiscountsService, ApiEToolsAutoBillingService, ApiEventsService, ApiExternalPickupsService, ApiInventoriesService, ApiInvoicesService, ApiNotificationsService, ApiOpenItemsService, ApiReportsService, ApiSecurityService, ApiServicesService, ApiShipmentsService, ApiSuppliesService, CryptoService, DefaultValueType, ENVIRONMENT_TOKEN, Event, NgxServicesModule, OperationModuleStatus, WebSocketsService, apiHeadersInterceptor, apiTokenInterceptor, base64PdfToUrl, downloadBase64Pdf, httpCachingInterceptor, httpParams, pdfHeaders, queryString, xmlHeaders };
4026
4229
  //# sourceMappingURL=experteam-mx-ngx-services.mjs.map