apacuana-sdk-core 0.9.0 → 0.10.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 +65 -0
- package/coverage/clover.xml +59 -24
- package/coverage/coverage-final.json +3 -3
- package/coverage/lcov-report/index.html +18 -18
- package/coverage/lcov-report/src/api/certs.js.html +390 -9
- package/coverage/lcov-report/src/api/index.html +16 -16
- package/coverage/lcov-report/src/api/revocations.js.html +1 -1
- package/coverage/lcov-report/src/api/signatures.js.html +1 -1
- package/coverage/lcov-report/src/api/users.js.html +1 -1
- package/coverage/lcov-report/src/config/index.html +1 -1
- package/coverage/lcov-report/src/config/index.js.html +1 -1
- package/coverage/lcov-report/src/errors/index.html +1 -1
- package/coverage/lcov-report/src/errors/index.js.html +8 -8
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.js.html +24 -3
- package/coverage/lcov-report/src/utils/constant.js.html +1 -1
- package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
- package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov.info +94 -31
- package/dist/api/certs.d.ts +44 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +206 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/certs.js +127 -0
- package/src/index.js +8 -1
- package/tests/api/certs.test.js +113 -1
|
@@ -241,7 +241,7 @@ export const close = <span class="fstat-no" title="function not covered" >()</sp
|
|
|
241
241
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
242
242
|
Code coverage generated by
|
|
243
243
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
244
|
-
at 2025-09-
|
|
244
|
+
at 2025-09-05T15:19:06.305Z
|
|
245
245
|
</div>
|
|
246
246
|
<script src="../../prettify.js"></script>
|
|
247
247
|
<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-09-
|
|
104
|
+
at 2025-09-05T15:19:06.305Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
<span class="cline-any cline-neutral"> </span>
|
|
92
92
|
<span class="cline-any cline-neutral"> </span>
|
|
93
93
|
<span class="cline-any cline-neutral"> </span>
|
|
94
|
-
<span class="cline-any cline-yes">
|
|
95
|
-
<span class="cline-any cline-yes">
|
|
96
|
-
<span class="cline-any cline-yes">
|
|
97
|
-
<span class="cline-any cline-yes">
|
|
98
|
-
<span class="cline-any cline-yes">
|
|
94
|
+
<span class="cline-any cline-yes">61x</span>
|
|
95
|
+
<span class="cline-any cline-yes">61x</span>
|
|
96
|
+
<span class="cline-any cline-yes">61x</span>
|
|
97
|
+
<span class="cline-any cline-yes">61x</span>
|
|
98
|
+
<span class="cline-any cline-yes">61x</span>
|
|
99
99
|
<span class="cline-any cline-neutral"> </span>
|
|
100
100
|
<span class="cline-any cline-neutral"> </span>
|
|
101
|
-
<span class="cline-any cline-yes">
|
|
102
|
-
<span class="cline-any cline-yes">
|
|
101
|
+
<span class="cline-any cline-yes">61x</span>
|
|
102
|
+
<span class="cline-any cline-yes">61x</span>
|
|
103
103
|
<span class="cline-any cline-neutral"> </span>
|
|
104
104
|
<span class="cline-any cline-neutral"> </span>
|
|
105
105
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -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-09-
|
|
136
|
+
at 2025-09-05T15:19:06.305Z
|
|
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-09-
|
|
104
|
+
at 2025-09-05T15:19:06.305Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -129,7 +129,19 @@
|
|
|
129
129
|
<a name='L64'></a><a href='#L64'>64</a>
|
|
130
130
|
<a name='L65'></a><a href='#L65'>65</a>
|
|
131
131
|
<a name='L66'></a><a href='#L66'>66</a>
|
|
132
|
-
<a name='L67'></a><a href='#L67'>67</a
|
|
132
|
+
<a name='L67'></a><a href='#L67'>67</a>
|
|
133
|
+
<a name='L68'></a><a href='#L68'>68</a>
|
|
134
|
+
<a name='L69'></a><a href='#L69'>69</a>
|
|
135
|
+
<a name='L70'></a><a href='#L70'>70</a>
|
|
136
|
+
<a name='L71'></a><a href='#L71'>71</a>
|
|
137
|
+
<a name='L72'></a><a href='#L72'>72</a>
|
|
138
|
+
<a name='L73'></a><a href='#L73'>73</a>
|
|
139
|
+
<a name='L74'></a><a href='#L74'>74</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
140
|
+
<span class="cline-any cline-neutral"> </span>
|
|
141
|
+
<span class="cline-any cline-neutral"> </span>
|
|
142
|
+
<span class="cline-any cline-neutral"> </span>
|
|
143
|
+
<span class="cline-any cline-neutral"> </span>
|
|
144
|
+
<span class="cline-any cline-neutral"> </span>
|
|
133
145
|
<span class="cline-any cline-neutral"> </span>
|
|
134
146
|
<span class="cline-any cline-neutral"> </span>
|
|
135
147
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -195,11 +207,18 @@
|
|
|
195
207
|
<span class="cline-any cline-neutral"> </span>
|
|
196
208
|
<span class="cline-any cline-neutral"> </span>
|
|
197
209
|
<span class="cline-any cline-neutral"> </span>
|
|
210
|
+
<span class="cline-any cline-neutral"> </span>
|
|
211
|
+
<span class="cline-any cline-neutral"> </span>
|
|
198
212
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { setConfig, getConfig, close } from "./config/index";
|
|
199
213
|
import { initHttpClient, setAuthToken } from "./utils/httpClient";
|
|
200
214
|
import getCustomer from "./api/users";
|
|
201
215
|
import { requestRevocation, getRevocationReasons } from "./api/revocations";
|
|
202
|
-
import {
|
|
216
|
+
import {
|
|
217
|
+
generateCert,
|
|
218
|
+
getCertStatus,
|
|
219
|
+
getCertTypes,
|
|
220
|
+
getRequerimentsByTypeUser,
|
|
221
|
+
} from "./api/certs";
|
|
203
222
|
import {
|
|
204
223
|
addSigner,
|
|
205
224
|
deleteSignatureVariant,
|
|
@@ -258,6 +277,8 @@ const apacuana = {
|
|
|
258
277
|
uploadSignatureVariant,
|
|
259
278
|
getSignatureVariant,
|
|
260
279
|
deleteSignatureVariant,
|
|
280
|
+
getCertTypes,
|
|
281
|
+
getRequerimentsByTypeUser,
|
|
261
282
|
};
|
|
262
283
|
|
|
263
284
|
export default apacuana;
|
|
@@ -268,7 +289,7 @@ export default apacuana;
|
|
|
268
289
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
269
290
|
Code coverage generated by
|
|
270
291
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
271
|
-
at 2025-09-
|
|
292
|
+
at 2025-09-05T15:19:06.305Z
|
|
272
293
|
</div>
|
|
273
294
|
<script src="../prettify.js"></script>
|
|
274
295
|
<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-09-
|
|
133
|
+
at 2025-09-05T15:19:06.305Z
|
|
134
134
|
</div>
|
|
135
135
|
<script src="../../prettify.js"></script>
|
|
136
136
|
<script>
|
|
@@ -844,7 +844,7 @@ export default {
|
|
|
844
844
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
845
845
|
Code coverage generated by
|
|
846
846
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
847
|
-
at 2025-09-
|
|
847
|
+
at 2025-09-05T15:19:06.305Z
|
|
848
848
|
</div>
|
|
849
849
|
<script src="../../prettify.js"></script>
|
|
850
850
|
<script>
|
|
@@ -595,7 +595,7 @@ export const httpRequest = <span class="fstat-no" title="function not covered" >
|
|
|
595
595
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
596
596
|
Code coverage generated by
|
|
597
597
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
598
|
-
at 2025-09-
|
|
598
|
+
at 2025-09-05T15:19:06.305Z
|
|
599
599
|
</div>
|
|
600
600
|
<script src="../../prettify.js"></script>
|
|
601
601
|
<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-09-
|
|
134
|
+
at 2025-09-05T15:19:06.305Z
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../../prettify.js"></script>
|
|
137
137
|
<script>
|
package/coverage/lcov.info
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
TN:
|
|
2
2
|
SF:src/index.js
|
|
3
|
-
FN:
|
|
4
|
-
FN:
|
|
3
|
+
FN:34,(anonymous_0)
|
|
4
|
+
FN:55,(anonymous_1)
|
|
5
5
|
FNF:2
|
|
6
6
|
FNH:1
|
|
7
7
|
FNDA:4,(anonymous_0)
|
|
8
8
|
FNDA:0,(anonymous_1)
|
|
9
|
-
DA:
|
|
10
|
-
DA:
|
|
11
|
-
DA:
|
|
12
|
-
DA:
|
|
13
|
-
DA:
|
|
14
|
-
DA:
|
|
15
|
-
DA:
|
|
16
|
-
DA:
|
|
17
|
-
DA:41,2
|
|
18
|
-
DA:42,2
|
|
19
|
-
DA:43,2
|
|
9
|
+
DA:21,1
|
|
10
|
+
DA:35,4
|
|
11
|
+
DA:36,4
|
|
12
|
+
DA:37,3
|
|
13
|
+
DA:38,3
|
|
14
|
+
DA:39,3
|
|
15
|
+
DA:40,0
|
|
16
|
+
DA:45,3
|
|
20
17
|
DA:46,2
|
|
21
18
|
DA:47,2
|
|
22
|
-
DA:
|
|
19
|
+
DA:48,2
|
|
20
|
+
DA:51,2
|
|
21
|
+
DA:52,2
|
|
22
|
+
DA:55,0
|
|
23
23
|
LF:14
|
|
24
24
|
LH:12
|
|
25
|
-
BRDA:
|
|
26
|
-
BRDA:
|
|
25
|
+
BRDA:39,0,0,0
|
|
26
|
+
BRDA:39,0,1,3
|
|
27
27
|
BRF:2
|
|
28
28
|
BRH:1
|
|
29
29
|
end_of_record
|
|
@@ -33,12 +33,24 @@ FN:28,(anonymous_0)
|
|
|
33
33
|
FN:54,(anonymous_1)
|
|
34
34
|
FN:69,(anonymous_2)
|
|
35
35
|
FN:91,(anonymous_3)
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
FN:115,(anonymous_4)
|
|
37
|
+
FN:132,(anonymous_5)
|
|
38
|
+
FN:146,(anonymous_6)
|
|
39
|
+
FN:174,(anonymous_7)
|
|
40
|
+
FN:191,(anonymous_8)
|
|
41
|
+
FN:207,(anonymous_9)
|
|
42
|
+
FNF:10
|
|
43
|
+
FNH:10
|
|
38
44
|
FNDA:1,(anonymous_0)
|
|
39
45
|
FNDA:1,(anonymous_1)
|
|
40
46
|
FNDA:3,(anonymous_2)
|
|
41
47
|
FNDA:1,(anonymous_3)
|
|
48
|
+
FNDA:1,(anonymous_4)
|
|
49
|
+
FNDA:1,(anonymous_5)
|
|
50
|
+
FNDA:3,(anonymous_6)
|
|
51
|
+
FNDA:1,(anonymous_7)
|
|
52
|
+
FNDA:1,(anonymous_8)
|
|
53
|
+
FNDA:6,(anonymous_9)
|
|
42
54
|
DA:28,2
|
|
43
55
|
DA:29,1
|
|
44
56
|
DA:30,1
|
|
@@ -63,8 +75,43 @@ DA:91,2
|
|
|
63
75
|
DA:92,1
|
|
64
76
|
DA:93,1
|
|
65
77
|
DA:97,1
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
DA:115,2
|
|
79
|
+
DA:116,1
|
|
80
|
+
DA:117,1
|
|
81
|
+
DA:123,1
|
|
82
|
+
DA:125,0
|
|
83
|
+
DA:126,0
|
|
84
|
+
DA:128,0
|
|
85
|
+
DA:132,2
|
|
86
|
+
DA:133,1
|
|
87
|
+
DA:146,2
|
|
88
|
+
DA:147,3
|
|
89
|
+
DA:148,3
|
|
90
|
+
DA:149,1
|
|
91
|
+
DA:151,2
|
|
92
|
+
DA:152,1
|
|
93
|
+
DA:155,1
|
|
94
|
+
DA:174,2
|
|
95
|
+
DA:175,1
|
|
96
|
+
DA:176,1
|
|
97
|
+
DA:182,1
|
|
98
|
+
DA:184,0
|
|
99
|
+
DA:185,0
|
|
100
|
+
DA:187,0
|
|
101
|
+
DA:191,2
|
|
102
|
+
DA:192,1
|
|
103
|
+
DA:207,2
|
|
104
|
+
DA:208,6
|
|
105
|
+
DA:209,3
|
|
106
|
+
DA:213,3
|
|
107
|
+
DA:215,3
|
|
108
|
+
DA:216,3
|
|
109
|
+
DA:217,1
|
|
110
|
+
DA:219,2
|
|
111
|
+
DA:220,1
|
|
112
|
+
DA:223,1
|
|
113
|
+
LF:59
|
|
114
|
+
LH:49
|
|
68
115
|
BRDA:36,0,0,0
|
|
69
116
|
BRDA:36,0,1,1
|
|
70
117
|
BRDA:36,1,0,1
|
|
@@ -76,8 +123,24 @@ BRDA:72,3,1,2
|
|
|
76
123
|
BRDA:75,4,0,1
|
|
77
124
|
BRDA:75,4,1,1
|
|
78
125
|
BRDA:91,5,0,0
|
|
79
|
-
|
|
80
|
-
|
|
126
|
+
BRDA:125,6,0,0
|
|
127
|
+
BRDA:125,6,1,0
|
|
128
|
+
BRDA:148,7,0,1
|
|
129
|
+
BRDA:148,7,1,2
|
|
130
|
+
BRDA:151,8,0,1
|
|
131
|
+
BRDA:151,8,1,1
|
|
132
|
+
BRDA:184,9,0,0
|
|
133
|
+
BRDA:184,9,1,0
|
|
134
|
+
BRDA:208,10,0,3
|
|
135
|
+
BRDA:208,10,1,3
|
|
136
|
+
BRDA:208,11,0,6
|
|
137
|
+
BRDA:208,11,1,5
|
|
138
|
+
BRDA:216,12,0,1
|
|
139
|
+
BRDA:216,12,1,2
|
|
140
|
+
BRDA:219,13,0,1
|
|
141
|
+
BRDA:219,13,1,1
|
|
142
|
+
BRF:27
|
|
143
|
+
BRH:19
|
|
81
144
|
end_of_record
|
|
82
145
|
TN:
|
|
83
146
|
SF:src/api/revocations.js
|
|
@@ -460,19 +523,19 @@ SF:src/errors/index.js
|
|
|
460
523
|
FN:7,(anonymous_0)
|
|
461
524
|
FNF:1
|
|
462
525
|
FNH:1
|
|
463
|
-
FNDA:
|
|
464
|
-
DA:8,
|
|
465
|
-
DA:9,
|
|
466
|
-
DA:10,
|
|
467
|
-
DA:11,
|
|
468
|
-
DA:12,
|
|
469
|
-
DA:15,
|
|
470
|
-
DA:16,
|
|
526
|
+
FNDA:61,(anonymous_0)
|
|
527
|
+
DA:8,61
|
|
528
|
+
DA:9,61
|
|
529
|
+
DA:10,61
|
|
530
|
+
DA:11,61
|
|
531
|
+
DA:12,61
|
|
532
|
+
DA:15,61
|
|
533
|
+
DA:16,61
|
|
471
534
|
LF:7
|
|
472
535
|
LH:7
|
|
473
536
|
BRDA:7,0,0,3
|
|
474
537
|
BRDA:7,1,0,4
|
|
475
|
-
BRDA:15,2,0,
|
|
538
|
+
BRDA:15,2,0,61
|
|
476
539
|
BRDA:15,2,1,0
|
|
477
540
|
BRF:4
|
|
478
541
|
BRH:3
|
package/dist/api/certs.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export function generateCert(encryptedCSR: EncryptedCSRObject): Promise<GenerateCertResponse>;
|
|
2
2
|
export function getCertStatus(isCertificateInDevice?: boolean): GetCertStatusResponse;
|
|
3
|
+
export function getCertTypes(): Promise<GetCertTypesResponse>;
|
|
4
|
+
export function getRequerimentsByTypeUser(params: {
|
|
5
|
+
type: number;
|
|
6
|
+
}): Promise<GetRequirementsResponse>;
|
|
3
7
|
export type GenerateCertResponse = {
|
|
4
8
|
/**
|
|
5
9
|
* - El certificado generado en formato string.
|
|
@@ -30,3 +34,43 @@ export type EncryptedCSRObject = {
|
|
|
30
34
|
*/
|
|
31
35
|
csr: string;
|
|
32
36
|
};
|
|
37
|
+
export type CertType = {
|
|
38
|
+
/**
|
|
39
|
+
* - The ID of the certificate type.
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* - The name of the certificate type.
|
|
44
|
+
*/
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
export type GetCertTypesResponse = {
|
|
48
|
+
/**
|
|
49
|
+
* - A list of available certificate types.
|
|
50
|
+
*/
|
|
51
|
+
types: Array<CertType>;
|
|
52
|
+
/**
|
|
53
|
+
* - Indicates if the operation was successful.
|
|
54
|
+
*/
|
|
55
|
+
success: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type Requirement = {
|
|
58
|
+
/**
|
|
59
|
+
* - The ID of the requirement.
|
|
60
|
+
*/
|
|
61
|
+
id: string;
|
|
62
|
+
/**
|
|
63
|
+
* - The description of the requirement.
|
|
64
|
+
*/
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
export type GetRequirementsResponse = {
|
|
68
|
+
/**
|
|
69
|
+
* - A list of requirements for the user type.
|
|
70
|
+
*/
|
|
71
|
+
requirements: Array<Requirement>;
|
|
72
|
+
/**
|
|
73
|
+
* - Indicates if the operation was successful.
|
|
74
|
+
*/
|
|
75
|
+
success: boolean;
|
|
76
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ declare namespace apacuana {
|
|
|
22
22
|
export { uploadSignatureVariant };
|
|
23
23
|
export { getSignatureVariant };
|
|
24
24
|
export { deleteSignatureVariant };
|
|
25
|
+
export { getCertTypes };
|
|
26
|
+
export { getRequerimentsByTypeUser };
|
|
25
27
|
}
|
|
26
28
|
import { getConfig } from "./config/index";
|
|
27
29
|
import { requestRevocation } from "./api/revocations";
|
|
@@ -36,3 +38,5 @@ import { getRevocationReasons } from "./api/revocations";
|
|
|
36
38
|
import { uploadSignatureVariant } from "./api/signatures";
|
|
37
39
|
import { getSignatureVariant } from "./api/signatures";
|
|
38
40
|
import { deleteSignatureVariant } from "./api/signatures";
|
|
41
|
+
import { getCertTypes } from "./api/certs";
|
|
42
|
+
import { getRequerimentsByTypeUser } from "./api/certs";
|
package/dist/index.js
CHANGED
|
@@ -33085,6 +33085,209 @@ var getCertStatus = function getCertStatus() {
|
|
|
33085
33085
|
};
|
|
33086
33086
|
};
|
|
33087
33087
|
|
|
33088
|
+
/**
|
|
33089
|
+
* @typedef {object} CertType
|
|
33090
|
+
* @property {string} id - The ID of the certificate type.
|
|
33091
|
+
* @property {string} name - The name of the certificate type.
|
|
33092
|
+
*/
|
|
33093
|
+
|
|
33094
|
+
/**
|
|
33095
|
+
* @typedef {object} GetCertTypesResponse
|
|
33096
|
+
* @property {Array<CertType>} types - A list of available certificate types.
|
|
33097
|
+
* @property {boolean} success - Indicates if the operation was successful.
|
|
33098
|
+
*/
|
|
33099
|
+
|
|
33100
|
+
var getCertTypesOnBoarding = /*#__PURE__*/function () {
|
|
33101
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
33102
|
+
var response, _t2;
|
|
33103
|
+
return _regenerator().w(function (_context4) {
|
|
33104
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
33105
|
+
case 0:
|
|
33106
|
+
_context4.p = 0;
|
|
33107
|
+
_context4.n = 1;
|
|
33108
|
+
return httpRequest("services/api/customer/typeusers", {}, "GET");
|
|
33109
|
+
case 1:
|
|
33110
|
+
response = _context4.v;
|
|
33111
|
+
return _context4.a(2, _objectSpread2(_objectSpread2({}, response), {}, {
|
|
33112
|
+
success: true
|
|
33113
|
+
}));
|
|
33114
|
+
case 2:
|
|
33115
|
+
_context4.p = 2;
|
|
33116
|
+
_t2 = _context4.v;
|
|
33117
|
+
if (!(_t2 instanceof ApacuanaAPIError)) {
|
|
33118
|
+
_context4.n = 3;
|
|
33119
|
+
break;
|
|
33120
|
+
}
|
|
33121
|
+
throw _t2;
|
|
33122
|
+
case 3:
|
|
33123
|
+
throw new Error("Failed to get certificate types: ".concat(_t2.message));
|
|
33124
|
+
case 4:
|
|
33125
|
+
return _context4.a(2);
|
|
33126
|
+
}
|
|
33127
|
+
}, _callee4, null, [[0, 2]]);
|
|
33128
|
+
}));
|
|
33129
|
+
return function getCertTypesOnBoarding() {
|
|
33130
|
+
return _ref4.apply(this, arguments);
|
|
33131
|
+
};
|
|
33132
|
+
}();
|
|
33133
|
+
var getCertTypesOnPremise = /*#__PURE__*/function () {
|
|
33134
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
33135
|
+
return _regenerator().w(function (_context5) {
|
|
33136
|
+
while (1) switch (_context5.n) {
|
|
33137
|
+
case 0:
|
|
33138
|
+
throw new ApacuanaAPIError("Getting certificate types is not supported for integration type: ONPREMISE", 501, "NOT_IMPLEMENTED");
|
|
33139
|
+
case 1:
|
|
33140
|
+
return _context5.a(2);
|
|
33141
|
+
}
|
|
33142
|
+
}, _callee5);
|
|
33143
|
+
}));
|
|
33144
|
+
return function getCertTypesOnPremise() {
|
|
33145
|
+
return _ref5.apply(this, arguments);
|
|
33146
|
+
};
|
|
33147
|
+
}();
|
|
33148
|
+
|
|
33149
|
+
/**
|
|
33150
|
+
* Gets the available certificate types.
|
|
33151
|
+
* @returns {Promise<GetCertTypesResponse>} Object with the list of certificate types and a success indicator.
|
|
33152
|
+
* @throws {ApacuanaAPIError} If the API response is invalid or the integration type is not supported.
|
|
33153
|
+
* @throws {Error} If the request fails for another reason.
|
|
33154
|
+
*/
|
|
33155
|
+
var getCertTypes = /*#__PURE__*/function () {
|
|
33156
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
33157
|
+
var _getConfig2, integrationType;
|
|
33158
|
+
return _regenerator().w(function (_context6) {
|
|
33159
|
+
while (1) switch (_context6.n) {
|
|
33160
|
+
case 0:
|
|
33161
|
+
_getConfig2 = getConfig(), integrationType = _getConfig2.integrationType;
|
|
33162
|
+
if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
|
|
33163
|
+
_context6.n = 1;
|
|
33164
|
+
break;
|
|
33165
|
+
}
|
|
33166
|
+
return _context6.a(2, getCertTypesOnBoarding());
|
|
33167
|
+
case 1:
|
|
33168
|
+
if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
|
|
33169
|
+
_context6.n = 2;
|
|
33170
|
+
break;
|
|
33171
|
+
}
|
|
33172
|
+
return _context6.a(2, getCertTypesOnPremise());
|
|
33173
|
+
case 2:
|
|
33174
|
+
throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
|
|
33175
|
+
case 3:
|
|
33176
|
+
return _context6.a(2);
|
|
33177
|
+
}
|
|
33178
|
+
}, _callee6);
|
|
33179
|
+
}));
|
|
33180
|
+
return function getCertTypes() {
|
|
33181
|
+
return _ref6.apply(this, arguments);
|
|
33182
|
+
};
|
|
33183
|
+
}();
|
|
33184
|
+
|
|
33185
|
+
/**
|
|
33186
|
+
* @typedef {object} Requirement
|
|
33187
|
+
* @property {string} id - The ID of the requirement.
|
|
33188
|
+
* @property {string} description - The description of the requirement.
|
|
33189
|
+
*/
|
|
33190
|
+
|
|
33191
|
+
/**
|
|
33192
|
+
* @typedef {object} GetRequirementsResponse
|
|
33193
|
+
* @property {Array<Requirement>} requirements - A list of requirements for the user type.
|
|
33194
|
+
* @property {boolean} success - Indicates if the operation was successful.
|
|
33195
|
+
*/
|
|
33196
|
+
|
|
33197
|
+
var getRequerimentsByTypeUserOnBoarding = /*#__PURE__*/function () {
|
|
33198
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(type) {
|
|
33199
|
+
var response, _t3;
|
|
33200
|
+
return _regenerator().w(function (_context7) {
|
|
33201
|
+
while (1) switch (_context7.p = _context7.n) {
|
|
33202
|
+
case 0:
|
|
33203
|
+
_context7.p = 0;
|
|
33204
|
+
_context7.n = 1;
|
|
33205
|
+
return httpRequest("services/api/customer/documentspref?typeuser=".concat(type), {}, "GET");
|
|
33206
|
+
case 1:
|
|
33207
|
+
response = _context7.v;
|
|
33208
|
+
return _context7.a(2, _objectSpread2(_objectSpread2({}, response), {}, {
|
|
33209
|
+
success: true
|
|
33210
|
+
}));
|
|
33211
|
+
case 2:
|
|
33212
|
+
_context7.p = 2;
|
|
33213
|
+
_t3 = _context7.v;
|
|
33214
|
+
if (!(_t3 instanceof ApacuanaAPIError)) {
|
|
33215
|
+
_context7.n = 3;
|
|
33216
|
+
break;
|
|
33217
|
+
}
|
|
33218
|
+
throw _t3;
|
|
33219
|
+
case 3:
|
|
33220
|
+
throw new Error("Failed to get requirements: ".concat(_t3.message));
|
|
33221
|
+
case 4:
|
|
33222
|
+
return _context7.a(2);
|
|
33223
|
+
}
|
|
33224
|
+
}, _callee7, null, [[0, 2]]);
|
|
33225
|
+
}));
|
|
33226
|
+
return function getRequerimentsByTypeUserOnBoarding(_x3) {
|
|
33227
|
+
return _ref7.apply(this, arguments);
|
|
33228
|
+
};
|
|
33229
|
+
}();
|
|
33230
|
+
var getRequerimentsByTypeUserOnPremise = /*#__PURE__*/function () {
|
|
33231
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
33232
|
+
return _regenerator().w(function (_context8) {
|
|
33233
|
+
while (1) switch (_context8.n) {
|
|
33234
|
+
case 0:
|
|
33235
|
+
throw new ApacuanaAPIError("Getting requirements by user type is not supported for integration type: ONPREMISE", 501, "NOT_IMPLEMENTED");
|
|
33236
|
+
case 1:
|
|
33237
|
+
return _context8.a(2);
|
|
33238
|
+
}
|
|
33239
|
+
}, _callee8);
|
|
33240
|
+
}));
|
|
33241
|
+
return function getRequerimentsByTypeUserOnPremise() {
|
|
33242
|
+
return _ref8.apply(this, arguments);
|
|
33243
|
+
};
|
|
33244
|
+
}();
|
|
33245
|
+
|
|
33246
|
+
/**
|
|
33247
|
+
* Gets the requirements for a given user type.
|
|
33248
|
+
* @param {object} params - The parameters.
|
|
33249
|
+
* @param {number} params.type - The user type to get requirements for.
|
|
33250
|
+
* @returns {Promise<GetRequirementsResponse>} Object with the list of requirements and a success indicator.
|
|
33251
|
+
* @throws {ApacuanaAPIError} If the API response is invalid or the integration type is not supported.
|
|
33252
|
+
* @throws {Error} If the request fails for another reason or the type is invalid.
|
|
33253
|
+
*/
|
|
33254
|
+
var getRequerimentsByTypeUser = /*#__PURE__*/function () {
|
|
33255
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(params) {
|
|
33256
|
+
var type, _getConfig3, integrationType;
|
|
33257
|
+
return _regenerator().w(function (_context9) {
|
|
33258
|
+
while (1) switch (_context9.n) {
|
|
33259
|
+
case 0:
|
|
33260
|
+
if (!(!params || typeof params.type !== "number")) {
|
|
33261
|
+
_context9.n = 1;
|
|
33262
|
+
break;
|
|
33263
|
+
}
|
|
33264
|
+
throw new Error('The "params" object with a numeric "type" property is required.');
|
|
33265
|
+
case 1:
|
|
33266
|
+
type = params.type;
|
|
33267
|
+
_getConfig3 = getConfig(), integrationType = _getConfig3.integrationType;
|
|
33268
|
+
if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
|
|
33269
|
+
_context9.n = 2;
|
|
33270
|
+
break;
|
|
33271
|
+
}
|
|
33272
|
+
return _context9.a(2, getRequerimentsByTypeUserOnBoarding(type));
|
|
33273
|
+
case 2:
|
|
33274
|
+
if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
|
|
33275
|
+
_context9.n = 3;
|
|
33276
|
+
break;
|
|
33277
|
+
}
|
|
33278
|
+
return _context9.a(2, getRequerimentsByTypeUserOnPremise());
|
|
33279
|
+
case 3:
|
|
33280
|
+
throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
|
|
33281
|
+
case 4:
|
|
33282
|
+
return _context9.a(2);
|
|
33283
|
+
}
|
|
33284
|
+
}, _callee9);
|
|
33285
|
+
}));
|
|
33286
|
+
return function getRequerimentsByTypeUser(_x4) {
|
|
33287
|
+
return _ref9.apply(this, arguments);
|
|
33288
|
+
};
|
|
33289
|
+
}();
|
|
33290
|
+
|
|
33088
33291
|
// =================================================================
|
|
33089
33292
|
// Type Definitions
|
|
33090
33293
|
// =================================================================
|
|
@@ -33914,7 +34117,9 @@ var apacuana = {
|
|
|
33914
34117
|
getRevocationReasons: getRevocationReasons,
|
|
33915
34118
|
uploadSignatureVariant: uploadSignatureVariant,
|
|
33916
34119
|
getSignatureVariant: getSignatureVariant,
|
|
33917
|
-
deleteSignatureVariant: deleteSignatureVariant
|
|
34120
|
+
deleteSignatureVariant: deleteSignatureVariant,
|
|
34121
|
+
getCertTypes: getCertTypes,
|
|
34122
|
+
getRequerimentsByTypeUser: getRequerimentsByTypeUser
|
|
33918
34123
|
};
|
|
33919
34124
|
|
|
33920
34125
|
module.exports = apacuana;
|