Skip to content

Commit 94f6fd8

Browse files
Merge pull request #81 from FacturAPI/chore/catalogs_cartaporte
chore(cartaporteCatalogs): add cartaporte catalogs
2 parents 60e1031 + 87e0a0d commit 94f6fd8

File tree

4 files changed

+152
-2
lines changed

4 files changed

+152
-2
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [4.11.0] 2025-12-10
9+
10+
### Added
11+
12+
- Add new catalogs for cartaporte
13+
- `searchAirTransportCodes`, `searchTransportConfigs`,`searchRightsOfPassage`,`searchCustomsDocuments`,`searchPackagingTypes`,`searchTrailerTypes`, `searchHazardousMaterials`, `searchNavalAuthorizations`, `searchPortStations`, `searchMarineContainers`
14+
15+
16+
17+
18+
19+
20+
21+
22+
823
## [4.10.0] 2025-09-04
924

1025
### Added

package-lock.json

Lines changed: 15 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Tools from './tools/tools';
1010
import * as enums from './enums';
1111
import { createWrapper, WrapperClient } from './wrapper';
1212
import { DEFAULT_API_VERSION } from './constants';
13+
import CartaPorteCatalogs from './tools/cartaPorteCatalogs';
1314

1415
export * from './enums';
1516
export * from './types';
@@ -36,6 +37,7 @@ export default class Facturapi {
3637
invoices: Invoices;
3738
organizations: Organizations;
3839
catalogs: Catalogs;
40+
cartaPorteCatalogs: CartaPorteCatalogs;
3941
receipts: Receipts;
4042
retentions: Retentions;
4143
tools: Tools;
@@ -115,6 +117,7 @@ export default class Facturapi {
115117
this.invoices = new Invoices(this._wrapper);
116118
this.organizations = new Organizations(this._wrapper);
117119
this.catalogs = new Catalogs(this._wrapper);
120+
this.cartaPorteCatalogs = new CartaPorteCatalogs(this._wrapper);
118121
this.receipts = new Receipts(this._wrapper);
119122
this.retentions = new Retentions(this._wrapper);
120123
this.tools = new Tools(this._wrapper);

src/tools/cartaPorteCatalogs.ts

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import { WrapperClient } from '../wrapper';
2+
3+
export default class CartaPorteCatalogs {
4+
client: WrapperClient;
5+
6+
constructor(client: WrapperClient) {
7+
this.client = client;
8+
}
9+
10+
/**
11+
* Air transport codes (Carta Porte 3.1)
12+
* @param {Object} params - Search parameters
13+
* @returns {Promise}
14+
*/
15+
searchAirTransportCodes(params: Record<string, any> | null) {
16+
return this.client.get('/catalogs/cartaporte/3.1/air-transport-codes', {
17+
params,
18+
});
19+
}
20+
21+
/**
22+
* Auto transport configurations (Carta Porte 3.1)
23+
* @param {Object} params - Search parameters
24+
* @returns {Promise}
25+
*/
26+
searchTransportConfigs(params: Record<string, any> | null) {
27+
return this.client.get('/catalogs/cartaporte/3.1/transport-configs', {
28+
params,
29+
});
30+
}
31+
32+
/**
33+
* Rights of passage (Carta Porte 3.1)
34+
* @param {Object} params - Search parameters
35+
* @returns {Promise}
36+
*/
37+
searchRightsOfPassage(params: Record<string, any> | null) {
38+
return this.client.get('/catalogs/cartaporte/3.1/rights-of-passage', {
39+
params,
40+
});
41+
}
42+
43+
/**
44+
* Customs documents (Carta Porte 3.1)
45+
* @param {Object} params - Search parameters
46+
* @returns {Promise}
47+
*/
48+
searchCustomsDocuments(params: Record<string, any> | null) {
49+
return this.client.get('/catalogs/cartaporte/3.1/customs-documents', {
50+
params,
51+
});
52+
}
53+
54+
/**
55+
* Packaging types (Carta Porte 3.1)
56+
* @param {Object} params - Search parameters
57+
* @returns {Promise}
58+
*/
59+
searchPackagingTypes(params: Record<string, any> | null) {
60+
return this.client.get('/catalogs/cartaporte/3.1/packaging-types', {
61+
params,
62+
});
63+
}
64+
65+
/**
66+
* Trailer types (Carta Porte 3.1)
67+
* @param {Object} params - Search parameters
68+
* @returns {Promise}
69+
*/
70+
searchTrailerTypes(params: Record<string, any> | null) {
71+
return this.client.get('/catalogs/cartaporte/3.1/trailer-types', {
72+
params,
73+
});
74+
}
75+
76+
/**
77+
* Hazardous materials (Carta Porte 3.1)
78+
* @param {Object} params - Search parameters
79+
* @returns {Promise}
80+
*/
81+
searchHazardousMaterials(params: Record<string, any> | null) {
82+
return this.client.get('/catalogs/cartaporte/3.1/hazardous-materials', {
83+
params,
84+
});
85+
}
86+
87+
/**
88+
* Naval authorizations (Carta Porte 3.1)
89+
* @param {Object} params - Search parameters
90+
* @returns {Promise}
91+
*/
92+
searchNavalAuthorizations(params: Record<string, any> | null) {
93+
return this.client.get('/catalogs/cartaporte/3.1/naval-authorizations', {
94+
params,
95+
});
96+
}
97+
98+
/**
99+
* Port stations (air/sea/land) (Carta Porte 3.1)
100+
* @param {Object} params - Search parameters
101+
* @returns {Promise}
102+
*/
103+
searchPortStations(params: Record<string, any> | null) {
104+
return this.client.get('/catalogs/cartaporte/3.1/port-stations', {
105+
params,
106+
});
107+
}
108+
109+
/**
110+
* Marine containers (Carta Porte 3.1)
111+
* @param {Object} params - Search parameters
112+
* @returns {Promise}
113+
*/
114+
searchMarineContainers(params: Record<string, any> | null) {
115+
return this.client.get('/catalogs/cartaporte/3.1/marine-containers', {
116+
params,
117+
});
118+
}
119+
}

0 commit comments

Comments
 (0)