intifact 1.1.2 → 1.3.0
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.
- package/README.md +96 -69
- package/dist/index.d.ts +517 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -14
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +626 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -4
- package/dist/types.js.map +1 -1
- package/package.json +47 -47
package/dist/index.d.ts
CHANGED
|
@@ -23,10 +23,20 @@ export type SendVoidedInput = paths["/api/v1/voided/send"]["post"]["requestBody"
|
|
|
23
23
|
export type CancelInvoiceInput = paths["/api/v1/invoice/cancel"]["post"]["requestBody"]["content"]["application/json"];
|
|
24
24
|
/** Body de POST /api/v1/boleta/cancel (anular boleta) */
|
|
25
25
|
export type CancelBoletaInput = paths["/api/v1/boleta/cancel"]["post"]["requestBody"]["content"]["application/json"];
|
|
26
|
+
/** Body de POST /api/v1/companies (alta de RUC emisor) */
|
|
27
|
+
export type CreateCompanyInput = paths["/api/v1/companies"]["post"]["requestBody"]["content"]["application/json"];
|
|
28
|
+
/** Body de PUT /api/v1/companies/{id} */
|
|
29
|
+
export type UpdateCompanyInput = paths["/api/v1/companies/{id}"]["put"]["requestBody"]["content"]["application/json"];
|
|
30
|
+
/** Body de POST /api/v1/companies/{id}/branches (alta de establecimiento anexo) */
|
|
31
|
+
export type CreateBranchInput = paths["/api/v1/companies/{id}/branches"]["post"]["requestBody"]["content"]["application/json"];
|
|
32
|
+
/** Body de PUT /api/v1/companies/{id}/branches/{branchId} */
|
|
33
|
+
export type UpdateBranchInput = paths["/api/v1/companies/{id}/branches/{branchId}"]["put"]["requestBody"]["content"]["application/json"];
|
|
26
34
|
/** Body de POST /api/v1/webhooks */
|
|
27
35
|
export type CreateWebhookInput = paths["/api/v1/webhooks"]["post"]["requestBody"]["content"]["application/json"];
|
|
28
36
|
/** Body de PUT /api/v1/webhooks/{id} */
|
|
29
37
|
export type UpdateWebhookInput = paths["/api/v1/webhooks/{id}"]["put"]["requestBody"]["content"]["application/json"];
|
|
38
|
+
/** Body de POST /api/v1/cdr/consultar (consulta de CDR en SUNAT por referencia) */
|
|
39
|
+
export type ConsultarCdrInput = paths["/api/v1/cdr/consultar"]["post"]["requestBody"]["content"]["application/json"];
|
|
30
40
|
/** Respuesta 202 de cualquier /send (documento encolado) */
|
|
31
41
|
export type EnqueueResponse = paths["/api/v1/invoice/send"]["post"]["responses"]["202"]["content"]["application/json"];
|
|
32
42
|
/** Respuesta de GET /api/v1/queues/stats */
|
|
@@ -85,9 +95,7 @@ export declare class FacturacionClient {
|
|
|
85
95
|
valorVenta: number;
|
|
86
96
|
subTotal: number;
|
|
87
97
|
montoImpVenta: number;
|
|
88
|
-
descuentoGlobal
|
|
89
|
-
/** Anula una factura (comunicación de baja). */
|
|
90
|
-
?: number;
|
|
98
|
+
descuentoGlobal?: number;
|
|
91
99
|
descuentoGlobalBase?: number;
|
|
92
100
|
detalle: {
|
|
93
101
|
unidad: string;
|
|
@@ -104,9 +112,7 @@ export declare class FacturacionClient {
|
|
|
104
112
|
montoPrecioUnitario: number;
|
|
105
113
|
montoValorVenta: number;
|
|
106
114
|
descuento?: number;
|
|
107
|
-
descuentoItem
|
|
108
|
-
/** Lista documentos con filtros y paginación. */
|
|
109
|
-
?: number;
|
|
115
|
+
descuentoItem?: number;
|
|
110
116
|
factorIcbper?: number;
|
|
111
117
|
codProdSunat?: string;
|
|
112
118
|
}[];
|
|
@@ -120,6 +126,12 @@ export declare class FacturacionClient {
|
|
|
120
126
|
legendCode: string;
|
|
121
127
|
legendValue: string;
|
|
122
128
|
}[];
|
|
129
|
+
observacion?: string;
|
|
130
|
+
vendedor?: string;
|
|
131
|
+
pagos?: {
|
|
132
|
+
metodoPago: string;
|
|
133
|
+
monto: number;
|
|
134
|
+
}[];
|
|
123
135
|
detraccion?: {
|
|
124
136
|
codBienServicio: string;
|
|
125
137
|
cuentaBanco: string;
|
|
@@ -127,6 +139,10 @@ export declare class FacturacionClient {
|
|
|
127
139
|
monto: number;
|
|
128
140
|
medioPago?: string;
|
|
129
141
|
};
|
|
142
|
+
guiaRemision?: {
|
|
143
|
+
tipoDoc?: "31" | "09";
|
|
144
|
+
nroDoc: string;
|
|
145
|
+
}[];
|
|
130
146
|
};
|
|
131
147
|
};
|
|
132
148
|
};
|
|
@@ -225,9 +241,7 @@ export declare class FacturacionClient {
|
|
|
225
241
|
montoPrecioUnitario: number;
|
|
226
242
|
montoValorVenta: number;
|
|
227
243
|
descuento?: number;
|
|
228
|
-
descuentoItem
|
|
229
|
-
/** Lista documentos con filtros y paginación. */
|
|
230
|
-
?: number;
|
|
244
|
+
descuentoItem?: number;
|
|
231
245
|
factorIcbper?: number;
|
|
232
246
|
codProdSunat?: string;
|
|
233
247
|
}[];
|
|
@@ -241,6 +255,12 @@ export declare class FacturacionClient {
|
|
|
241
255
|
legendCode: string;
|
|
242
256
|
legendValue: string;
|
|
243
257
|
}[];
|
|
258
|
+
observacion?: string;
|
|
259
|
+
vendedor?: string;
|
|
260
|
+
pagos?: {
|
|
261
|
+
metodoPago: string;
|
|
262
|
+
monto: number;
|
|
263
|
+
}[];
|
|
244
264
|
detraccion?: {
|
|
245
265
|
codBienServicio: string;
|
|
246
266
|
cuentaBanco: string;
|
|
@@ -248,6 +268,10 @@ export declare class FacturacionClient {
|
|
|
248
268
|
monto: number;
|
|
249
269
|
medioPago?: string;
|
|
250
270
|
};
|
|
271
|
+
guiaRemision?: {
|
|
272
|
+
tipoDoc?: "31" | "09";
|
|
273
|
+
nroDoc: string;
|
|
274
|
+
}[];
|
|
251
275
|
};
|
|
252
276
|
}, `${string}/${string}`>>;
|
|
253
277
|
/** Calcula importes (Modelo B) de una factura/boleta SIN emitir. */
|
|
@@ -278,10 +302,8 @@ export declare class FacturacionClient {
|
|
|
278
302
|
marca?: string;
|
|
279
303
|
codProdSunat?: string;
|
|
280
304
|
}[];
|
|
281
|
-
descuentoGlobal
|
|
282
|
-
|
|
283
|
-
?: {
|
|
284
|
-
porcentaje? /** Lista los catálogos SUNAT disponibles. */: number;
|
|
305
|
+
descuentoGlobal?: {
|
|
306
|
+
porcentaje?: number;
|
|
285
307
|
monto?: number;
|
|
286
308
|
};
|
|
287
309
|
preciosIncluyenIgv?: boolean;
|
|
@@ -318,7 +340,7 @@ export declare class FacturacionClient {
|
|
|
318
340
|
totalImpuestos: number;
|
|
319
341
|
montoPrecioUnitario: number;
|
|
320
342
|
factorIcbper: number;
|
|
321
|
-
codProdSunat
|
|
343
|
+
codProdSunat?: string;
|
|
322
344
|
}[];
|
|
323
345
|
montoOperGravadas: number;
|
|
324
346
|
montoOperExoneradas: number;
|
|
@@ -360,7 +382,7 @@ export declare class FacturacionClient {
|
|
|
360
382
|
codProdSunat?: string;
|
|
361
383
|
}[];
|
|
362
384
|
descuentoGlobal?: {
|
|
363
|
-
porcentaje
|
|
385
|
+
porcentaje?: number;
|
|
364
386
|
monto?: number;
|
|
365
387
|
};
|
|
366
388
|
preciosIncluyenIgv?: boolean;
|
|
@@ -685,6 +707,9 @@ export declare class FacturacionClient {
|
|
|
685
707
|
destinatarioTelefono?: string;
|
|
686
708
|
destinatarioEmail?: string;
|
|
687
709
|
entregaReferencia?: string;
|
|
710
|
+
modalidadEntrega?: "DOMICILIO" | "AGENCIA";
|
|
711
|
+
agenciaNombre?: string;
|
|
712
|
+
agenciaSede?: string;
|
|
688
713
|
guiaCodTraslado: string;
|
|
689
714
|
guiaModTraslado: "01" | "02";
|
|
690
715
|
guiaPesoTotal: number;
|
|
@@ -697,8 +722,10 @@ export declare class FacturacionClient {
|
|
|
697
722
|
transportistaNroMtc?: string;
|
|
698
723
|
guiaPartidaUbigeo: string;
|
|
699
724
|
guiaPartidaDireccion: string;
|
|
725
|
+
guiaPartidaCiudad?: string;
|
|
700
726
|
guiaLlegadaUbigeo: string;
|
|
701
727
|
guiaLlegadaDireccion: string;
|
|
728
|
+
guiaLlegadaCiudad?: string;
|
|
702
729
|
chofer?: {
|
|
703
730
|
tipo: "Principal" | "Secundario";
|
|
704
731
|
tipoDoc: string;
|
|
@@ -846,6 +873,9 @@ export declare class FacturacionClient {
|
|
|
846
873
|
destinatarioTelefono?: string;
|
|
847
874
|
destinatarioEmail?: string;
|
|
848
875
|
entregaReferencia?: string;
|
|
876
|
+
modalidadEntrega?: "DOMICILIO" | "AGENCIA";
|
|
877
|
+
agenciaNombre?: string;
|
|
878
|
+
agenciaSede?: string;
|
|
849
879
|
guiaCodTraslado: string;
|
|
850
880
|
guiaModTraslado: "01" | "02";
|
|
851
881
|
guiaPesoTotal: number;
|
|
@@ -858,8 +888,10 @@ export declare class FacturacionClient {
|
|
|
858
888
|
transportistaNroMtc?: string;
|
|
859
889
|
guiaPartidaUbigeo: string;
|
|
860
890
|
guiaPartidaDireccion: string;
|
|
891
|
+
guiaPartidaCiudad?: string;
|
|
861
892
|
guiaLlegadaUbigeo: string;
|
|
862
893
|
guiaLlegadaDireccion: string;
|
|
894
|
+
guiaLlegadaCiudad?: string;
|
|
863
895
|
chofer?: {
|
|
864
896
|
tipo: "Principal" | "Secundario";
|
|
865
897
|
tipoDoc: string;
|
|
@@ -1039,6 +1071,9 @@ export declare class FacturacionClient {
|
|
|
1039
1071
|
destinatarioTelefono?: string;
|
|
1040
1072
|
destinatarioEmail?: string;
|
|
1041
1073
|
entregaReferencia?: string;
|
|
1074
|
+
modalidadEntrega?: "DOMICILIO" | "AGENCIA";
|
|
1075
|
+
agenciaNombre?: string;
|
|
1076
|
+
agenciaSede?: string;
|
|
1042
1077
|
guiaLlegadaUbigeo: string;
|
|
1043
1078
|
guiaLlegadaDireccion: string;
|
|
1044
1079
|
guiaPesoTotal: number;
|
|
@@ -1196,6 +1231,9 @@ export declare class FacturacionClient {
|
|
|
1196
1231
|
destinatarioTelefono?: string;
|
|
1197
1232
|
destinatarioEmail?: string;
|
|
1198
1233
|
entregaReferencia?: string;
|
|
1234
|
+
modalidadEntrega?: "DOMICILIO" | "AGENCIA";
|
|
1235
|
+
agenciaNombre?: string;
|
|
1236
|
+
agenciaSede?: string;
|
|
1199
1237
|
guiaLlegadaUbigeo: string;
|
|
1200
1238
|
guiaLlegadaDireccion: string;
|
|
1201
1239
|
guiaPesoTotal: number;
|
|
@@ -1239,6 +1277,9 @@ export declare class FacturacionClient {
|
|
|
1239
1277
|
destinatarioTelefono?: string;
|
|
1240
1278
|
destinatarioEmail?: string;
|
|
1241
1279
|
entregaReferencia?: string;
|
|
1280
|
+
modalidadEntrega?: "DOMICILIO" | "AGENCIA";
|
|
1281
|
+
agenciaNombre?: string;
|
|
1282
|
+
agenciaSede?: string;
|
|
1242
1283
|
remitenteTipoDoc: string;
|
|
1243
1284
|
remitenteNumDoc: string;
|
|
1244
1285
|
remitenteRazonSocial: string;
|
|
@@ -1354,6 +1395,9 @@ export declare class FacturacionClient {
|
|
|
1354
1395
|
destinatarioTelefono?: string;
|
|
1355
1396
|
destinatarioEmail?: string;
|
|
1356
1397
|
entregaReferencia?: string;
|
|
1398
|
+
modalidadEntrega?: "DOMICILIO" | "AGENCIA";
|
|
1399
|
+
agenciaNombre?: string;
|
|
1400
|
+
agenciaSede?: string;
|
|
1357
1401
|
remitenteTipoDoc: string;
|
|
1358
1402
|
remitenteNumDoc: string;
|
|
1359
1403
|
remitenteRazonSocial: string;
|
|
@@ -1791,8 +1835,10 @@ export declare class FacturacionClient {
|
|
|
1791
1835
|
clienteNumDoc: string;
|
|
1792
1836
|
clienteRazonSocial: string;
|
|
1793
1837
|
montoImpVenta: string;
|
|
1838
|
+
montoIgv?: string;
|
|
1794
1839
|
estadoSunat: string;
|
|
1795
1840
|
codigoRespuesta: string | null;
|
|
1841
|
+
descripcionRespuesta?: string | null;
|
|
1796
1842
|
hashCdr: string | null;
|
|
1797
1843
|
createdAt: string;
|
|
1798
1844
|
company: {
|
|
@@ -1953,6 +1999,86 @@ export declare class FacturacionClient {
|
|
|
1953
1999
|
};
|
|
1954
2000
|
};
|
|
1955
2001
|
}, `${string}/${string}`>>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Consulta el CDR de un comprobante directamente en SUNAT, por referencia
|
|
2004
|
+
* (ruc/tipo/serie/número). Sirve cuando el documento no está en la API o su
|
|
2005
|
+
* estado local quedó desincronizado.
|
|
2006
|
+
*/
|
|
2007
|
+
consultarCdr(body: ConsultarCdrInput): Promise<import("openapi-fetch").FetchResponse<{
|
|
2008
|
+
parameters: {
|
|
2009
|
+
query?: never;
|
|
2010
|
+
header?: never;
|
|
2011
|
+
path?: never;
|
|
2012
|
+
cookie?: never;
|
|
2013
|
+
};
|
|
2014
|
+
requestBody: {
|
|
2015
|
+
content: {
|
|
2016
|
+
"application/json": {
|
|
2017
|
+
ruc: string;
|
|
2018
|
+
tipoDoc: "01" | "03" | "07" | "08";
|
|
2019
|
+
serie: string;
|
|
2020
|
+
numero: string;
|
|
2021
|
+
};
|
|
2022
|
+
};
|
|
2023
|
+
};
|
|
2024
|
+
responses: {
|
|
2025
|
+
200: {
|
|
2026
|
+
headers: {
|
|
2027
|
+
[name: string]: unknown;
|
|
2028
|
+
};
|
|
2029
|
+
content: {
|
|
2030
|
+
"application/json": {
|
|
2031
|
+
success: boolean;
|
|
2032
|
+
available: boolean;
|
|
2033
|
+
message: string;
|
|
2034
|
+
statusCode?: string;
|
|
2035
|
+
codigo?: string;
|
|
2036
|
+
descripcion?: string;
|
|
2037
|
+
cdrZipBase64?: string;
|
|
2038
|
+
};
|
|
2039
|
+
};
|
|
2040
|
+
};
|
|
2041
|
+
400: {
|
|
2042
|
+
headers: {
|
|
2043
|
+
[name: string]: unknown;
|
|
2044
|
+
};
|
|
2045
|
+
content: {
|
|
2046
|
+
"application/json": {
|
|
2047
|
+
success: false;
|
|
2048
|
+
message: string;
|
|
2049
|
+
code?: string;
|
|
2050
|
+
errors?: {
|
|
2051
|
+
path: string;
|
|
2052
|
+
message: string;
|
|
2053
|
+
}[];
|
|
2054
|
+
};
|
|
2055
|
+
};
|
|
2056
|
+
};
|
|
2057
|
+
404: {
|
|
2058
|
+
headers: {
|
|
2059
|
+
[name: string]: unknown;
|
|
2060
|
+
};
|
|
2061
|
+
content: {
|
|
2062
|
+
"application/json": {
|
|
2063
|
+
success: false;
|
|
2064
|
+
message: string;
|
|
2065
|
+
code?: string;
|
|
2066
|
+
errors?: {
|
|
2067
|
+
path: string;
|
|
2068
|
+
message: string;
|
|
2069
|
+
}[];
|
|
2070
|
+
};
|
|
2071
|
+
};
|
|
2072
|
+
};
|
|
2073
|
+
};
|
|
2074
|
+
}, {
|
|
2075
|
+
body: {
|
|
2076
|
+
ruc: string;
|
|
2077
|
+
tipoDoc: "01" | "03" | "07" | "08";
|
|
2078
|
+
serie: string;
|
|
2079
|
+
numero: string;
|
|
2080
|
+
};
|
|
2081
|
+
}, `${string}/${string}`>>;
|
|
1956
2082
|
/** XML firmado de una factura/boleta. */
|
|
1957
2083
|
getInvoiceXml(id: string): Promise<ArrayBuffer>;
|
|
1958
2084
|
/** CDR (constancia SUNAT) de una factura/boleta. */
|
|
@@ -1963,8 +2089,12 @@ export declare class FacturacionClient {
|
|
|
1963
2089
|
getNoteXml(id: string): Promise<ArrayBuffer>;
|
|
1964
2090
|
/** PDF de una nota (07/08). */
|
|
1965
2091
|
getNotePdf(id: string): Promise<ArrayBuffer>;
|
|
2092
|
+
/** CDR (constancia SUNAT) de una nota (07/08). */
|
|
2093
|
+
getNoteCdr(id: string): Promise<ArrayBuffer>;
|
|
1966
2094
|
/** XML firmado de una guía de remisión (09/31). */
|
|
1967
2095
|
getDespatchXml(id: string): Promise<ArrayBuffer>;
|
|
2096
|
+
/** CDR (constancia SUNAT) de una guía de remisión (09/31). */
|
|
2097
|
+
getDespatchCdr(id: string): Promise<ArrayBuffer>;
|
|
1968
2098
|
/** PDF de una guía de remisión (09/31). `format`: a4 | ticket80 | ticket58. */
|
|
1969
2099
|
getDespatchPdf(id: string, format?: NonNullable<paths["/api/v1/despatch/{id}/pdf"]["get"]["parameters"]["query"]>["format"]): Promise<ArrayBuffer>;
|
|
1970
2100
|
/** Lista las empresas accesibles por la key. */
|
|
@@ -1985,6 +2115,201 @@ export declare class FacturacionClient {
|
|
|
1985
2115
|
};
|
|
1986
2116
|
};
|
|
1987
2117
|
}, {}, `${string}/${string}`>>;
|
|
2118
|
+
/**
|
|
2119
|
+
* Da de alta un RUC emisor en tu cuenta.
|
|
2120
|
+
*
|
|
2121
|
+
* Requiere una key de CUENTA: una atada a una empresa (`empresaRuc`) no crea
|
|
2122
|
+
* otras. El tope de RUC lo pone tu plan.
|
|
2123
|
+
*
|
|
2124
|
+
* Registrar no es acreditar: el RUC queda tuyo pero no podés emitir hasta
|
|
2125
|
+
* subir su certificado digital, que se hace desde el portal.
|
|
2126
|
+
*/
|
|
2127
|
+
createCompany(body: CreateCompanyInput): Promise<import("openapi-fetch").FetchResponse<{
|
|
2128
|
+
parameters: {
|
|
2129
|
+
query?: never;
|
|
2130
|
+
header?: never;
|
|
2131
|
+
path?: never;
|
|
2132
|
+
cookie?: never;
|
|
2133
|
+
};
|
|
2134
|
+
requestBody: {
|
|
2135
|
+
content: {
|
|
2136
|
+
"application/json": {
|
|
2137
|
+
ruc: string;
|
|
2138
|
+
razonSocial: string;
|
|
2139
|
+
nombreComercial?: string;
|
|
2140
|
+
ubigeo?: string;
|
|
2141
|
+
direccion?: string;
|
|
2142
|
+
departamento?: string;
|
|
2143
|
+
provincia?: string;
|
|
2144
|
+
distrito?: string;
|
|
2145
|
+
urbanizacion?: string;
|
|
2146
|
+
telefono?: string;
|
|
2147
|
+
email?: string;
|
|
2148
|
+
web?: string;
|
|
2149
|
+
solUser?: string;
|
|
2150
|
+
solPassword?: string;
|
|
2151
|
+
tenantId?: string;
|
|
2152
|
+
greClientId?: string;
|
|
2153
|
+
greClientSecret?: string;
|
|
2154
|
+
sunatProduction?: boolean;
|
|
2155
|
+
cuentasBancarias?: {
|
|
2156
|
+
nombre: string;
|
|
2157
|
+
bancos?: string[];
|
|
2158
|
+
tipoLabel: string;
|
|
2159
|
+
titularLabel?: string;
|
|
2160
|
+
titular?: string;
|
|
2161
|
+
titularRuc?: string;
|
|
2162
|
+
numero: string;
|
|
2163
|
+
cci?: string;
|
|
2164
|
+
}[];
|
|
2165
|
+
terminosTitulo?: string | null;
|
|
2166
|
+
terminos?: string[];
|
|
2167
|
+
notaPagoTitulo?: string | null;
|
|
2168
|
+
notaPagoTexto?: string | null;
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2171
|
+
};
|
|
2172
|
+
responses: {
|
|
2173
|
+
200: {
|
|
2174
|
+
headers: {
|
|
2175
|
+
[name: string]: unknown;
|
|
2176
|
+
};
|
|
2177
|
+
content?: never;
|
|
2178
|
+
};
|
|
2179
|
+
};
|
|
2180
|
+
}, {
|
|
2181
|
+
body: {
|
|
2182
|
+
ruc: string;
|
|
2183
|
+
razonSocial: string;
|
|
2184
|
+
nombreComercial?: string;
|
|
2185
|
+
ubigeo?: string;
|
|
2186
|
+
direccion?: string;
|
|
2187
|
+
departamento?: string;
|
|
2188
|
+
provincia?: string;
|
|
2189
|
+
distrito?: string;
|
|
2190
|
+
urbanizacion?: string;
|
|
2191
|
+
telefono?: string;
|
|
2192
|
+
email?: string;
|
|
2193
|
+
web?: string;
|
|
2194
|
+
solUser?: string;
|
|
2195
|
+
solPassword?: string;
|
|
2196
|
+
tenantId?: string;
|
|
2197
|
+
greClientId?: string;
|
|
2198
|
+
greClientSecret?: string;
|
|
2199
|
+
sunatProduction?: boolean;
|
|
2200
|
+
cuentasBancarias?: {
|
|
2201
|
+
nombre: string;
|
|
2202
|
+
bancos?: string[];
|
|
2203
|
+
tipoLabel: string;
|
|
2204
|
+
titularLabel?: string;
|
|
2205
|
+
titular?: string;
|
|
2206
|
+
titularRuc?: string;
|
|
2207
|
+
numero: string;
|
|
2208
|
+
cci?: string;
|
|
2209
|
+
}[];
|
|
2210
|
+
terminosTitulo?: string | null;
|
|
2211
|
+
terminos?: string[];
|
|
2212
|
+
notaPagoTitulo?: string | null;
|
|
2213
|
+
notaPagoTexto?: string | null;
|
|
2214
|
+
};
|
|
2215
|
+
}, `${string}/${string}`>>;
|
|
2216
|
+
/** Actualiza los datos de una empresa emisora (domicilio fiscal, contacto). */
|
|
2217
|
+
updateCompany(id: string, body: UpdateCompanyInput): Promise<import("openapi-fetch").FetchResponse<{
|
|
2218
|
+
parameters: {
|
|
2219
|
+
query?: never;
|
|
2220
|
+
header?: never;
|
|
2221
|
+
path: {
|
|
2222
|
+
id: string;
|
|
2223
|
+
};
|
|
2224
|
+
cookie?: never;
|
|
2225
|
+
};
|
|
2226
|
+
requestBody: {
|
|
2227
|
+
content: {
|
|
2228
|
+
"application/json": {
|
|
2229
|
+
ruc?: string;
|
|
2230
|
+
razonSocial?: string;
|
|
2231
|
+
nombreComercial?: string;
|
|
2232
|
+
ubigeo?: string;
|
|
2233
|
+
direccion?: string;
|
|
2234
|
+
departamento?: string;
|
|
2235
|
+
provincia?: string;
|
|
2236
|
+
distrito?: string;
|
|
2237
|
+
urbanizacion?: string;
|
|
2238
|
+
telefono?: string;
|
|
2239
|
+
email?: string;
|
|
2240
|
+
web?: string;
|
|
2241
|
+
solUser?: string;
|
|
2242
|
+
solPassword?: string;
|
|
2243
|
+
tenantId?: string;
|
|
2244
|
+
greClientId?: string;
|
|
2245
|
+
greClientSecret?: string;
|
|
2246
|
+
sunatProduction?: boolean;
|
|
2247
|
+
cuentasBancarias?: {
|
|
2248
|
+
nombre: string;
|
|
2249
|
+
bancos?: string[];
|
|
2250
|
+
tipoLabel: string;
|
|
2251
|
+
titularLabel?: string;
|
|
2252
|
+
titular?: string;
|
|
2253
|
+
titularRuc?: string;
|
|
2254
|
+
numero: string;
|
|
2255
|
+
cci?: string;
|
|
2256
|
+
}[];
|
|
2257
|
+
terminosTitulo?: string | null;
|
|
2258
|
+
terminos?: string[];
|
|
2259
|
+
notaPagoTitulo?: string | null;
|
|
2260
|
+
notaPagoTexto?: string | null;
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
};
|
|
2264
|
+
responses: {
|
|
2265
|
+
200: {
|
|
2266
|
+
headers: {
|
|
2267
|
+
[name: string]: unknown;
|
|
2268
|
+
};
|
|
2269
|
+
content?: never;
|
|
2270
|
+
};
|
|
2271
|
+
};
|
|
2272
|
+
}, {
|
|
2273
|
+
params: {
|
|
2274
|
+
path: {
|
|
2275
|
+
id: string;
|
|
2276
|
+
};
|
|
2277
|
+
};
|
|
2278
|
+
body: {
|
|
2279
|
+
ruc?: string;
|
|
2280
|
+
razonSocial?: string;
|
|
2281
|
+
nombreComercial?: string;
|
|
2282
|
+
ubigeo?: string;
|
|
2283
|
+
direccion?: string;
|
|
2284
|
+
departamento?: string;
|
|
2285
|
+
provincia?: string;
|
|
2286
|
+
distrito?: string;
|
|
2287
|
+
urbanizacion?: string;
|
|
2288
|
+
telefono?: string;
|
|
2289
|
+
email?: string;
|
|
2290
|
+
web?: string;
|
|
2291
|
+
solUser?: string;
|
|
2292
|
+
solPassword?: string;
|
|
2293
|
+
tenantId?: string;
|
|
2294
|
+
greClientId?: string;
|
|
2295
|
+
greClientSecret?: string;
|
|
2296
|
+
sunatProduction?: boolean;
|
|
2297
|
+
cuentasBancarias?: {
|
|
2298
|
+
nombre: string;
|
|
2299
|
+
bancos?: string[];
|
|
2300
|
+
tipoLabel: string;
|
|
2301
|
+
titularLabel?: string;
|
|
2302
|
+
titular?: string;
|
|
2303
|
+
titularRuc?: string;
|
|
2304
|
+
numero: string;
|
|
2305
|
+
cci?: string;
|
|
2306
|
+
}[];
|
|
2307
|
+
terminosTitulo?: string | null;
|
|
2308
|
+
terminos?: string[];
|
|
2309
|
+
notaPagoTitulo?: string | null;
|
|
2310
|
+
notaPagoTexto?: string | null;
|
|
2311
|
+
};
|
|
2312
|
+
}, `${string}/${string}`>>;
|
|
1988
2313
|
/** Detalle de una empresa por ID. */
|
|
1989
2314
|
getCompany(id: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
1990
2315
|
parameters: {
|
|
@@ -2013,7 +2338,172 @@ export declare class FacturacionClient {
|
|
|
2013
2338
|
}, `${string}/${string}`>>;
|
|
2014
2339
|
/** Logo de la empresa (imagen). */
|
|
2015
2340
|
getCompanyLogo(id: string): Promise<ArrayBuffer>;
|
|
2016
|
-
/**
|
|
2341
|
+
/** Lista los establecimientos de una empresa. */
|
|
2342
|
+
listBranches(companyId: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
2343
|
+
parameters: {
|
|
2344
|
+
query?: never;
|
|
2345
|
+
header?: never;
|
|
2346
|
+
path: {
|
|
2347
|
+
id: string;
|
|
2348
|
+
};
|
|
2349
|
+
cookie?: never;
|
|
2350
|
+
};
|
|
2351
|
+
requestBody?: never;
|
|
2352
|
+
responses: {
|
|
2353
|
+
200: {
|
|
2354
|
+
headers: {
|
|
2355
|
+
[name: string]: unknown;
|
|
2356
|
+
};
|
|
2357
|
+
content?: never;
|
|
2358
|
+
};
|
|
2359
|
+
};
|
|
2360
|
+
}, {
|
|
2361
|
+
params: {
|
|
2362
|
+
path: {
|
|
2363
|
+
id: string;
|
|
2364
|
+
};
|
|
2365
|
+
};
|
|
2366
|
+
}, `${string}/${string}`>>;
|
|
2367
|
+
/** Registra un establecimiento anexo. El `codigo` es el de SUNAT (4 dígitos). */
|
|
2368
|
+
createBranch(companyId: string, body: CreateBranchInput): Promise<import("openapi-fetch").FetchResponse<{
|
|
2369
|
+
parameters: {
|
|
2370
|
+
query?: never;
|
|
2371
|
+
header?: never;
|
|
2372
|
+
path: {
|
|
2373
|
+
id: string;
|
|
2374
|
+
};
|
|
2375
|
+
cookie?: never;
|
|
2376
|
+
};
|
|
2377
|
+
requestBody: {
|
|
2378
|
+
content: {
|
|
2379
|
+
"application/json": {
|
|
2380
|
+
codigo: string;
|
|
2381
|
+
nombre?: string;
|
|
2382
|
+
ubigeo?: string;
|
|
2383
|
+
direccion?: string;
|
|
2384
|
+
departamento?: string;
|
|
2385
|
+
provincia?: string;
|
|
2386
|
+
distrito?: string;
|
|
2387
|
+
urbanizacion?: string;
|
|
2388
|
+
isActive?: boolean;
|
|
2389
|
+
};
|
|
2390
|
+
};
|
|
2391
|
+
};
|
|
2392
|
+
responses: {
|
|
2393
|
+
200: {
|
|
2394
|
+
headers: {
|
|
2395
|
+
[name: string]: unknown;
|
|
2396
|
+
};
|
|
2397
|
+
content?: never;
|
|
2398
|
+
};
|
|
2399
|
+
};
|
|
2400
|
+
}, {
|
|
2401
|
+
params: {
|
|
2402
|
+
path: {
|
|
2403
|
+
id: string;
|
|
2404
|
+
};
|
|
2405
|
+
};
|
|
2406
|
+
body: {
|
|
2407
|
+
codigo: string;
|
|
2408
|
+
nombre?: string;
|
|
2409
|
+
ubigeo?: string;
|
|
2410
|
+
direccion?: string;
|
|
2411
|
+
departamento?: string;
|
|
2412
|
+
provincia?: string;
|
|
2413
|
+
distrito?: string;
|
|
2414
|
+
urbanizacion?: string;
|
|
2415
|
+
isActive?: boolean;
|
|
2416
|
+
};
|
|
2417
|
+
}, `${string}/${string}`>>;
|
|
2418
|
+
/** Actualiza un establecimiento (nombre, dirección, ubigeo). El código no se cambia. */
|
|
2419
|
+
updateBranch(companyId: string, branchId: string, body: UpdateBranchInput): Promise<import("openapi-fetch").FetchResponse<{
|
|
2420
|
+
parameters: {
|
|
2421
|
+
query?: never;
|
|
2422
|
+
header?: never;
|
|
2423
|
+
path: {
|
|
2424
|
+
id: string;
|
|
2425
|
+
branchId: string;
|
|
2426
|
+
};
|
|
2427
|
+
cookie?: never;
|
|
2428
|
+
};
|
|
2429
|
+
requestBody: {
|
|
2430
|
+
content: {
|
|
2431
|
+
"application/json": {
|
|
2432
|
+
nombre?: string;
|
|
2433
|
+
ubigeo?: string;
|
|
2434
|
+
direccion?: string;
|
|
2435
|
+
departamento?: string;
|
|
2436
|
+
provincia?: string;
|
|
2437
|
+
distrito?: string;
|
|
2438
|
+
urbanizacion?: string;
|
|
2439
|
+
isActive?: boolean;
|
|
2440
|
+
};
|
|
2441
|
+
};
|
|
2442
|
+
};
|
|
2443
|
+
responses: {
|
|
2444
|
+
200: {
|
|
2445
|
+
headers: {
|
|
2446
|
+
[name: string]: unknown;
|
|
2447
|
+
};
|
|
2448
|
+
content?: never;
|
|
2449
|
+
};
|
|
2450
|
+
};
|
|
2451
|
+
}, {
|
|
2452
|
+
params: {
|
|
2453
|
+
path: {
|
|
2454
|
+
id: string;
|
|
2455
|
+
branchId: string;
|
|
2456
|
+
};
|
|
2457
|
+
};
|
|
2458
|
+
body: {
|
|
2459
|
+
nombre?: string;
|
|
2460
|
+
ubigeo?: string;
|
|
2461
|
+
direccion?: string;
|
|
2462
|
+
departamento?: string;
|
|
2463
|
+
provincia?: string;
|
|
2464
|
+
distrito?: string;
|
|
2465
|
+
urbanizacion?: string;
|
|
2466
|
+
isActive?: boolean;
|
|
2467
|
+
};
|
|
2468
|
+
}, `${string}/${string}`>>;
|
|
2469
|
+
/**
|
|
2470
|
+
* Desactiva un establecimiento (soft-delete: puede haber comprobantes emitidos
|
|
2471
|
+
* desde ahí). El matriz "0000" no se puede desactivar — responde 409.
|
|
2472
|
+
*/
|
|
2473
|
+
deleteBranch(companyId: string, branchId: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
2474
|
+
parameters: {
|
|
2475
|
+
query?: never;
|
|
2476
|
+
header?: never;
|
|
2477
|
+
path: {
|
|
2478
|
+
id: string;
|
|
2479
|
+
branchId: string;
|
|
2480
|
+
};
|
|
2481
|
+
cookie?: never;
|
|
2482
|
+
};
|
|
2483
|
+
requestBody?: never;
|
|
2484
|
+
responses: {
|
|
2485
|
+
200: {
|
|
2486
|
+
headers: {
|
|
2487
|
+
[name: string]: unknown;
|
|
2488
|
+
};
|
|
2489
|
+
content?: never;
|
|
2490
|
+
};
|
|
2491
|
+
};
|
|
2492
|
+
}, {
|
|
2493
|
+
params: {
|
|
2494
|
+
path: {
|
|
2495
|
+
id: string;
|
|
2496
|
+
branchId: string;
|
|
2497
|
+
};
|
|
2498
|
+
};
|
|
2499
|
+
}, `${string}/${string}`>>;
|
|
2500
|
+
/**
|
|
2501
|
+
* Crea una suscripción a webhooks. El secret se devuelve UNA sola vez.
|
|
2502
|
+
*
|
|
2503
|
+
* Sin `empresaRuc` el webhook cubre TODAS las empresas de tu cuenta: un solo
|
|
2504
|
+
* endpoint y un solo secret, y los RUC que des de alta después quedan
|
|
2505
|
+
* cubiertos solos. Cada payload trae su `empresaRuc` para que rutees.
|
|
2506
|
+
*/
|
|
2017
2507
|
createWebhook(body: CreateWebhookInput): Promise<import("openapi-fetch").FetchResponse<{
|
|
2018
2508
|
parameters: {
|
|
2019
2509
|
query?: never;
|
|
@@ -2024,7 +2514,8 @@ export declare class FacturacionClient {
|
|
|
2024
2514
|
requestBody: {
|
|
2025
2515
|
content: {
|
|
2026
2516
|
"application/json": {
|
|
2027
|
-
empresaRuc
|
|
2517
|
+
empresaRuc?: string;
|
|
2518
|
+
tenantId?: string;
|
|
2028
2519
|
url: string;
|
|
2029
2520
|
events: ("document.accepted" | "document.rejected" | "document.queue_failed" | "document.retried" | "ticket.resolved")[];
|
|
2030
2521
|
description?: string;
|
|
@@ -2042,7 +2533,8 @@ export declare class FacturacionClient {
|
|
|
2042
2533
|
};
|
|
2043
2534
|
}, {
|
|
2044
2535
|
body: {
|
|
2045
|
-
empresaRuc
|
|
2536
|
+
empresaRuc?: string;
|
|
2537
|
+
tenantId?: string;
|
|
2046
2538
|
url: string;
|
|
2047
2539
|
events: ("document.accepted" | "document.rejected" | "document.queue_failed" | "document.retried" | "ticket.resolved")[];
|
|
2048
2540
|
description?: string;
|
|
@@ -2369,7 +2861,13 @@ export declare class FacturacionClient {
|
|
|
2369
2861
|
consultarComprobanteXml(ruc: string, tipoDoc: string, serie: string, numero: string): Promise<ArrayBuffer>;
|
|
2370
2862
|
/** Estado de las colas BullMQ (jobs en cada estado). */
|
|
2371
2863
|
getQueueStats(): Promise<QueueStats>;
|
|
2372
|
-
/**
|
|
2864
|
+
/**
|
|
2865
|
+
* Descarga binaria genérica para endpoints de archivo `{id}`.
|
|
2866
|
+
*
|
|
2867
|
+
* openapi-fetch no infiere bien una unión de rutas, y estos endpoints declaran
|
|
2868
|
+
* el cuerpo como binario (sin schema JSON), así que el cast es inevitable. Se
|
|
2869
|
+
* mantiene acotado a `BinaryPath` para no perder el chequeo de la ruta.
|
|
2870
|
+
*/
|
|
2373
2871
|
private fetchBinary;
|
|
2374
2872
|
/**
|
|
2375
2873
|
* Espera a que un documento llegue a estado final (ACEPTADO/RECHAZADO/COLA_FALLIDA/ANULADO).
|