sae-ts-sdk 0.1.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.
@@ -0,0 +1,509 @@
1
+ import { LicenseType, LicensePlatform } from './enums';
2
+ export interface CodigoComercialRequest {
3
+ tipo: string;
4
+ codigo: string;
5
+ }
6
+ export interface GenerarDocumentoRequest {
7
+ tipoDocumento: string;
8
+ clave: ClaveRequest;
9
+ consecutivo: ConsecutivoRequest;
10
+ codigoActividadEmisor: string;
11
+ codigoActividadReceptor: string;
12
+ fechaEmision: string;
13
+ proveedorSistemas: string;
14
+ emisor: EmisorRequest;
15
+ receptor: ReceptorRequest;
16
+ condicionVenta: string;
17
+ condicionVentaOtros?: CondicionVentaOtro;
18
+ plazoCredito?: number;
19
+ detalleServicio: DetalleServicioRequest;
20
+ resumenFactura?: ResumenFacturaRequest;
21
+ informacionReferencia?: InformacionReferenciaRequest[];
22
+ otrosCargos?: OtrosCargosRequest[];
23
+ otrosDatos?: OtrosRequest;
24
+ }
25
+ export interface ClaveRequest {
26
+ codigoPais: number;
27
+ dia: number;
28
+ mes: number;
29
+ ano: number;
30
+ consecutivo: ConsecutivoRequest;
31
+ cedulaEmisor: string;
32
+ situacion: string;
33
+ }
34
+ export interface ConsecutivoRequest {
35
+ establecimiento: number;
36
+ terminal: number;
37
+ numeroConsecutivo: number;
38
+ tipoComprobante: string;
39
+ }
40
+ export interface IdentificacionRequest {
41
+ tipo: string;
42
+ numero: string;
43
+ }
44
+ export interface EmisorRequest {
45
+ identificacion: IdentificacionRequest;
46
+ nombre: string;
47
+ nombreComercial?: string;
48
+ ubicacion: UbicacionRequest;
49
+ telefono: TelefonoRequest;
50
+ correoElectronico: string[];
51
+ registroFiscal8707?: string;
52
+ seFacturanBebidasAlc: boolean;
53
+ }
54
+ export interface TelefonoRequest {
55
+ codigoPais: number;
56
+ numero: number;
57
+ }
58
+ export interface ReceptorRequest {
59
+ identificacion: IdentificacionRequest;
60
+ nombre: string;
61
+ identificacionExtranjero?: string;
62
+ nombreComercial?: string;
63
+ ubicacion?: UbicacionRequest;
64
+ otrasSenasExtranjero?: string;
65
+ telefono?: TelefonoRequest;
66
+ correoElectronico: string;
67
+ }
68
+ export interface UbicacionRequest {
69
+ provincia: string;
70
+ canton: string;
71
+ distrito: string;
72
+ barrio: string;
73
+ otrasSenas: string;
74
+ }
75
+ export interface DetalleServicioRequest {
76
+ lineasDetalle: LineaDetalleRequest[];
77
+ }
78
+ export interface LineaDetalleRequest {
79
+ numeroLinea?: number;
80
+ partidaArancelaria?: string;
81
+ codigoCABYS?: string;
82
+ codigosComerciales: CodigoComercialRequest[];
83
+ cantidad: number;
84
+ unidadMedida: string;
85
+ tipoTransaccion: string;
86
+ unidadMedidaComercial?: string;
87
+ detalle?: string;
88
+ numeroVINoSerie?: string[];
89
+ registroMedicamento?: string;
90
+ formaFarmaceutica?: string;
91
+ precioUnitario: number;
92
+ montoTotal?: number;
93
+ descuentos: DescuentoRequest[];
94
+ subTotal?: number;
95
+ ivaCobradoFabrica?: string;
96
+ baseImponible?: number;
97
+ impuestos: ImpuestoRequest[];
98
+ impuestoAsumidoEmisorFabrica?: number;
99
+ impuestoNeto?: number;
100
+ montoTotalLinea?: number;
101
+ }
102
+ export interface DescuentoRequest {
103
+ montoDescuento?: number;
104
+ codigoDescuento?: string;
105
+ codigoDescuentoOtro?: string;
106
+ naturalezaDescuento?: string;
107
+ }
108
+ export interface ImpuestoRequest {
109
+ codigo: string;
110
+ codigoImpuestoOTRO?: string;
111
+ codigoTarifaIVA: string;
112
+ tarifa?: number;
113
+ factorCalculoIVA?: number;
114
+ monto?: number;
115
+ exoneracion?: ExoneracionRequest;
116
+ }
117
+ export interface ExoneracionRequest {
118
+ tipoDocumentoEX1: string;
119
+ tipoDocumentoOTRO?: string;
120
+ numeroDocumento: string;
121
+ articulo: number;
122
+ inciso: number;
123
+ nombreInstitucion: string;
124
+ nombreInstitucionOtros?: string;
125
+ fechaEmisionEX: string;
126
+ tarifaExonerada: number;
127
+ montoExoneracion: number;
128
+ }
129
+ export interface ResumenFacturaRequest {
130
+ codigoTipoMoneda?: CodigoTipoMonedaRequest;
131
+ totalServGravados?: number;
132
+ totalServExentos?: number;
133
+ totalServExonerado?: number;
134
+ totalServNoSujeto?: number;
135
+ totalMercanciasGravadas?: number;
136
+ totalMercanciasExentas?: number;
137
+ totalMercExonerada?: number;
138
+ totalMercNoSujeta?: number;
139
+ totalGravado?: number;
140
+ totalExento?: number;
141
+ totalExonerado?: number;
142
+ totalNoSujeto?: number;
143
+ totalVenta?: number;
144
+ totalDescuentos?: number;
145
+ totalVentaNeta?: number;
146
+ totalDesgloseImpuesto?: TotalDesgloseImpuestoRequest;
147
+ totalImpuesto?: number;
148
+ totalImpAsumEmisorFabrica?: number;
149
+ totalIvaDevuelto?: number;
150
+ totalOtrosCargos?: number;
151
+ tipoMedioPago?: MedioPagoRequest;
152
+ totalComprobante?: number;
153
+ }
154
+ export interface CodigoTipoMonedaRequest {
155
+ codigoMoneda: string;
156
+ tipoCambio: number;
157
+ }
158
+ export interface TotalDesgloseImpuestoRequest {
159
+ codigo: string;
160
+ codigoTarifaIVA: string;
161
+ totalMontoImpuesto: number;
162
+ }
163
+ export interface MedioPagoRequest {
164
+ tipoMedioPago?: string;
165
+ medioPagoOtros?: string;
166
+ totalMedioPago?: number;
167
+ }
168
+ export interface InformacionReferenciaRequest {
169
+ tipoDocIR: string;
170
+ tipoDocRefOTRO?: string;
171
+ numero: string;
172
+ fechaEmisionIR: string;
173
+ codigo: string;
174
+ codigoReferenciaOTRO?: string;
175
+ razon: string;
176
+ }
177
+ export interface OtrosCargosRequest {
178
+ tipoDocumentoOC: string;
179
+ tipoDocumentoOTROS?: string;
180
+ identificacionTercero: IdentificacionRequest;
181
+ nombreTercero: string;
182
+ detalle: string;
183
+ porcentajeOC: number;
184
+ montoCargo: number;
185
+ }
186
+ export interface OtrosRequest {
187
+ otroTexto?: string[];
188
+ otroContenido?: string;
189
+ }
190
+ export interface CondicionVentaOtro {
191
+ descripcion: string;
192
+ }
193
+ /**
194
+ * DTO simplificado para enviar documentos electrónicos.
195
+ */
196
+ export interface EnviarDocumentoSimplificadoRequest {
197
+ /** 01=FE, 02=ND, 03=NC, 04=Tiquete, 08=FEC, 09=FECE */
198
+ tipoDocumento?: string;
199
+ /** 01=Contado, 02=Crédito, etc. */
200
+ condicionVenta?: string;
201
+ /** Medios de pago: 01=Efectivo, 02=Tarjeta, etc. */
202
+ medioPago?: string[];
203
+ /** Lista detallada de medios de pago para facturas multipartes. */
204
+ mediosPago?: MedioPagoRequest[];
205
+ /** Código de moneda ISO (CRC, USD, EUR) */
206
+ codigoMoneda?: string;
207
+ /** Tipo de cambio respecto a CRC (1 si es CRC) */
208
+ tipoCambio?: number;
209
+ /** Plazo de crédito en días (solo si CondicionVenta=02) */
210
+ plazoCredito?: number;
211
+ /** Receptor/Cliente. Null = Consumidor Final / Sin Receptor. */
212
+ receptor?: ReceptorRequest;
213
+ /** Líneas de detalle del documento (requerido, mínimo 1) */
214
+ lineas: LineaDetalleRequest[];
215
+ /** Referencia para Notas de Crédito/Débito. */
216
+ referencia?: ReferenciaSimplificada;
217
+ /** Otros cargos (opcional) */
218
+ otrosCargos?: OtrosCargosRequest[];
219
+ /** Datos adicionales (opcional) */
220
+ otrosDatos?: OtrosRequest;
221
+ /** Código de actividad económica del emisor (opcional) */
222
+ codigoActividadEmisor?: string;
223
+ /** Código de actividad económica del receptor (opcional) */
224
+ codigoActividadReceptor?: string;
225
+ }
226
+ /**
227
+ * Referencia simplificada para NC/ND.
228
+ */
229
+ export interface ReferenciaSimplificada {
230
+ /** Clave numérica (50 dígitos) del documento que se referencia */
231
+ claveDocumentoReferencia: string;
232
+ /** Código de referencia Hacienda: 01=Anula, 02=Corrige texto, etc. */
233
+ codigo?: string;
234
+ /** Razón de la nota (descripción libre) */
235
+ razon: string;
236
+ }
237
+ export interface UpdateTenantRequest {
238
+ name?: string;
239
+ phone?: string;
240
+ taxId?: string;
241
+ ownerEmail?: string;
242
+ identificationType?: number;
243
+ commercialName?: string;
244
+ provinceCode?: string;
245
+ cantonCode?: string;
246
+ districtCode?: string;
247
+ addressDetails?: string;
248
+ economicActivityCode?: string;
249
+ isActive?: boolean;
250
+ }
251
+ export interface RegisterTenantRequest {
252
+ name: string;
253
+ ownerEmail: string;
254
+ taxId: string;
255
+ }
256
+ export interface HaciendaConfigRequest {
257
+ idCia?: string;
258
+ idSucursal?: string;
259
+ pinP12?: string;
260
+ certP12Base64?: string;
261
+ usuarioOauth?: string;
262
+ passwordOauth?: string;
263
+ environment?: string;
264
+ }
265
+ export interface SwitchEnvironmentRequest {
266
+ environment: number | string;
267
+ }
268
+ export interface CreateBranchRequest {
269
+ name: string;
270
+ code: string;
271
+ address?: string | null;
272
+ phone?: string | null;
273
+ managerName?: string | null;
274
+ }
275
+ export interface UpdateBranchRequest {
276
+ name?: string | null;
277
+ address?: string | null;
278
+ phone?: string | null;
279
+ managerName?: string | null;
280
+ isActive?: boolean | null;
281
+ }
282
+ export interface CreateTerminalRequest {
283
+ name: string;
284
+ code: string;
285
+ }
286
+ export interface UpdateTerminalRequest {
287
+ name?: string;
288
+ isActive?: boolean;
289
+ }
290
+ export interface UpdateSequenceRequest {
291
+ newCurrentValue: number;
292
+ }
293
+ export interface LoginRequest {
294
+ username: string;
295
+ password?: string;
296
+ rememberMe?: boolean;
297
+ }
298
+ export interface ForgotPasswordRequest {
299
+ email: string;
300
+ }
301
+ export interface ConfirmEmailRequest {
302
+ email: string;
303
+ token: string;
304
+ }
305
+ export interface ResetPasswordRequest {
306
+ token: string;
307
+ newPassword: string;
308
+ }
309
+ export interface RegisterRequest {
310
+ companyName: string;
311
+ taxId: string;
312
+ email: string;
313
+ password: string;
314
+ tier?: number;
315
+ sellerCode?: string;
316
+ }
317
+ export interface PartnerRegisterRequest {
318
+ code: string;
319
+ phoneNumber?: string;
320
+ website?: string;
321
+ bankName?: string;
322
+ bankAccount?: string;
323
+ taxId?: string;
324
+ }
325
+ export interface IssueLicenseRequest {
326
+ type: LicenseType;
327
+ platform: LicensePlatform | string | number;
328
+ deviceName?: string;
329
+ sourceAddonId?: string;
330
+ }
331
+ export interface LeadRegisterRequest {
332
+ name: string;
333
+ email: string;
334
+ phone?: string;
335
+ message?: string;
336
+ source?: string;
337
+ }
338
+ export interface TenantRoleRequest {
339
+ name: string;
340
+ description: string;
341
+ permissions: string[];
342
+ }
343
+ export interface MensajeEndosoRequest {
344
+ clave: string;
345
+ numeroCedulaEmisor: string;
346
+ fechaEmisionDoc: string;
347
+ detalleMensaje: string;
348
+ montoTotalImpuesto: number;
349
+ totalFactura: number;
350
+ numeroCedulaReceptor: string;
351
+ numeroConsecutivoReceptor: string;
352
+ mensaje: number;
353
+ nombreReceptor?: string;
354
+ tipoIdentificacionReceptor?: string;
355
+ }
356
+ export interface CreateSettlementRequest {
357
+ commissionIds: string[];
358
+ }
359
+ export interface RegisterSettlementPaymentRequest {
360
+ paymentReference: string;
361
+ paymentDate: string;
362
+ }
363
+ export interface ValidateLicenseRequest {
364
+ licenseKey: string;
365
+ machineId: string;
366
+ appVersion?: string;
367
+ type?: number | string;
368
+ platform?: number | string;
369
+ appIdentifier?: string;
370
+ }
371
+ export interface ActivateLicenseRequest {
372
+ licenseKey: string;
373
+ machineId: string;
374
+ deviceName?: string;
375
+ type?: number | string;
376
+ platform?: number | string;
377
+ appIdentifier?: string;
378
+ }
379
+ export interface PurchaseAddonRequest {
380
+ packageId: string;
381
+ }
382
+ export interface ReportAddonPurchaseRequest {
383
+ packageId: string;
384
+ reference: string;
385
+ paymentMethod: string;
386
+ amount: number;
387
+ }
388
+ export interface ApproveAddonRequest {
389
+ adminNote?: string;
390
+ }
391
+ export interface RejectAddonRequest {
392
+ reason: string;
393
+ }
394
+ export interface CreateLicensePackageRequest {
395
+ name: string;
396
+ description: string;
397
+ type: string | number;
398
+ allowedPlatforms: (string | number)[];
399
+ quantity: number;
400
+ monthlyPrice: number;
401
+ currency?: string;
402
+ isActive?: boolean;
403
+ displayOrder?: number;
404
+ defaultModules?: string | null;
405
+ iconUrl?: string | null;
406
+ appIdentifier?: string | null;
407
+ }
408
+ export interface UpdateLicensePackageRequest {
409
+ name?: string;
410
+ description?: string;
411
+ type?: string | number;
412
+ allowedPlatforms?: (string | number)[];
413
+ quantity?: number;
414
+ monthlyPrice?: number;
415
+ currency?: string;
416
+ isActive?: boolean;
417
+ displayOrder?: number;
418
+ defaultModules?: string | null;
419
+ iconUrl?: string | null;
420
+ appIdentifier?: string | null;
421
+ }
422
+ export interface RegisterAppRequest {
423
+ appName: string;
424
+ appSlug: string;
425
+ description?: string;
426
+ websiteUrl?: string | null;
427
+ requiredType: string | number;
428
+ requiredPlatform: string | number;
429
+ }
430
+ export interface CreateOrderRequest {
431
+ items: CartItemDto[];
432
+ sellerCode?: string;
433
+ }
434
+ export interface CartItemDto {
435
+ type: number;
436
+ id?: string;
437
+ quantity: number;
438
+ }
439
+ export interface ReportOrderPaymentRequest {
440
+ orderId: string;
441
+ referenceNumber: string;
442
+ paymentMethod: number;
443
+ }
444
+ export interface InviteUserRequest {
445
+ email: string;
446
+ role: number;
447
+ customRoleId?: string | null;
448
+ branchId?: string | null;
449
+ }
450
+ export interface UpdateUserRoleRequest {
451
+ role: number;
452
+ customRoleId?: string | null;
453
+ }
454
+ export interface AcceptInviteRequest {
455
+ token: string;
456
+ password?: string;
457
+ fullName?: string;
458
+ }
459
+ export interface AdminRegisterRequest {
460
+ email: string;
461
+ password?: string;
462
+ fullName: string;
463
+ role: string;
464
+ }
465
+ export interface AdminUpdateRequest {
466
+ email?: string;
467
+ fullName?: string;
468
+ role?: string;
469
+ isActive?: boolean;
470
+ }
471
+ export interface ApprovalRejectRequest {
472
+ reason: string;
473
+ }
474
+ export interface SettlementPayRequest {
475
+ paymentReference: string;
476
+ paymentDate: string;
477
+ }
478
+ export interface CreatePlatformModuleRequest {
479
+ code: string;
480
+ name: string;
481
+ description: string;
482
+ type: number;
483
+ icon?: string;
484
+ isActive: boolean;
485
+ appIdentifier?: string;
486
+ }
487
+ export interface UpdatePlatformModuleRequest {
488
+ name?: string;
489
+ description?: string;
490
+ type?: number;
491
+ icon?: string;
492
+ isActive?: boolean;
493
+ appIdentifier?: string;
494
+ }
495
+ export interface CreateDeveloperModuleRequest {
496
+ code: string;
497
+ name: string;
498
+ description: string;
499
+ type: number;
500
+ isActive: boolean;
501
+ appIdentifier?: string | null;
502
+ }
503
+ export interface UpdateDeveloperModuleRequest {
504
+ name?: string;
505
+ description?: string;
506
+ type?: number;
507
+ isActive?: boolean;
508
+ appIdentifier?: string | null;
509
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });