academe-kit 0.9.0 → 0.9.2

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.
@@ -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
- * List all certificates
8
+ * Get current user's certificates
8
9
  */
9
- getMe(): Promise<import("openapi-fetch").FetchResponse<{
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
- }, import("openapi-fetch").FetchOptions<{
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
- }> | undefined, `${string}/${string}`>>;
76
- getAll(): Promise<import("openapi-fetch").FetchResponse<{
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?: never;
118
+ path: {
119
+ id: components["parameters"]["id"];
120
+ };
81
121
  cookie?: never;
82
122
  };
83
123
  requestBody?: never;
@@ -89,90 +129,71 @@ 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
- }, import("openapi-fetch").FetchOptions<{
141
+ }, {
142
+ params: {
143
+ path: {
144
+ id: string;
145
+ };
146
+ };
147
+ }, `${string}/${string}`>>;
148
+ /**
149
+ * Download all certificates of a given user as a single merged PDF
150
+ */
151
+ downloadAll(userId: string): Promise<import("openapi-fetch").FetchResponse<{
100
152
  parameters: {
101
153
  query?: never;
102
154
  header?: never;
103
- path?: never;
155
+ path: {
156
+ userId: string;
157
+ };
104
158
  cookie?: never;
105
159
  };
106
160
  requestBody?: never;
107
161
  responses: {
108
162
  200: {
109
163
  headers: {
164
+ "Content-Disposition"?: string;
110
165
  [name: string]: unknown;
111
166
  };
112
167
  content: {
113
- "application/json": {
114
- status?: string;
115
- data?: components["schemas"]["Certificate"][];
116
- };
168
+ "application/pdf": string;
117
169
  };
118
170
  };
119
171
  401: components["responses"]["Unauthorized"];
120
- 500: components["responses"]["ServerError"];
121
- };
122
- }> | undefined, `${string}/${string}`>>;
123
- /**
124
- * Get current user's certificates
125
- */
126
- getMyCertificates(query?: {
127
- search?: string;
128
- page?: number;
129
- limit?: number;
130
- }): Promise<import("openapi-fetch").FetchResponse<{
131
- parameters: {
132
- query?: {
133
- search?: components["parameters"]["search"];
134
- page?: components["parameters"]["page"];
135
- limit?: components["parameters"]["limit"];
136
- };
137
- header?: never;
138
- path?: never;
139
- cookie?: never;
140
- };
141
- requestBody?: never;
142
- responses: {
143
- 200: {
172
+ 404: {
144
173
  headers: {
145
174
  [name: string]: unknown;
146
175
  };
147
176
  content: {
148
177
  "application/json": {
149
178
  status?: string;
150
- data?: components["schemas"]["Certificate"][];
151
- meta?: {
152
- total?: number;
153
- page?: number;
154
- limit?: number;
155
- totalPages?: number;
156
- };
179
+ message?: string;
157
180
  };
158
181
  };
159
182
  };
160
- 401: components["responses"]["Unauthorized"];
161
183
  500: components["responses"]["ServerError"];
162
184
  };
163
185
  }, {
164
186
  params: {
165
- query: {
166
- search?: string;
167
- page?: number;
168
- limit?: number;
169
- } | undefined;
187
+ path: {
188
+ userId: string;
189
+ };
170
190
  };
191
+ parseAs: "blob";
171
192
  }, `${string}/${string}`>>;
172
193
  /**
173
- * Get certificate by ID
194
+ * Download certificate PDF
174
195
  */
175
- getById(id: string): Promise<import("openapi-fetch").FetchResponse<{
196
+ download(id: string): Promise<import("openapi-fetch").FetchResponse<{
176
197
  parameters: {
177
198
  query?: never;
178
199
  header?: never;
@@ -188,14 +209,11 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
188
209
  [name: string]: unknown;
189
210
  };
190
211
  content: {
191
- "application/json": {
192
- status?: string;
193
- data?: components["schemas"]["Certificate"];
194
- };
212
+ "application/pdf": string;
195
213
  };
196
214
  };
197
- 400: components["responses"]["BadRequest"];
198
215
  401: components["responses"]["Unauthorized"];
216
+ 403: components["responses"]["Forbidden"];
199
217
  404: components["responses"]["NotFound"];
200
218
  500: components["responses"]["ServerError"];
201
219
  };
@@ -230,7 +248,6 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
230
248
  "application/json": {
231
249
  status?: string;
232
250
  data?: components["schemas"]["Certificate"];
233
- message?: string;
234
251
  };
235
252
  };
236
253
  };
@@ -247,6 +264,52 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
247
264
  url?: string;
248
265
  };
249
266
  }, `${string}/${string}`>>;
267
+ /**
268
+ * Generate a certificate PDF server-side
269
+ */
270
+ generate(data: GenerateCertificateDto): Promise<import("openapi-fetch").FetchResponse<{
271
+ parameters: {
272
+ query?: never;
273
+ header?: never;
274
+ path?: never;
275
+ cookie?: never;
276
+ };
277
+ requestBody: {
278
+ content: {
279
+ "application/json": components["schemas"]["GenerateCertificateDto"];
280
+ };
281
+ };
282
+ responses: {
283
+ 201: {
284
+ headers: {
285
+ [name: string]: unknown;
286
+ };
287
+ content: {
288
+ "application/json": {
289
+ status?: string;
290
+ data?: {
291
+ certificate?: components["schemas"]["Certificate"];
292
+ pdfUrl?: string;
293
+ };
294
+ };
295
+ };
296
+ };
297
+ 400: components["responses"]["BadRequest"];
298
+ 401: components["responses"]["Unauthorized"];
299
+ 500: components["responses"]["ServerError"];
300
+ };
301
+ }, {
302
+ body: {
303
+ userId: string;
304
+ quizAttemptId?: string;
305
+ certificateTemplateId: string;
306
+ studentName: string;
307
+ quizTitle: string;
308
+ score?: number;
309
+ certificateNumber?: string;
310
+ issuedAt?: string;
311
+ };
312
+ }, `${string}/${string}`>>;
250
313
  /**
251
314
  * Update certificate
252
315
  */
@@ -273,7 +336,6 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
273
336
  "application/json": {
274
337
  status?: string;
275
338
  data?: components["schemas"]["Certificate"];
276
- message?: string;
277
339
  };
278
340
  };
279
341
  };
@@ -309,16 +371,11 @@ export declare function createCertificateService(apiClient: AcademeApiClient): {
309
371
  };
310
372
  requestBody?: never;
311
373
  responses: {
312
- 200: {
374
+ 204: {
313
375
  headers: {
314
376
  [name: string]: unknown;
315
377
  };
316
- content: {
317
- "application/json": {
318
- status?: string;
319
- message?: string;
320
- };
321
- };
378
+ content?: never;
322
379
  };
323
380
  400: components["responses"]["BadRequest"];
324
381
  401: components["responses"]["Unauthorized"];
@@ -16,6 +16,7 @@ type UpdateCurriculumGridDto = components["schemas"]["UpdateCurriculumGridDto"];
16
16
  type CreateCurriculumPeriodDto = components["schemas"]["CreateCurriculumPeriodDto"];
17
17
  type UpdateCurriculumPeriodDto = components["schemas"]["UpdateCurriculumPeriodDto"];
18
18
  type GetInstitutionUsersQuery = paths["/institutions/{institutionId}/users"]["get"]["parameters"]["query"];
19
+ type GetInstitutionClassroomsQuery = paths["/institutions/{institutionId}/classrooms"]["get"]["parameters"]["query"];
19
20
  export declare function createInstitutionService(apiClient: AcademeApiClient): {
20
21
  getAll(): Promise<import("openapi-fetch").FetchResponse<{
21
22
  parameters: {
@@ -331,9 +332,7 @@ export declare function createInstitutionService(apiClient: AcademeApiClient): {
331
332
  productId?: string;
332
333
  };
333
334
  }, `${string}/${string}`>>;
334
- getClassrooms(institutionId: string, options?: {
335
- includeUserCount?: boolean;
336
- }): Promise<import("openapi-fetch").FetchResponse<{
335
+ getClassrooms(institutionId: string, options?: GetInstitutionClassroomsQuery): Promise<import("openapi-fetch").FetchResponse<{
337
336
  parameters: {
338
337
  query?: {
339
338
  includeUserCount?: boolean;
@@ -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;