academe-kit 0.9.0 → 0.9.1
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/dist/index.cjs +24 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +668 -114
- package/dist/index.esm.js +24 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/types/services/CertificateService.d.ts +95 -83
- package/dist/types/services/userService.d.ts +2 -0
- package/dist/types/types/academe-api.d.ts +556 -16
- package/package.json +1 -1
|
@@ -2,11 +2,16 @@ import type { AcademeApiClient } from "./index";
|
|
|
2
2
|
import type { components } from "../types/academe-api";
|
|
3
3
|
type CreateCertificateDto = components["schemas"]["CreateCertificateDto"];
|
|
4
4
|
type UpdateCertificateDto = components["schemas"]["UpdateCertificateDto"];
|
|
5
|
+
type GenerateCertificateDto = components["schemas"]["GenerateCertificateDto"];
|
|
5
6
|
export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Get current user's certificates
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
getMyCertificates(query?: {
|
|
11
|
+
search?: string;
|
|
12
|
+
page?: number;
|
|
13
|
+
limit?: number;
|
|
14
|
+
}): Promise<import("openapi-fetch").FetchResponse<{
|
|
10
15
|
parameters: {
|
|
11
16
|
query?: {
|
|
12
17
|
search?: components["parameters"]["search"];
|
|
@@ -39,12 +44,32 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
39
44
|
401: components["responses"]["Unauthorized"];
|
|
40
45
|
500: components["responses"]["ServerError"];
|
|
41
46
|
};
|
|
42
|
-
},
|
|
47
|
+
}, {
|
|
48
|
+
params: {
|
|
49
|
+
query: {
|
|
50
|
+
search?: string;
|
|
51
|
+
page?: number;
|
|
52
|
+
limit?: number;
|
|
53
|
+
} | undefined;
|
|
54
|
+
};
|
|
55
|
+
}, `${string}/${string}`>>;
|
|
56
|
+
/**
|
|
57
|
+
* List all certificates
|
|
58
|
+
*/
|
|
59
|
+
getAll(query?: {
|
|
60
|
+
userId?: string;
|
|
61
|
+
search?: string;
|
|
62
|
+
page?: number;
|
|
63
|
+
limit?: number;
|
|
64
|
+
includeCourse?: boolean;
|
|
65
|
+
}): Promise<import("openapi-fetch").FetchResponse<{
|
|
43
66
|
parameters: {
|
|
44
67
|
query?: {
|
|
68
|
+
userId?: string;
|
|
45
69
|
search?: components["parameters"]["search"];
|
|
46
70
|
page?: components["parameters"]["page"];
|
|
47
71
|
limit?: components["parameters"]["limit"];
|
|
72
|
+
includeCourse?: boolean;
|
|
48
73
|
};
|
|
49
74
|
header?: never;
|
|
50
75
|
path?: never;
|
|
@@ -72,12 +97,27 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
72
97
|
401: components["responses"]["Unauthorized"];
|
|
73
98
|
500: components["responses"]["ServerError"];
|
|
74
99
|
};
|
|
75
|
-
}
|
|
76
|
-
|
|
100
|
+
}, {
|
|
101
|
+
params: {
|
|
102
|
+
query: {
|
|
103
|
+
userId?: string;
|
|
104
|
+
search?: string;
|
|
105
|
+
page?: number;
|
|
106
|
+
limit?: number;
|
|
107
|
+
includeCourse?: boolean;
|
|
108
|
+
} | undefined;
|
|
109
|
+
};
|
|
110
|
+
}, `${string}/${string}`>>;
|
|
111
|
+
/**
|
|
112
|
+
* Get certificate by ID
|
|
113
|
+
*/
|
|
114
|
+
getById(id: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
77
115
|
parameters: {
|
|
78
116
|
query?: never;
|
|
79
117
|
header?: never;
|
|
80
|
-
path
|
|
118
|
+
path: {
|
|
119
|
+
id: components["parameters"]["id"];
|
|
120
|
+
};
|
|
81
121
|
cookie?: never;
|
|
82
122
|
};
|
|
83
123
|
requestBody?: never;
|
|
@@ -89,53 +129,32 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
89
129
|
content: {
|
|
90
130
|
"application/json": {
|
|
91
131
|
status?: string;
|
|
92
|
-
data?: components["schemas"]["Certificate"]
|
|
132
|
+
data?: components["schemas"]["Certificate"];
|
|
93
133
|
};
|
|
94
134
|
};
|
|
95
135
|
};
|
|
136
|
+
400: components["responses"]["BadRequest"];
|
|
96
137
|
401: components["responses"]["Unauthorized"];
|
|
138
|
+
404: components["responses"]["NotFound"];
|
|
97
139
|
500: components["responses"]["ServerError"];
|
|
98
140
|
};
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
path?: never;
|
|
104
|
-
cookie?: never;
|
|
105
|
-
};
|
|
106
|
-
requestBody?: never;
|
|
107
|
-
responses: {
|
|
108
|
-
200: {
|
|
109
|
-
headers: {
|
|
110
|
-
[name: string]: unknown;
|
|
111
|
-
};
|
|
112
|
-
content: {
|
|
113
|
-
"application/json": {
|
|
114
|
-
status?: string;
|
|
115
|
-
data?: components["schemas"]["Certificate"][];
|
|
116
|
-
};
|
|
117
|
-
};
|
|
141
|
+
}, {
|
|
142
|
+
params: {
|
|
143
|
+
path: {
|
|
144
|
+
id: string;
|
|
118
145
|
};
|
|
119
|
-
401: components["responses"]["Unauthorized"];
|
|
120
|
-
500: components["responses"]["ServerError"];
|
|
121
146
|
};
|
|
122
|
-
}
|
|
147
|
+
}, `${string}/${string}`>>;
|
|
123
148
|
/**
|
|
124
|
-
*
|
|
149
|
+
* Download certificate PDF
|
|
125
150
|
*/
|
|
126
|
-
|
|
127
|
-
search?: string;
|
|
128
|
-
page?: number;
|
|
129
|
-
limit?: number;
|
|
130
|
-
}): Promise<import("openapi-fetch").FetchResponse<{
|
|
151
|
+
download(id: string): Promise<import("openapi-fetch").FetchResponse<{
|
|
131
152
|
parameters: {
|
|
132
|
-
query?:
|
|
133
|
-
search?: components["parameters"]["search"];
|
|
134
|
-
page?: components["parameters"]["page"];
|
|
135
|
-
limit?: components["parameters"]["limit"];
|
|
136
|
-
};
|
|
153
|
+
query?: never;
|
|
137
154
|
header?: never;
|
|
138
|
-
path
|
|
155
|
+
path: {
|
|
156
|
+
id: components["parameters"]["id"];
|
|
157
|
+
};
|
|
139
158
|
cookie?: never;
|
|
140
159
|
};
|
|
141
160
|
requestBody?: never;
|
|
@@ -145,45 +164,38 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
145
164
|
[name: string]: unknown;
|
|
146
165
|
};
|
|
147
166
|
content: {
|
|
148
|
-
"application/
|
|
149
|
-
status?: string;
|
|
150
|
-
data?: components["schemas"]["Certificate"][];
|
|
151
|
-
meta?: {
|
|
152
|
-
total?: number;
|
|
153
|
-
page?: number;
|
|
154
|
-
limit?: number;
|
|
155
|
-
totalPages?: number;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
167
|
+
"application/pdf": string;
|
|
158
168
|
};
|
|
159
169
|
};
|
|
160
170
|
401: components["responses"]["Unauthorized"];
|
|
171
|
+
403: components["responses"]["Forbidden"];
|
|
172
|
+
404: components["responses"]["NotFound"];
|
|
161
173
|
500: components["responses"]["ServerError"];
|
|
162
174
|
};
|
|
163
175
|
}, {
|
|
164
176
|
params: {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
limit?: number;
|
|
169
|
-
} | undefined;
|
|
177
|
+
path: {
|
|
178
|
+
id: string;
|
|
179
|
+
};
|
|
170
180
|
};
|
|
171
181
|
}, `${string}/${string}`>>;
|
|
172
182
|
/**
|
|
173
|
-
*
|
|
183
|
+
* Create a new certificate
|
|
174
184
|
*/
|
|
175
|
-
|
|
185
|
+
create(data: CreateCertificateDto): Promise<import("openapi-fetch").FetchResponse<{
|
|
176
186
|
parameters: {
|
|
177
187
|
query?: never;
|
|
178
188
|
header?: never;
|
|
179
|
-
path
|
|
180
|
-
id: components["parameters"]["id"];
|
|
181
|
-
};
|
|
189
|
+
path?: never;
|
|
182
190
|
cookie?: never;
|
|
183
191
|
};
|
|
184
|
-
requestBody
|
|
192
|
+
requestBody: {
|
|
193
|
+
content: {
|
|
194
|
+
"application/json": components["schemas"]["CreateCertificateDto"];
|
|
195
|
+
};
|
|
196
|
+
};
|
|
185
197
|
responses: {
|
|
186
|
-
|
|
198
|
+
201: {
|
|
187
199
|
headers: {
|
|
188
200
|
[name: string]: unknown;
|
|
189
201
|
};
|
|
@@ -196,20 +208,21 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
196
208
|
};
|
|
197
209
|
400: components["responses"]["BadRequest"];
|
|
198
210
|
401: components["responses"]["Unauthorized"];
|
|
199
|
-
404: components["responses"]["NotFound"];
|
|
200
211
|
500: components["responses"]["ServerError"];
|
|
201
212
|
};
|
|
202
213
|
}, {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
214
|
+
body: {
|
|
215
|
+
userId: string;
|
|
216
|
+
quizAttemptId?: string;
|
|
217
|
+
certificateTemplateId: string;
|
|
218
|
+
certificateNumber: string;
|
|
219
|
+
url?: string;
|
|
207
220
|
};
|
|
208
221
|
}, `${string}/${string}`>>;
|
|
209
222
|
/**
|
|
210
|
-
*
|
|
223
|
+
* Generate a certificate PDF server-side
|
|
211
224
|
*/
|
|
212
|
-
|
|
225
|
+
generate(data: GenerateCertificateDto): Promise<import("openapi-fetch").FetchResponse<{
|
|
213
226
|
parameters: {
|
|
214
227
|
query?: never;
|
|
215
228
|
header?: never;
|
|
@@ -218,7 +231,7 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
218
231
|
};
|
|
219
232
|
requestBody: {
|
|
220
233
|
content: {
|
|
221
|
-
"application/json": components["schemas"]["
|
|
234
|
+
"application/json": components["schemas"]["GenerateCertificateDto"];
|
|
222
235
|
};
|
|
223
236
|
};
|
|
224
237
|
responses: {
|
|
@@ -229,8 +242,10 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
229
242
|
content: {
|
|
230
243
|
"application/json": {
|
|
231
244
|
status?: string;
|
|
232
|
-
data?:
|
|
233
|
-
|
|
245
|
+
data?: {
|
|
246
|
+
certificate?: components["schemas"]["Certificate"];
|
|
247
|
+
pdfUrl?: string;
|
|
248
|
+
};
|
|
234
249
|
};
|
|
235
250
|
};
|
|
236
251
|
};
|
|
@@ -243,8 +258,11 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
243
258
|
userId: string;
|
|
244
259
|
quizAttemptId?: string;
|
|
245
260
|
certificateTemplateId: string;
|
|
246
|
-
|
|
247
|
-
|
|
261
|
+
studentName: string;
|
|
262
|
+
quizTitle: string;
|
|
263
|
+
score?: number;
|
|
264
|
+
certificateNumber?: string;
|
|
265
|
+
issuedAt?: string;
|
|
248
266
|
};
|
|
249
267
|
}, `${string}/${string}`>>;
|
|
250
268
|
/**
|
|
@@ -273,7 +291,6 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
273
291
|
"application/json": {
|
|
274
292
|
status?: string;
|
|
275
293
|
data?: components["schemas"]["Certificate"];
|
|
276
|
-
message?: string;
|
|
277
294
|
};
|
|
278
295
|
};
|
|
279
296
|
};
|
|
@@ -309,16 +326,11 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
|
|
|
309
326
|
};
|
|
310
327
|
requestBody?: never;
|
|
311
328
|
responses: {
|
|
312
|
-
|
|
329
|
+
204: {
|
|
313
330
|
headers: {
|
|
314
331
|
[name: string]: unknown;
|
|
315
332
|
};
|
|
316
|
-
content
|
|
317
|
-
"application/json": {
|
|
318
|
-
status?: string;
|
|
319
|
-
message?: string;
|
|
320
|
-
};
|
|
321
|
-
};
|
|
333
|
+
content?: never;
|
|
322
334
|
};
|
|
323
335
|
400: components["responses"]["BadRequest"];
|
|
324
336
|
401: components["responses"]["Unauthorized"];
|
|
@@ -293,6 +293,7 @@ export declare function createUserService(apiClient: AcademeApiClient): {
|
|
|
293
293
|
requestBody: {
|
|
294
294
|
content: {
|
|
295
295
|
"application/json": {
|
|
296
|
+
email?: string;
|
|
296
297
|
firstName?: string;
|
|
297
298
|
lastName?: string;
|
|
298
299
|
phone?: string;
|
|
@@ -347,6 +348,7 @@ export declare function createUserService(apiClient: AcademeApiClient): {
|
|
|
347
348
|
requestBody: {
|
|
348
349
|
content: {
|
|
349
350
|
"application/json": {
|
|
351
|
+
email?: string;
|
|
350
352
|
firstName?: string;
|
|
351
353
|
lastName?: string;
|
|
352
354
|
phone?: string;
|