apacuana-sdk-core 0.3.0 → 0.5.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.
Files changed (42) hide show
  1. package/coverage/clover.xml +82 -82
  2. package/coverage/coverage-final.json +3 -3
  3. package/coverage/lcov-report/block-navigation.js +1 -1
  4. package/coverage/lcov-report/index.html +1 -1
  5. package/coverage/lcov-report/sorter.js +21 -7
  6. package/coverage/lcov-report/src/api/certs.js.html +2 -2
  7. package/coverage/lcov-report/src/api/index.html +1 -1
  8. package/coverage/lcov-report/src/api/revocations.js.html +12 -15
  9. package/coverage/lcov-report/src/api/signatures.js.html +320 -140
  10. package/coverage/lcov-report/src/api/users.js.html +1 -1
  11. package/coverage/lcov-report/src/config/index.html +1 -1
  12. package/coverage/lcov-report/src/config/index.js.html +1 -1
  13. package/coverage/lcov-report/src/errors/index.html +1 -1
  14. package/coverage/lcov-report/src/errors/index.js.html +1 -1
  15. package/coverage/lcov-report/src/index.html +1 -1
  16. package/coverage/lcov-report/src/index.js.html +6 -3
  17. package/coverage/lcov-report/src/utils/constant.js.html +1 -1
  18. package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
  19. package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
  20. package/coverage/lcov-report/src/utils/index.html +1 -1
  21. package/coverage/lcov.info +137 -137
  22. package/dist/api/certs.d.ts +8 -0
  23. package/dist/api/revocations.d.ts +7 -0
  24. package/dist/api/signatures.d.ts +107 -0
  25. package/dist/api/users.d.ts +15 -0
  26. package/dist/config/index.d.ts +11 -0
  27. package/dist/errors/index.d.ts +10 -0
  28. package/dist/index.d.ts +25 -0
  29. package/dist/index.js +204 -97
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +204 -97
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/utils/constant.d.ts +18 -0
  34. package/dist/utils/helpers.d.ts +21 -0
  35. package/dist/utils/httpClient.d.ts +3 -0
  36. package/package.json +9 -4
  37. package/src/api/certs.js +1 -1
  38. package/src/api/revocations.js +10 -11
  39. package/src/api/signatures.js +156 -96
  40. package/src/index.js +2 -1
  41. package/tests/api/signatures.test.js +11 -4
  42. package/tsconfig.json +15 -0
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2025-08-22T21:07:16.060Z
104
+ at 2025-08-25T18:24:18.701Z
105
105
  </div>
106
106
  <script src="../../prettify.js"></script>
107
107
  <script>
@@ -193,7 +193,7 @@ export const getConfig = <span class="fstat-no" title="function not covered" >()
193
193
  <div class='footer quiet pad2 space-top1 center small'>
194
194
  Code coverage generated by
195
195
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
196
- at 2025-08-22T21:07:16.060Z
196
+ at 2025-08-25T18:24:18.701Z
197
197
  </div>
198
198
  <script src="../../prettify.js"></script>
199
199
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2025-08-22T21:07:16.060Z
104
+ at 2025-08-25T18:24:18.701Z
105
105
  </div>
106
106
  <script src="../../prettify.js"></script>
107
107
  <script>
@@ -133,7 +133,7 @@ export default ApacuanaAPIError;
133
133
  <div class='footer quiet pad2 space-top1 center small'>
134
134
  Code coverage generated by
135
135
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
136
- at 2025-08-22T21:07:16.060Z
136
+ at 2025-08-25T18:24:18.701Z
137
137
  </div>
138
138
  <script src="../../prettify.js"></script>
139
139
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2025-08-22T21:07:16.060Z
104
+ at 2025-08-25T18:24:18.701Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -133,7 +133,8 @@
133
133
  <a name='L68'></a><a href='#L68'>68</a>
134
134
  <a name='L69'></a><a href='#L69'>69</a>
135
135
  <a name='L70'></a><a href='#L70'>70</a>
136
- <a name='L71'></a><a href='#L71'>71</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
136
+ <a name='L71'></a><a href='#L71'>71</a>
137
+ <a name='L72'></a><a href='#L72'>72</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
137
138
  <span class="cline-any cline-neutral">&nbsp;</span>
138
139
  <span class="cline-any cline-neutral">&nbsp;</span>
139
140
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -203,11 +204,12 @@
203
204
  <span class="cline-any cline-neutral">&nbsp;</span>
204
205
  <span class="cline-any cline-neutral">&nbsp;</span>
205
206
  <span class="cline-any cline-neutral">&nbsp;</span>
207
+ <span class="cline-any cline-neutral">&nbsp;</span>
206
208
  <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { setConfig, getConfig } from "./config/index";
207
209
  import { initHttpClient, setAuthToken } from "./utils/httpClient";
208
210
  import getCustomer from "./api/users";
209
211
  import requestRevocation from "./api/revocations";
210
- import { getCertStatus } from "./api/certs";
212
+ import { generateCert, getCertStatus } from "./api/certs";
211
213
  import { addSigner, getDocs } from "./api/signatures";
212
214
  &nbsp;
213
215
  const apacuana = {
@@ -270,6 +272,7 @@ const apacuana = {
270
272
  getCustomer,
271
273
  addSigner,
272
274
  getDocs,
275
+ generateCert,
273
276
  };
274
277
  &nbsp;
275
278
  export default apacuana;
@@ -280,7 +283,7 @@ export default apacuana;
280
283
  <div class='footer quiet pad2 space-top1 center small'>
281
284
  Code coverage generated by
282
285
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
283
- at 2025-08-22T21:07:16.060Z
286
+ at 2025-08-25T18:24:18.701Z
284
287
  </div>
285
288
  <script src="../prettify.js"></script>
286
289
  <script>
@@ -130,7 +130,7 @@ export const INTEGRATION_TYPE = {
130
130
  <div class='footer quiet pad2 space-top1 center small'>
131
131
  Code coverage generated by
132
132
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
133
- at 2025-08-22T21:07:16.060Z
133
+ at 2025-08-25T18:24:18.701Z
134
134
  </div>
135
135
  <script src="../../prettify.js"></script>
136
136
  <script>
@@ -742,7 +742,7 @@ export default {
742
742
  <div class='footer quiet pad2 space-top1 center small'>
743
743
  Code coverage generated by
744
744
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
745
- at 2025-08-22T21:07:16.060Z
745
+ at 2025-08-25T18:24:18.701Z
746
746
  </div>
747
747
  <script src="../../prettify.js"></script>
748
748
  <script>
@@ -631,7 +631,7 @@ export const httpRequest = <span class="fstat-no" title="function not covered" >
631
631
  <div class='footer quiet pad2 space-top1 center small'>
632
632
  Code coverage generated by
633
633
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
634
- at 2025-08-22T21:07:16.060Z
634
+ at 2025-08-25T18:24:18.701Z
635
635
  </div>
636
636
  <script src="../../prettify.js"></script>
637
637
  <script>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2025-08-22T21:07:16.060Z
134
+ at 2025-08-25T18:24:18.701Z
135
135
  </div>
136
136
  <script src="../../prettify.js"></script>
137
137
  <script>
@@ -81,174 +81,174 @@ BRH:8
81
81
  end_of_record
82
82
  TN:
83
83
  SF:src/api/revocations.js
84
- FN:10,(anonymous_0)
84
+ FN:9,(anonymous_0)
85
85
  FNF:1
86
86
  FNH:0
87
87
  FNDA:0,(anonymous_0)
88
- DA:10,1
88
+ DA:9,1
89
+ DA:10,0
89
90
  DA:11,0
90
- DA:12,0
91
+ DA:15,0
91
92
  DA:16,0
92
- DA:17,0
93
+ DA:21,0
93
94
  DA:22,0
94
- DA:23,0
95
+ DA:27,0
95
96
  DA:28,0
96
97
  DA:29,0
97
- DA:30,0
98
- DA:34,0
99
- DA:39,0
98
+ DA:33,0
99
+ DA:38,0
100
100
  LF:12
101
101
  LH:1
102
- BRDA:16,0,0,0
103
- BRDA:16,0,1,0
104
- BRDA:29,1,0,0
105
- BRDA:29,1,1,0
106
- BRDA:31,2,0,0
107
- BRDA:31,2,1,0
108
- BRDA:35,3,0,0
109
- BRDA:35,3,1,0
102
+ BRDA:15,0,0,0
103
+ BRDA:15,0,1,0
104
+ BRDA:28,1,0,0
105
+ BRDA:28,1,1,0
106
+ BRDA:30,2,0,0
107
+ BRDA:30,2,1,0
108
+ BRDA:34,3,0,0
109
+ BRDA:34,3,1,0
110
110
  BRF:8
111
111
  BRH:0
112
112
  end_of_record
113
113
  TN:
114
114
  SF:src/api/signatures.js
115
- FN:8,(anonymous_0)
116
- FN:16,(anonymous_1)
117
- FN:30,(anonymous_2)
118
- FN:48,(anonymous_3)
119
- FN:77,(anonymous_4)
120
- FN:91,(anonymous_5)
121
- FN:111,(anonymous_6)
122
- FN:127,(anonymous_7)
123
- FN:141,(anonymous_8)
124
- FN:171,(anonymous_9)
125
- FN:179,(anonymous_10)
126
- FN:223,(anonymous_11)
115
+ FN:68,(anonymous_0)
116
+ FN:76,(anonymous_1)
117
+ FN:84,(anonymous_2)
118
+ FN:113,(anonymous_3)
119
+ FN:121,(anonymous_4)
120
+ FN:134,(anonymous_5)
121
+ FN:142,(anonymous_6)
122
+ FN:150,(anonymous_7)
123
+ FN:198,(anonymous_8)
124
+ FN:222,(anonymous_9)
125
+ FN:248,(anonymous_10)
126
+ FN:283,(anonymous_11)
127
127
  FNF:12
128
128
  FNH:6
129
129
  FNDA:0,(anonymous_0)
130
130
  FNDA:0,(anonymous_1)
131
131
  FNDA:0,(anonymous_2)
132
132
  FNDA:0,(anonymous_3)
133
- FNDA:0,(anonymous_4)
134
- FNDA:0,(anonymous_5)
133
+ FNDA:1,(anonymous_4)
134
+ FNDA:1,(anonymous_5)
135
135
  FNDA:1,(anonymous_6)
136
- FNDA:1,(anonymous_7)
137
- FNDA:4,(anonymous_8)
138
- FNDA:1,(anonymous_9)
139
- FNDA:2,(anonymous_10)
136
+ FNDA:2,(anonymous_7)
137
+ FNDA:0,(anonymous_8)
138
+ FNDA:0,(anonymous_9)
139
+ FNDA:4,(anonymous_10)
140
140
  FNDA:5,(anonymous_11)
141
- DA:8,2
142
- DA:9,0
143
- DA:16,2
144
- DA:17,0
145
- DA:30,2
146
- DA:31,0
147
- DA:33,0
148
- DA:34,0
149
- DA:37,0
150
- DA:38,0
151
- DA:41,0
152
- DA:48,2
153
- DA:49,0
154
- DA:50,0
155
- DA:57,0
156
- DA:58,0
157
- DA:59,0
158
- DA:66,0
159
- DA:68,0
141
+ DA:68,2
160
142
  DA:69,0
161
- DA:71,0
162
- DA:77,2
163
- DA:78,0
164
- DA:91,2
165
- DA:92,0
143
+ DA:76,2
144
+ DA:77,0
145
+ DA:84,2
146
+ DA:85,0
147
+ DA:86,0
148
+ DA:93,0
166
149
  DA:94,0
167
- DA:96,0
168
- DA:97,0
169
- DA:100,0
170
- DA:101,0
150
+ DA:95,0
151
+ DA:102,0
171
152
  DA:104,0
172
- DA:111,2
173
- DA:112,1
174
- DA:113,1
175
- DA:115,1
176
- DA:116,1
177
- DA:118,0
178
- DA:119,0
179
- DA:121,0
180
- DA:127,2
181
- DA:128,1
182
- DA:141,2
183
- DA:142,4
184
- DA:147,1
185
- DA:154,3
186
- DA:156,3
187
- DA:157,1
188
- DA:160,2
153
+ DA:105,0
154
+ DA:107,0
155
+ DA:113,2
156
+ DA:114,0
157
+ DA:121,2
158
+ DA:122,1
159
+ DA:123,1
160
+ DA:124,1
161
+ DA:125,1
162
+ DA:127,0
163
+ DA:128,0
164
+ DA:130,0
165
+ DA:134,2
166
+ DA:135,1
167
+ DA:142,2
168
+ DA:143,1
169
+ DA:150,2
170
+ DA:151,2
171
+ DA:152,2
172
+ DA:153,1
173
+ DA:160,1
189
174
  DA:161,1
190
- DA:164,1
191
- DA:171,2
175
+ DA:167,1
176
+ DA:168,1
177
+ DA:171,1
192
178
  DA:172,1
193
- DA:179,2
194
- DA:180,2
195
- DA:181,2
196
- DA:182,1
197
- DA:189,1
198
- DA:190,1
199
- DA:196,1
200
- DA:197,1
201
- DA:200,1
202
- DA:201,1
203
- DA:202,1
204
- DA:208,0
179
+ DA:173,1
180
+ DA:179,0
181
+ DA:180,0
182
+ DA:182,0
183
+ DA:198,2
184
+ DA:199,0
185
+ DA:201,0
186
+ DA:202,0
187
+ DA:205,0
188
+ DA:206,0
205
189
  DA:209,0
206
- DA:211,0
207
- DA:223,2
208
- DA:224,5
209
- DA:226,3
210
- DA:228,3
211
- DA:229,2
212
- DA:232,1
213
- DA:233,1
214
- DA:236,0
190
+ DA:222,2
191
+ DA:223,0
192
+ DA:225,0
193
+ DA:227,0
194
+ DA:228,0
195
+ DA:231,0
196
+ DA:232,0
197
+ DA:235,0
198
+ DA:248,2
199
+ DA:249,4
200
+ DA:254,1
201
+ DA:260,3
202
+ DA:262,3
203
+ DA:263,1
204
+ DA:266,2
205
+ DA:267,1
206
+ DA:270,1
207
+ DA:283,2
208
+ DA:284,5
209
+ DA:286,3
210
+ DA:288,3
211
+ DA:289,2
212
+ DA:292,1
213
+ DA:293,1
214
+ DA:296,0
215
215
  LF:74
216
216
  LH:42
217
- BRDA:33,0,0,0
218
- BRDA:33,0,1,0
219
- BRDA:37,1,0,0
220
- BRDA:37,1,1,0
221
- BRDA:57,2,0,0
222
- BRDA:57,2,1,0
223
- BRDA:58,3,0,0
224
- BRDA:58,3,1,0
225
- BRDA:68,4,0,0
226
- BRDA:68,4,1,0
227
- BRDA:96,5,0,0
228
- BRDA:96,5,1,0
229
- BRDA:100,6,0,0
230
- BRDA:100,6,1,0
231
- BRDA:118,7,0,0
232
- BRDA:118,7,1,0
233
- BRDA:142,8,0,1
234
- BRDA:142,8,1,3
235
- BRDA:143,9,0,4
236
- BRDA:143,9,1,3
237
- BRDA:143,9,2,3
238
- BRDA:156,10,0,1
239
- BRDA:156,10,1,2
240
- BRDA:160,11,0,1
241
- BRDA:160,11,1,1
242
- BRDA:181,12,0,1
243
- BRDA:181,12,1,1
244
- BRDA:196,13,0,1
245
- BRDA:196,13,1,0
246
- BRDA:208,14,0,0
247
- BRDA:208,14,1,0
248
- BRDA:228,15,0,2
249
- BRDA:228,15,1,1
250
- BRDA:232,16,0,1
251
- BRDA:232,16,1,0
217
+ BRDA:93,0,0,0
218
+ BRDA:93,0,1,0
219
+ BRDA:94,1,0,0
220
+ BRDA:94,1,1,0
221
+ BRDA:104,2,0,0
222
+ BRDA:104,2,1,0
223
+ BRDA:127,3,0,0
224
+ BRDA:127,3,1,0
225
+ BRDA:152,4,0,1
226
+ BRDA:152,4,1,1
227
+ BRDA:167,5,0,1
228
+ BRDA:167,5,1,0
229
+ BRDA:179,6,0,0
230
+ BRDA:179,6,1,0
231
+ BRDA:201,7,0,0
232
+ BRDA:201,7,1,0
233
+ BRDA:205,8,0,0
234
+ BRDA:205,8,1,0
235
+ BRDA:227,9,0,0
236
+ BRDA:227,9,1,0
237
+ BRDA:231,10,0,0
238
+ BRDA:231,10,1,0
239
+ BRDA:249,11,0,1
240
+ BRDA:249,11,1,3
241
+ BRDA:250,12,0,4
242
+ BRDA:250,12,1,3
243
+ BRDA:250,12,2,3
244
+ BRDA:262,13,0,1
245
+ BRDA:262,13,1,2
246
+ BRDA:266,14,0,1
247
+ BRDA:266,14,1,1
248
+ BRDA:288,15,0,2
249
+ BRDA:288,15,1,1
250
+ BRDA:292,16,0,1
251
+ BRDA:292,16,1,0
252
252
  BRF:35
253
253
  BRH:15
254
254
  end_of_record
@@ -0,0 +1,8 @@
1
+ export function generateCert(csr?: string): Promise<{
2
+ cert: string;
3
+ success: boolean;
4
+ }>;
5
+ export function getCertStatus(isCertificateInDevice?: boolean): {
6
+ status: string;
7
+ success: boolean;
8
+ };
@@ -0,0 +1,7 @@
1
+ export default requestRevocation;
2
+ /**
3
+ * Simula la solicitud de revocación de un certificado.
4
+ * @param {string} reasonCode - Código o descripción del motivo de la revocación.
5
+ * @returns {Promise<object>} Objeto con el estado de la solicitud de revocación.
6
+ */
7
+ declare function requestRevocation(reasonCode: string): Promise<object>;
@@ -0,0 +1,107 @@
1
+ export function signDocument(): Promise<object>;
2
+ export function getDigest(signData: GetDigestData): Promise<GetDigestResponse>;
3
+ export function addSigner(signerData: SignerData): Promise<AddSignerResponse>;
4
+ export function getDocs(data: GetDocsParams): Promise<GetDocsResponse>;
5
+ /**
6
+ * Define la estructura de un objeto Firmante.
7
+ */
8
+ export type Signer = {
9
+ /**
10
+ * - Nombre completo del firmante.
11
+ */
12
+ name: string;
13
+ /**
14
+ * - Correo electrónico del firmante.
15
+ */
16
+ email: string;
17
+ /**
18
+ * - Documento de identidad del firmante.
19
+ */
20
+ document: string;
21
+ };
22
+ /**
23
+ * Define la estructura de datos para añadir un firmante.
24
+ */
25
+ export type SignerData = {
26
+ /**
27
+ * - Identificador único del documento.
28
+ */
29
+ docId: string;
30
+ /**
31
+ * - Objeto con la información del firmante.
32
+ */
33
+ signer: Signer;
34
+ };
35
+ /**
36
+ * Define la estructura de la respuesta al añadir un firmante.
37
+ */
38
+ export type AddSignerResponse = {
39
+ /**
40
+ * - Identificador de confirmación del firmante añadido.
41
+ */
42
+ signer: string;
43
+ /**
44
+ * - Indica si la operación fue exitosa.
45
+ */
46
+ success: boolean;
47
+ };
48
+ /**
49
+ * Define la estructura de datos para obtener el digest de un documento.
50
+ */
51
+ export type GetDigestData = {
52
+ /**
53
+ * - Certificado del firmante en formato base64.
54
+ */
55
+ cert: string;
56
+ /**
57
+ * - Identificador único del proceso de firma.
58
+ */
59
+ signatureId: string;
60
+ };
61
+ /**
62
+ * Define la estructura de la respuesta al obtener el digest.
63
+ */
64
+ export type GetDigestResponse = {
65
+ /**
66
+ * - El digest del documento que se va a firmar.
67
+ */
68
+ digest: string;
69
+ /**
70
+ * - Indica si la operación fue exitosa.
71
+ */
72
+ success: boolean;
73
+ };
74
+ /**
75
+ * Define la estructura de los parámetros para obtener documentos.
76
+ */
77
+ export type GetDocsParams = {
78
+ /**
79
+ * - Número de página para la paginación.
80
+ */
81
+ page: number;
82
+ /**
83
+ * - Cantidad de registros por página.
84
+ */
85
+ size: number;
86
+ /**
87
+ * - (Opcional) Estado para filtrar los documentos.
88
+ */
89
+ status?: string | undefined;
90
+ };
91
+ /**
92
+ * Define la estructura de la respuesta al obtener documentos.
93
+ */
94
+ export type GetDocsResponse = {
95
+ /**
96
+ * - El número total de registros encontrados.
97
+ */
98
+ totalRecords: number;
99
+ /**
100
+ * - Un arreglo con los registros de los documentos.
101
+ */
102
+ records: Array<object>;
103
+ /**
104
+ * - Indica si la operación fue exitosa.
105
+ */
106
+ success: boolean;
107
+ };
@@ -0,0 +1,15 @@
1
+ export default getCustomer;
2
+ /**
3
+ * Obtiene el token de un usuario a través de una petición POST.
4
+ * Este método es útil para endpoints que requieren datos en el cuerpo de la petición
5
+ * para buscar un usuario, como un ID de sesión o un token de acceso.
6
+ *
7
+ * @returns {Promise<{token: string, userData: object, success: boolean}>} Objeto con el token de sesión, los datos del usuario y un indicador de éxito.
8
+ * @throws {Error} Si los parámetros de entrada son inválidos.
9
+ * @throws {ApacuanaAPIError} Si ocurre un error en la API de Apacuana.
10
+ */
11
+ declare function getCustomer(): Promise<{
12
+ token: string;
13
+ userData: object;
14
+ success: boolean;
15
+ }>;
@@ -0,0 +1,11 @@
1
+ export function setConfig(newConfig: any): void;
2
+ export function getConfig(): {
3
+ apiUrl: string;
4
+ secretKey: string;
5
+ apiKey: string;
6
+ verificationId: string;
7
+ customerId: string;
8
+ integrationType: string;
9
+ userData: undefined;
10
+ token: undefined;
11
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Clase de error personalizada para errores de la API de Apacuana.
3
+ */
4
+ export class ApacuanaAPIError extends Error {
5
+ constructor(message: any, statusCode?: number, errorCode?: null);
6
+ statusCode: number;
7
+ errorCode: any;
8
+ success: boolean;
9
+ }
10
+ export default ApacuanaAPIError;
@@ -0,0 +1,25 @@
1
+ export default apacuana;
2
+ declare namespace apacuana {
3
+ export function init(config: {
4
+ apiUrl: string;
5
+ secretKey: string;
6
+ apiKey: string;
7
+ verificationId: string;
8
+ customerId: string;
9
+ integrationType: string;
10
+ }): Promise<object>;
11
+ export { getConfig };
12
+ export { requestRevocation };
13
+ export { getCertStatus };
14
+ export { getCustomer };
15
+ export { addSigner };
16
+ export { getDocs };
17
+ export { generateCert };
18
+ }
19
+ import { getConfig } from "./config/index";
20
+ import requestRevocation from "./api/revocations";
21
+ import { getCertStatus } from "./api/certs";
22
+ import getCustomer from "./api/users";
23
+ import { addSigner } from "./api/signatures";
24
+ import { getDocs } from "./api/signatures";
25
+ import { generateCert } from "./api/certs";