@easyedu/js-lsm-api 1.48.0 → 1.50.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 (85) hide show
  1. package/.openapi-generator/FILES +22 -0
  2. package/README.md +31 -8
  3. package/dist/apis/CertificateApi.d.ts +237 -0
  4. package/dist/apis/CertificateApi.js +587 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/apis/CertificateApi.d.ts +237 -0
  8. package/dist/esm/apis/CertificateApi.js +583 -0
  9. package/dist/esm/apis/index.d.ts +1 -0
  10. package/dist/esm/apis/index.js +1 -0
  11. package/dist/esm/models/Certificate.d.ts +151 -0
  12. package/dist/esm/models/Certificate.js +114 -0
  13. package/dist/esm/models/CertificateConfig.d.ts +86 -0
  14. package/dist/esm/models/CertificateConfig.js +69 -0
  15. package/dist/esm/models/CertificatePublic.d.ts +98 -0
  16. package/dist/esm/models/CertificatePublic.js +87 -0
  17. package/dist/esm/models/EffectiveCertificateConfig.d.ts +62 -0
  18. package/dist/esm/models/EffectiveCertificateConfig.js +55 -0
  19. package/dist/esm/models/GetCertificateConfigList.d.ts +33 -0
  20. package/dist/esm/models/GetCertificateConfigList.js +44 -0
  21. package/dist/esm/models/GetCertificateList.d.ts +33 -0
  22. package/dist/esm/models/GetCertificateList.js +44 -0
  23. package/dist/esm/models/GetModuleInstructorBasicReportingEngagement.d.ts +24 -0
  24. package/dist/esm/models/GetModuleInstructorBasicReportingEngagement.js +16 -0
  25. package/dist/esm/models/PostCertificate.d.ts +50 -0
  26. package/dist/esm/models/PostCertificate.js +49 -0
  27. package/dist/esm/models/PostCertificateConfig.d.ts +62 -0
  28. package/dist/esm/models/PostCertificateConfig.js +53 -0
  29. package/dist/esm/models/PostRevokeCertificate.d.ts +32 -0
  30. package/dist/esm/models/PostRevokeCertificate.js +41 -0
  31. package/dist/esm/models/PutCertificateConfig.d.ts +56 -0
  32. package/dist/esm/models/PutCertificateConfig.js +49 -0
  33. package/dist/esm/models/index.d.ts +10 -0
  34. package/dist/esm/models/index.js +10 -0
  35. package/dist/models/Certificate.d.ts +151 -0
  36. package/dist/models/Certificate.js +122 -0
  37. package/dist/models/CertificateConfig.d.ts +86 -0
  38. package/dist/models/CertificateConfig.js +76 -0
  39. package/dist/models/CertificatePublic.d.ts +98 -0
  40. package/dist/models/CertificatePublic.js +95 -0
  41. package/dist/models/EffectiveCertificateConfig.d.ts +62 -0
  42. package/dist/models/EffectiveCertificateConfig.js +62 -0
  43. package/dist/models/GetCertificateConfigList.d.ts +33 -0
  44. package/dist/models/GetCertificateConfigList.js +51 -0
  45. package/dist/models/GetCertificateList.d.ts +33 -0
  46. package/dist/models/GetCertificateList.js +51 -0
  47. package/dist/models/GetModuleInstructorBasicReportingEngagement.d.ts +24 -0
  48. package/dist/models/GetModuleInstructorBasicReportingEngagement.js +16 -0
  49. package/dist/models/PostCertificate.d.ts +50 -0
  50. package/dist/models/PostCertificate.js +56 -0
  51. package/dist/models/PostCertificateConfig.d.ts +62 -0
  52. package/dist/models/PostCertificateConfig.js +60 -0
  53. package/dist/models/PostRevokeCertificate.d.ts +32 -0
  54. package/dist/models/PostRevokeCertificate.js +48 -0
  55. package/dist/models/PutCertificateConfig.d.ts +56 -0
  56. package/dist/models/PutCertificateConfig.js +56 -0
  57. package/dist/models/index.d.ts +10 -0
  58. package/dist/models/index.js +10 -0
  59. package/docs/Certificate.md +68 -0
  60. package/docs/CertificateApi.md +903 -0
  61. package/docs/CertificateConfig.md +52 -0
  62. package/docs/CertificatePublic.md +51 -0
  63. package/docs/EffectiveCertificateConfig.md +45 -0
  64. package/docs/GetCertificateConfigList.md +34 -0
  65. package/docs/GetCertificateList.md +34 -0
  66. package/docs/GetModuleInstructorBasicReportingEngagement.md +8 -0
  67. package/docs/PostCertificate.md +41 -0
  68. package/docs/PostCertificateConfig.md +44 -0
  69. package/docs/PostRevokeCertificate.md +34 -0
  70. package/docs/PutCertificateConfig.md +42 -0
  71. package/package.json +1 -1
  72. package/src/apis/CertificateApi.ts +765 -0
  73. package/src/apis/index.ts +1 -0
  74. package/src/models/Certificate.ts +234 -0
  75. package/src/models/CertificateConfig.ts +142 -0
  76. package/src/models/CertificatePublic.ts +158 -0
  77. package/src/models/EffectiveCertificateConfig.ts +107 -0
  78. package/src/models/GetCertificateConfigList.ts +74 -0
  79. package/src/models/GetCertificateList.ts +74 -0
  80. package/src/models/GetModuleInstructorBasicReportingEngagement.ts +36 -0
  81. package/src/models/PostCertificate.ts +90 -0
  82. package/src/models/PostCertificateConfig.ts +106 -0
  83. package/src/models/PostRevokeCertificate.ts +65 -0
  84. package/src/models/PutCertificateConfig.ts +97 -0
  85. package/src/models/index.ts +10 -0
@@ -0,0 +1,587 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * LMS API
6
+ * LMS API
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.GetCertificatesStatusEnum = exports.GetCertificateConfigsScopeEnum = exports.CertificateApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class CertificateApi extends runtime.BaseAPI {
32
+ /**
33
+ * Creates request options for deleteCertificateConfig without sending the request
34
+ */
35
+ deleteCertificateConfigRequestOpts(requestParameters) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['configId'] == null) {
38
+ throw new runtime.RequiredError('configId', 'Required parameter "configId" was null or undefined when calling deleteCertificateConfig().');
39
+ }
40
+ const queryParameters = {};
41
+ const headerParameters = {};
42
+ let urlPath = `/certificate-configs/{configId}`;
43
+ urlPath = urlPath.replace(`{${"configId"}}`, encodeURIComponent(String(requestParameters['configId'])));
44
+ return {
45
+ path: urlPath,
46
+ method: 'DELETE',
47
+ headers: headerParameters,
48
+ query: queryParameters,
49
+ };
50
+ });
51
+ }
52
+ /**
53
+ * Delete a certificate config
54
+ */
55
+ deleteCertificateConfigRaw(requestParameters, initOverrides) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const requestOptions = yield this.deleteCertificateConfigRequestOpts(requestParameters);
58
+ const response = yield this.request(requestOptions, initOverrides);
59
+ return new runtime.VoidApiResponse(response);
60
+ });
61
+ }
62
+ /**
63
+ * Delete a certificate config
64
+ */
65
+ deleteCertificateConfig(requestParameters, initOverrides) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ yield this.deleteCertificateConfigRaw(requestParameters, initOverrides);
68
+ });
69
+ }
70
+ /**
71
+ * Creates request options for getCertificate without sending the request
72
+ */
73
+ getCertificateRequestOpts(requestParameters) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ if (requestParameters['certificateId'] == null) {
76
+ throw new runtime.RequiredError('certificateId', 'Required parameter "certificateId" was null or undefined when calling getCertificate().');
77
+ }
78
+ const queryParameters = {};
79
+ const headerParameters = {};
80
+ let urlPath = `/certificates/{certificateId}`;
81
+ urlPath = urlPath.replace(`{${"certificateId"}}`, encodeURIComponent(String(requestParameters['certificateId'])));
82
+ return {
83
+ path: urlPath,
84
+ method: 'GET',
85
+ headers: headerParameters,
86
+ query: queryParameters,
87
+ };
88
+ });
89
+ }
90
+ /**
91
+ * Get a single certificate
92
+ */
93
+ getCertificateRaw(requestParameters, initOverrides) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ const requestOptions = yield this.getCertificateRequestOpts(requestParameters);
96
+ const response = yield this.request(requestOptions, initOverrides);
97
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificateFromJSON)(jsonValue));
98
+ });
99
+ }
100
+ /**
101
+ * Get a single certificate
102
+ */
103
+ getCertificate(requestParameters, initOverrides) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ const response = yield this.getCertificateRaw(requestParameters, initOverrides);
106
+ return yield response.value();
107
+ });
108
+ }
109
+ /**
110
+ * Creates request options for getCertificateConfig without sending the request
111
+ */
112
+ getCertificateConfigRequestOpts(requestParameters) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ if (requestParameters['configId'] == null) {
115
+ throw new runtime.RequiredError('configId', 'Required parameter "configId" was null or undefined when calling getCertificateConfig().');
116
+ }
117
+ const queryParameters = {};
118
+ const headerParameters = {};
119
+ let urlPath = `/certificate-configs/{configId}`;
120
+ urlPath = urlPath.replace(`{${"configId"}}`, encodeURIComponent(String(requestParameters['configId'])));
121
+ return {
122
+ path: urlPath,
123
+ method: 'GET',
124
+ headers: headerParameters,
125
+ query: queryParameters,
126
+ };
127
+ });
128
+ }
129
+ /**
130
+ * Get a certificate config
131
+ */
132
+ getCertificateConfigRaw(requestParameters, initOverrides) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const requestOptions = yield this.getCertificateConfigRequestOpts(requestParameters);
135
+ const response = yield this.request(requestOptions, initOverrides);
136
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificateConfigFromJSON)(jsonValue));
137
+ });
138
+ }
139
+ /**
140
+ * Get a certificate config
141
+ */
142
+ getCertificateConfig(requestParameters, initOverrides) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ const response = yield this.getCertificateConfigRaw(requestParameters, initOverrides);
145
+ return yield response.value();
146
+ });
147
+ }
148
+ /**
149
+ * Creates request options for getCertificateConfigs without sending the request
150
+ */
151
+ getCertificateConfigsRequestOpts(requestParameters) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ const queryParameters = {};
154
+ if (requestParameters['courseId'] != null) {
155
+ queryParameters['course_id'] = requestParameters['courseId'];
156
+ }
157
+ if (requestParameters['scope'] != null) {
158
+ queryParameters['scope'] = requestParameters['scope'];
159
+ }
160
+ const headerParameters = {};
161
+ let urlPath = `/certificate-configs`;
162
+ return {
163
+ path: urlPath,
164
+ method: 'GET',
165
+ headers: headerParameters,
166
+ query: queryParameters,
167
+ };
168
+ });
169
+ }
170
+ /**
171
+ * List certificate configs in the current portal
172
+ */
173
+ getCertificateConfigsRaw(requestParameters, initOverrides) {
174
+ return __awaiter(this, void 0, void 0, function* () {
175
+ const requestOptions = yield this.getCertificateConfigsRequestOpts(requestParameters);
176
+ const response = yield this.request(requestOptions, initOverrides);
177
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetCertificateConfigListFromJSON)(jsonValue));
178
+ });
179
+ }
180
+ /**
181
+ * List certificate configs in the current portal
182
+ */
183
+ getCertificateConfigs() {
184
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
185
+ const response = yield this.getCertificateConfigsRaw(requestParameters, initOverrides);
186
+ return yield response.value();
187
+ });
188
+ }
189
+ /**
190
+ * Creates request options for getCertificatePdf without sending the request
191
+ */
192
+ getCertificatePdfRequestOpts(requestParameters) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ if (requestParameters['certificateId'] == null) {
195
+ throw new runtime.RequiredError('certificateId', 'Required parameter "certificateId" was null or undefined when calling getCertificatePdf().');
196
+ }
197
+ const queryParameters = {};
198
+ const headerParameters = {};
199
+ let urlPath = `/certificates/{certificateId}/pdf`;
200
+ urlPath = urlPath.replace(`{${"certificateId"}}`, encodeURIComponent(String(requestParameters['certificateId'])));
201
+ return {
202
+ path: urlPath,
203
+ method: 'GET',
204
+ headers: headerParameters,
205
+ query: queryParameters,
206
+ };
207
+ });
208
+ }
209
+ /**
210
+ * Download certificate as PDF
211
+ */
212
+ getCertificatePdfRaw(requestParameters, initOverrides) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ const requestOptions = yield this.getCertificatePdfRequestOpts(requestParameters);
215
+ const response = yield this.request(requestOptions, initOverrides);
216
+ return new runtime.BlobApiResponse(response);
217
+ });
218
+ }
219
+ /**
220
+ * Download certificate as PDF
221
+ */
222
+ getCertificatePdf(requestParameters, initOverrides) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ const response = yield this.getCertificatePdfRaw(requestParameters, initOverrides);
225
+ return yield response.value();
226
+ });
227
+ }
228
+ /**
229
+ * Creates request options for getCertificates without sending the request
230
+ */
231
+ getCertificatesRequestOpts(requestParameters) {
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ const queryParameters = {};
234
+ if (requestParameters['userId'] != null) {
235
+ queryParameters['user_id'] = requestParameters['userId'];
236
+ }
237
+ if (requestParameters['courseId'] != null) {
238
+ queryParameters['course_id'] = requestParameters['courseId'];
239
+ }
240
+ if (requestParameters['status'] != null) {
241
+ queryParameters['status'] = requestParameters['status'];
242
+ }
243
+ if (requestParameters['issuedAfter'] != null) {
244
+ queryParameters['issued_after'] = requestParameters['issuedAfter'];
245
+ }
246
+ if (requestParameters['issuedBefore'] != null) {
247
+ queryParameters['issued_before'] = requestParameters['issuedBefore'];
248
+ }
249
+ if (requestParameters['expiresAfter'] != null) {
250
+ queryParameters['expires_after'] = requestParameters['expiresAfter'];
251
+ }
252
+ if (requestParameters['expiresBefore'] != null) {
253
+ queryParameters['expires_before'] = requestParameters['expiresBefore'];
254
+ }
255
+ if (requestParameters['expiringWithinDays'] != null) {
256
+ queryParameters['expiring_within_days'] = requestParameters['expiringWithinDays'];
257
+ }
258
+ const headerParameters = {};
259
+ let urlPath = `/certificates`;
260
+ return {
261
+ path: urlPath,
262
+ method: 'GET',
263
+ headers: headerParameters,
264
+ query: queryParameters,
265
+ };
266
+ });
267
+ }
268
+ /**
269
+ * List certificates in the current portal
270
+ */
271
+ getCertificatesRaw(requestParameters, initOverrides) {
272
+ return __awaiter(this, void 0, void 0, function* () {
273
+ const requestOptions = yield this.getCertificatesRequestOpts(requestParameters);
274
+ const response = yield this.request(requestOptions, initOverrides);
275
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetCertificateListFromJSON)(jsonValue));
276
+ });
277
+ }
278
+ /**
279
+ * List certificates in the current portal
280
+ */
281
+ getCertificates() {
282
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
283
+ const response = yield this.getCertificatesRaw(requestParameters, initOverrides);
284
+ return yield response.value();
285
+ });
286
+ }
287
+ /**
288
+ * Creates request options for getCurrentUserCertificates without sending the request
289
+ */
290
+ getCurrentUserCertificatesRequestOpts() {
291
+ return __awaiter(this, void 0, void 0, function* () {
292
+ const queryParameters = {};
293
+ const headerParameters = {};
294
+ let urlPath = `/certificates/current`;
295
+ return {
296
+ path: urlPath,
297
+ method: 'GET',
298
+ headers: headerParameters,
299
+ query: queryParameters,
300
+ };
301
+ });
302
+ }
303
+ /**
304
+ * List the authenticated user\'s own certificates
305
+ */
306
+ getCurrentUserCertificatesRaw(initOverrides) {
307
+ return __awaiter(this, void 0, void 0, function* () {
308
+ const requestOptions = yield this.getCurrentUserCertificatesRequestOpts();
309
+ const response = yield this.request(requestOptions, initOverrides);
310
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetCertificateListFromJSON)(jsonValue));
311
+ });
312
+ }
313
+ /**
314
+ * List the authenticated user\'s own certificates
315
+ */
316
+ getCurrentUserCertificates(initOverrides) {
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ const response = yield this.getCurrentUserCertificatesRaw(initOverrides);
319
+ return yield response.value();
320
+ });
321
+ }
322
+ /**
323
+ * Creates request options for getEffectiveCertificateConfig without sending the request
324
+ */
325
+ getEffectiveCertificateConfigRequestOpts(requestParameters) {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ if (requestParameters['courseId'] == null) {
328
+ throw new runtime.RequiredError('courseId', 'Required parameter "courseId" was null or undefined when calling getEffectiveCertificateConfig().');
329
+ }
330
+ const queryParameters = {};
331
+ const headerParameters = {};
332
+ let urlPath = `/courses/{courseId}/certificate-config/effective`;
333
+ urlPath = urlPath.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId'])));
334
+ return {
335
+ path: urlPath,
336
+ method: 'GET',
337
+ headers: headerParameters,
338
+ query: queryParameters,
339
+ };
340
+ });
341
+ }
342
+ /**
343
+ * Resolve effective certificate config for a course
344
+ */
345
+ getEffectiveCertificateConfigRaw(requestParameters, initOverrides) {
346
+ return __awaiter(this, void 0, void 0, function* () {
347
+ const requestOptions = yield this.getEffectiveCertificateConfigRequestOpts(requestParameters);
348
+ const response = yield this.request(requestOptions, initOverrides);
349
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EffectiveCertificateConfigFromJSON)(jsonValue));
350
+ });
351
+ }
352
+ /**
353
+ * Resolve effective certificate config for a course
354
+ */
355
+ getEffectiveCertificateConfig(requestParameters, initOverrides) {
356
+ return __awaiter(this, void 0, void 0, function* () {
357
+ const response = yield this.getEffectiveCertificateConfigRaw(requestParameters, initOverrides);
358
+ return yield response.value();
359
+ });
360
+ }
361
+ /**
362
+ * Creates request options for postCertificateConfig without sending the request
363
+ */
364
+ postCertificateConfigRequestOpts(requestParameters) {
365
+ return __awaiter(this, void 0, void 0, function* () {
366
+ if (requestParameters['postCertificateConfig'] == null) {
367
+ throw new runtime.RequiredError('postCertificateConfig', 'Required parameter "postCertificateConfig" was null or undefined when calling postCertificateConfig().');
368
+ }
369
+ const queryParameters = {};
370
+ const headerParameters = {};
371
+ headerParameters['Content-Type'] = 'application/json';
372
+ let urlPath = `/certificate-configs`;
373
+ return {
374
+ path: urlPath,
375
+ method: 'POST',
376
+ headers: headerParameters,
377
+ query: queryParameters,
378
+ body: (0, index_1.PostCertificateConfigToJSON)(requestParameters['postCertificateConfig']),
379
+ };
380
+ });
381
+ }
382
+ /**
383
+ * Create a certificate config
384
+ */
385
+ postCertificateConfigRaw(requestParameters, initOverrides) {
386
+ return __awaiter(this, void 0, void 0, function* () {
387
+ const requestOptions = yield this.postCertificateConfigRequestOpts(requestParameters);
388
+ const response = yield this.request(requestOptions, initOverrides);
389
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificateConfigFromJSON)(jsonValue));
390
+ });
391
+ }
392
+ /**
393
+ * Create a certificate config
394
+ */
395
+ postCertificateConfig(requestParameters, initOverrides) {
396
+ return __awaiter(this, void 0, void 0, function* () {
397
+ const response = yield this.postCertificateConfigRaw(requestParameters, initOverrides);
398
+ return yield response.value();
399
+ });
400
+ }
401
+ /**
402
+ * Creates request options for postCourseCertificate without sending the request
403
+ */
404
+ postCourseCertificateRequestOpts(requestParameters) {
405
+ return __awaiter(this, void 0, void 0, function* () {
406
+ if (requestParameters['courseId'] == null) {
407
+ throw new runtime.RequiredError('courseId', 'Required parameter "courseId" was null or undefined when calling postCourseCertificate().');
408
+ }
409
+ if (requestParameters['postCertificate'] == null) {
410
+ throw new runtime.RequiredError('postCertificate', 'Required parameter "postCertificate" was null or undefined when calling postCourseCertificate().');
411
+ }
412
+ const queryParameters = {};
413
+ const headerParameters = {};
414
+ headerParameters['Content-Type'] = 'application/json';
415
+ let urlPath = `/courses/{courseId}/certificates`;
416
+ urlPath = urlPath.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId'])));
417
+ return {
418
+ path: urlPath,
419
+ method: 'POST',
420
+ headers: headerParameters,
421
+ query: queryParameters,
422
+ body: (0, index_1.PostCertificateToJSON)(requestParameters['postCertificate']),
423
+ };
424
+ });
425
+ }
426
+ /**
427
+ * Manually issue a certificate for a course
428
+ */
429
+ postCourseCertificateRaw(requestParameters, initOverrides) {
430
+ return __awaiter(this, void 0, void 0, function* () {
431
+ const requestOptions = yield this.postCourseCertificateRequestOpts(requestParameters);
432
+ const response = yield this.request(requestOptions, initOverrides);
433
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificateFromJSON)(jsonValue));
434
+ });
435
+ }
436
+ /**
437
+ * Manually issue a certificate for a course
438
+ */
439
+ postCourseCertificate(requestParameters, initOverrides) {
440
+ return __awaiter(this, void 0, void 0, function* () {
441
+ const response = yield this.postCourseCertificateRaw(requestParameters, initOverrides);
442
+ return yield response.value();
443
+ });
444
+ }
445
+ /**
446
+ * Creates request options for postRevokeCertificate without sending the request
447
+ */
448
+ postRevokeCertificateRequestOpts(requestParameters) {
449
+ return __awaiter(this, void 0, void 0, function* () {
450
+ if (requestParameters['certificateId'] == null) {
451
+ throw new runtime.RequiredError('certificateId', 'Required parameter "certificateId" was null or undefined when calling postRevokeCertificate().');
452
+ }
453
+ if (requestParameters['postRevokeCertificate'] == null) {
454
+ throw new runtime.RequiredError('postRevokeCertificate', 'Required parameter "postRevokeCertificate" was null or undefined when calling postRevokeCertificate().');
455
+ }
456
+ const queryParameters = {};
457
+ const headerParameters = {};
458
+ headerParameters['Content-Type'] = 'application/json';
459
+ let urlPath = `/certificates/{certificateId}/revoke`;
460
+ urlPath = urlPath.replace(`{${"certificateId"}}`, encodeURIComponent(String(requestParameters['certificateId'])));
461
+ return {
462
+ path: urlPath,
463
+ method: 'POST',
464
+ headers: headerParameters,
465
+ query: queryParameters,
466
+ body: (0, index_1.PostRevokeCertificateToJSON)(requestParameters['postRevokeCertificate']),
467
+ };
468
+ });
469
+ }
470
+ /**
471
+ * Revoke a certificate
472
+ */
473
+ postRevokeCertificateRaw(requestParameters, initOverrides) {
474
+ return __awaiter(this, void 0, void 0, function* () {
475
+ const requestOptions = yield this.postRevokeCertificateRequestOpts(requestParameters);
476
+ const response = yield this.request(requestOptions, initOverrides);
477
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificateFromJSON)(jsonValue));
478
+ });
479
+ }
480
+ /**
481
+ * Revoke a certificate
482
+ */
483
+ postRevokeCertificate(requestParameters, initOverrides) {
484
+ return __awaiter(this, void 0, void 0, function* () {
485
+ const response = yield this.postRevokeCertificateRaw(requestParameters, initOverrides);
486
+ return yield response.value();
487
+ });
488
+ }
489
+ /**
490
+ * Creates request options for putCertificateConfig without sending the request
491
+ */
492
+ putCertificateConfigRequestOpts(requestParameters) {
493
+ return __awaiter(this, void 0, void 0, function* () {
494
+ if (requestParameters['configId'] == null) {
495
+ throw new runtime.RequiredError('configId', 'Required parameter "configId" was null or undefined when calling putCertificateConfig().');
496
+ }
497
+ if (requestParameters['putCertificateConfig'] == null) {
498
+ throw new runtime.RequiredError('putCertificateConfig', 'Required parameter "putCertificateConfig" was null or undefined when calling putCertificateConfig().');
499
+ }
500
+ const queryParameters = {};
501
+ const headerParameters = {};
502
+ headerParameters['Content-Type'] = 'application/json';
503
+ let urlPath = `/certificate-configs/{configId}`;
504
+ urlPath = urlPath.replace(`{${"configId"}}`, encodeURIComponent(String(requestParameters['configId'])));
505
+ return {
506
+ path: urlPath,
507
+ method: 'PUT',
508
+ headers: headerParameters,
509
+ query: queryParameters,
510
+ body: (0, index_1.PutCertificateConfigToJSON)(requestParameters['putCertificateConfig']),
511
+ };
512
+ });
513
+ }
514
+ /**
515
+ * Update a certificate config
516
+ */
517
+ putCertificateConfigRaw(requestParameters, initOverrides) {
518
+ return __awaiter(this, void 0, void 0, function* () {
519
+ const requestOptions = yield this.putCertificateConfigRequestOpts(requestParameters);
520
+ const response = yield this.request(requestOptions, initOverrides);
521
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificateConfigFromJSON)(jsonValue));
522
+ });
523
+ }
524
+ /**
525
+ * Update a certificate config
526
+ */
527
+ putCertificateConfig(requestParameters, initOverrides) {
528
+ return __awaiter(this, void 0, void 0, function* () {
529
+ const response = yield this.putCertificateConfigRaw(requestParameters, initOverrides);
530
+ return yield response.value();
531
+ });
532
+ }
533
+ /**
534
+ * Creates request options for verifyCertificate without sending the request
535
+ */
536
+ verifyCertificateRequestOpts(requestParameters) {
537
+ return __awaiter(this, void 0, void 0, function* () {
538
+ if (requestParameters['certificateId'] == null) {
539
+ throw new runtime.RequiredError('certificateId', 'Required parameter "certificateId" was null or undefined when calling verifyCertificate().');
540
+ }
541
+ const queryParameters = {};
542
+ const headerParameters = {};
543
+ let urlPath = `/public/certificates/{certificateId}/verify`;
544
+ urlPath = urlPath.replace(`{${"certificateId"}}`, encodeURIComponent(String(requestParameters['certificateId'])));
545
+ return {
546
+ path: urlPath,
547
+ method: 'GET',
548
+ headers: headerParameters,
549
+ query: queryParameters,
550
+ };
551
+ });
552
+ }
553
+ /**
554
+ * Public certificate verification (no auth)
555
+ */
556
+ verifyCertificateRaw(requestParameters, initOverrides) {
557
+ return __awaiter(this, void 0, void 0, function* () {
558
+ const requestOptions = yield this.verifyCertificateRequestOpts(requestParameters);
559
+ const response = yield this.request(requestOptions, initOverrides);
560
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CertificatePublicFromJSON)(jsonValue));
561
+ });
562
+ }
563
+ /**
564
+ * Public certificate verification (no auth)
565
+ */
566
+ verifyCertificate(requestParameters, initOverrides) {
567
+ return __awaiter(this, void 0, void 0, function* () {
568
+ const response = yield this.verifyCertificateRaw(requestParameters, initOverrides);
569
+ return yield response.value();
570
+ });
571
+ }
572
+ }
573
+ exports.CertificateApi = CertificateApi;
574
+ /**
575
+ * @export
576
+ */
577
+ exports.GetCertificateConfigsScopeEnum = {
578
+ Portal: 'portal',
579
+ Course: 'course'
580
+ };
581
+ /**
582
+ * @export
583
+ */
584
+ exports.GetCertificatesStatusEnum = {
585
+ Active: 'active',
586
+ Revoked: 'revoked'
587
+ };
@@ -1,3 +1,4 @@
1
+ export * from './CertificateApi';
1
2
  export * from './ChatApi';
2
3
  export * from './ContentApi';
3
4
  export * from './CourseApi';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
+ __exportStar(require("./CertificateApi"), exports);
19
20
  __exportStar(require("./ChatApi"), exports);
20
21
  __exportStar(require("./ContentApi"), exports);
21
22
  __exportStar(require("./CourseApi"), exports);