academe-kit 0.1.8 → 0.2.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.
@@ -0,0 +1,733 @@
1
+ import type { AcademeApiClient } from './index';
2
+ import type { components } from '../types/academe-api';
3
+ type CreateInstitutionGroupDto = components['schemas']['CreateInstitutionGroupDto'];
4
+ type UpdateInstitutionGroupDto = components['schemas']['UpdateInstitutionGroupDto'];
5
+ type CreateInstitutionClassroomDto = components['schemas']['CreateInstitutionClassroomDto'];
6
+ type UpdateInstitutionClassroomDto = components['schemas']['UpdateInstitutionClassroomDto'];
7
+ type CreateInstitutionRegistrationDto = components['schemas']['CreateInstitutionRegistrationDto'];
8
+ type UpdateInstitutionRegistrationDto = components['schemas']['UpdateInstitutionRegistrationDto'];
9
+ type AssignClassroomDto = components['schemas']['AssignClassroomDto'];
10
+ export declare function createInstitutionService(apiClient: AcademeApiClient): {
11
+ getAll(): Promise<import("openapi-fetch").FetchResponse<{
12
+ parameters: {
13
+ query?: {
14
+ name?: string;
15
+ code?: string;
16
+ organizationId?: string;
17
+ isActive?: boolean;
18
+ search?: string;
19
+ page?: number;
20
+ limit?: number;
21
+ };
22
+ header?: never;
23
+ path?: never;
24
+ cookie?: never;
25
+ };
26
+ requestBody?: never;
27
+ responses: {
28
+ 200: {
29
+ headers: {
30
+ [name: string]: unknown;
31
+ };
32
+ content: {
33
+ "application/json": {
34
+ status?: string;
35
+ data?: components["schemas"]["Institution"][];
36
+ meta?: {
37
+ total?: number;
38
+ page?: number;
39
+ limit?: number;
40
+ totalPages?: number;
41
+ };
42
+ };
43
+ };
44
+ };
45
+ 401: components["responses"]["Unauthorized"];
46
+ 500: components["responses"]["ServerError"];
47
+ };
48
+ }, import("openapi-fetch").FetchOptions<{
49
+ parameters: {
50
+ query?: {
51
+ name?: string;
52
+ code?: string;
53
+ organizationId?: string;
54
+ isActive?: boolean;
55
+ search?: string;
56
+ page?: number;
57
+ limit?: number;
58
+ };
59
+ header?: never;
60
+ path?: never;
61
+ cookie?: never;
62
+ };
63
+ requestBody?: never;
64
+ responses: {
65
+ 200: {
66
+ headers: {
67
+ [name: string]: unknown;
68
+ };
69
+ content: {
70
+ "application/json": {
71
+ status?: string;
72
+ data?: components["schemas"]["Institution"][];
73
+ meta?: {
74
+ total?: number;
75
+ page?: number;
76
+ limit?: number;
77
+ totalPages?: number;
78
+ };
79
+ };
80
+ };
81
+ };
82
+ 401: components["responses"]["Unauthorized"];
83
+ 500: components["responses"]["ServerError"];
84
+ };
85
+ }> | undefined, `${string}/${string}`>>;
86
+ getById(id: string): Promise<import("openapi-fetch").FetchResponse<{
87
+ parameters: {
88
+ query?: never;
89
+ header?: never;
90
+ path: {
91
+ id: components["parameters"]["id"];
92
+ };
93
+ cookie?: never;
94
+ };
95
+ requestBody?: never;
96
+ responses: {
97
+ 200: {
98
+ headers: {
99
+ [name: string]: unknown;
100
+ };
101
+ content: {
102
+ "application/json": {
103
+ status?: string;
104
+ data?: components["schemas"]["Institution"];
105
+ };
106
+ };
107
+ };
108
+ 400: components["responses"]["BadRequest"];
109
+ 401: components["responses"]["Unauthorized"];
110
+ 404: components["responses"]["NotFound"];
111
+ 500: components["responses"]["ServerError"];
112
+ };
113
+ }, {
114
+ params: {
115
+ path: {
116
+ id: string;
117
+ };
118
+ };
119
+ }, `${string}/${string}`>>;
120
+ getGroups(institutionId: string): Promise<import("openapi-fetch").FetchResponse<{
121
+ parameters: {
122
+ query?: never;
123
+ header?: never;
124
+ path: {
125
+ institutionId: string;
126
+ };
127
+ cookie?: never;
128
+ };
129
+ requestBody?: never;
130
+ responses: {
131
+ 200: {
132
+ headers: {
133
+ [name: string]: unknown;
134
+ };
135
+ content: {
136
+ "application/json": {
137
+ status?: string;
138
+ data?: components["schemas"]["InstitutionGroup"][];
139
+ };
140
+ };
141
+ };
142
+ 401: components["responses"]["Unauthorized"];
143
+ 404: components["responses"]["NotFound"];
144
+ 500: components["responses"]["ServerError"];
145
+ };
146
+ }, {
147
+ params: {
148
+ path: {
149
+ institutionId: string;
150
+ };
151
+ };
152
+ }, `${string}/${string}`>>;
153
+ addGroup(institutionId: string, data: CreateInstitutionGroupDto): Promise<import("openapi-fetch").FetchResponse<{
154
+ parameters: {
155
+ query?: never;
156
+ header?: never;
157
+ path: {
158
+ institutionId: string;
159
+ };
160
+ cookie?: never;
161
+ };
162
+ requestBody: {
163
+ content: {
164
+ "application/json": components["schemas"]["CreateInstitutionGroupDto"];
165
+ };
166
+ };
167
+ responses: {
168
+ 201: {
169
+ headers: {
170
+ [name: string]: unknown;
171
+ };
172
+ content: {
173
+ "application/json": {
174
+ status?: string;
175
+ data?: components["schemas"]["InstitutionGroup"];
176
+ };
177
+ };
178
+ };
179
+ 400: components["responses"]["BadRequest"];
180
+ 401: components["responses"]["Unauthorized"];
181
+ 404: components["responses"]["NotFound"];
182
+ 409: components["responses"]["Conflict"];
183
+ 500: components["responses"]["ServerError"];
184
+ };
185
+ }, {
186
+ params: {
187
+ path: {
188
+ institutionId: string;
189
+ };
190
+ };
191
+ body: {
192
+ groupId: string;
193
+ availableQuantity: number;
194
+ };
195
+ }, `${string}/${string}`>>;
196
+ removeGroup(institutionId: string, groupId: string): Promise<import("openapi-fetch").FetchResponse<{
197
+ parameters: {
198
+ query?: never;
199
+ header?: never;
200
+ path: {
201
+ institutionId: string;
202
+ groupId: string;
203
+ };
204
+ cookie?: never;
205
+ };
206
+ requestBody?: never;
207
+ responses: {
208
+ 204: {
209
+ headers: {
210
+ [name: string]: unknown;
211
+ };
212
+ content?: never;
213
+ };
214
+ 400: components["responses"]["BadRequest"];
215
+ 401: components["responses"]["Unauthorized"];
216
+ 404: components["responses"]["NotFound"];
217
+ 500: components["responses"]["ServerError"];
218
+ };
219
+ }, {
220
+ params: {
221
+ path: {
222
+ institutionId: string;
223
+ groupId: string;
224
+ };
225
+ };
226
+ }, `${string}/${string}`>>;
227
+ updateGroup(institutionId: string, groupId: string, data: UpdateInstitutionGroupDto): Promise<import("openapi-fetch").FetchResponse<{
228
+ parameters: {
229
+ query?: never;
230
+ header?: never;
231
+ path: {
232
+ institutionId: string;
233
+ groupId: string;
234
+ };
235
+ cookie?: never;
236
+ };
237
+ requestBody: {
238
+ content: {
239
+ "application/json": components["schemas"]["UpdateInstitutionGroupDto"];
240
+ };
241
+ };
242
+ responses: {
243
+ 200: {
244
+ headers: {
245
+ [name: string]: unknown;
246
+ };
247
+ content: {
248
+ "application/json": {
249
+ status?: string;
250
+ data?: components["schemas"]["InstitutionGroup"];
251
+ };
252
+ };
253
+ };
254
+ 400: components["responses"]["BadRequest"];
255
+ 401: components["responses"]["Unauthorized"];
256
+ 404: components["responses"]["NotFound"];
257
+ 500: components["responses"]["ServerError"];
258
+ };
259
+ }, {
260
+ params: {
261
+ path: {
262
+ institutionId: string;
263
+ groupId: string;
264
+ };
265
+ };
266
+ body: {
267
+ availableQuantity: number;
268
+ };
269
+ }, `${string}/${string}`>>;
270
+ getClassrooms(institutionId: string, options?: {
271
+ includeUserCount?: boolean;
272
+ }): Promise<import("openapi-fetch").FetchResponse<{
273
+ parameters: {
274
+ query?: {
275
+ includeUserCount?: boolean;
276
+ };
277
+ header?: never;
278
+ path: {
279
+ institutionId: string;
280
+ };
281
+ cookie?: never;
282
+ };
283
+ requestBody?: never;
284
+ responses: {
285
+ 200: {
286
+ headers: {
287
+ [name: string]: unknown;
288
+ };
289
+ content: {
290
+ "application/json": {
291
+ status?: string;
292
+ data?: (components["schemas"]["InstitutionClassroom"] & {
293
+ userCount?: number;
294
+ })[];
295
+ };
296
+ };
297
+ };
298
+ 401: components["responses"]["Unauthorized"];
299
+ 404: components["responses"]["NotFound"];
300
+ 500: components["responses"]["ServerError"];
301
+ };
302
+ }, {
303
+ params: {
304
+ path: {
305
+ institutionId: string;
306
+ };
307
+ query: {
308
+ includeUserCount?: boolean;
309
+ } | undefined;
310
+ };
311
+ }, `${string}/${string}`>>;
312
+ getClassroomById(institutionId: string, classroomId: string): Promise<import("openapi-fetch").FetchResponse<{
313
+ parameters: {
314
+ query?: never;
315
+ header?: never;
316
+ path: {
317
+ institutionId: string;
318
+ classroomId: string;
319
+ };
320
+ cookie?: never;
321
+ };
322
+ requestBody?: never;
323
+ responses: {
324
+ 200: {
325
+ headers: {
326
+ [name: string]: unknown;
327
+ };
328
+ content: {
329
+ "application/json": {
330
+ status?: string;
331
+ data?: components["schemas"]["InstitutionClassroom"];
332
+ };
333
+ };
334
+ };
335
+ 401: components["responses"]["Unauthorized"];
336
+ 404: components["responses"]["NotFound"];
337
+ 500: components["responses"]["ServerError"];
338
+ };
339
+ }, {
340
+ params: {
341
+ path: {
342
+ institutionId: string;
343
+ classroomId: string;
344
+ };
345
+ };
346
+ }, `${string}/${string}`>>;
347
+ addClassroom(institutionId: string, data: CreateInstitutionClassroomDto): Promise<import("openapi-fetch").FetchResponse<{
348
+ parameters: {
349
+ query?: never;
350
+ header?: never;
351
+ path: {
352
+ institutionId: string;
353
+ };
354
+ cookie?: never;
355
+ };
356
+ requestBody: {
357
+ content: {
358
+ "application/json": components["schemas"]["CreateInstitutionClassroomDto"];
359
+ };
360
+ };
361
+ responses: {
362
+ 201: {
363
+ headers: {
364
+ [name: string]: unknown;
365
+ };
366
+ content: {
367
+ "application/json": {
368
+ status?: string;
369
+ data?: components["schemas"]["InstitutionClassroom"];
370
+ };
371
+ };
372
+ };
373
+ 400: components["responses"]["BadRequest"];
374
+ 401: components["responses"]["Unauthorized"];
375
+ 404: components["responses"]["NotFound"];
376
+ 409: components["responses"]["Conflict"];
377
+ 500: components["responses"]["ServerError"];
378
+ };
379
+ }, {
380
+ params: {
381
+ path: {
382
+ institutionId: string;
383
+ };
384
+ };
385
+ body: {
386
+ classroomId: string;
387
+ isActive: boolean;
388
+ };
389
+ }, `${string}/${string}`>>;
390
+ updateClassroom(institutionId: string, classroomId: string, data: UpdateInstitutionClassroomDto): Promise<import("openapi-fetch").FetchResponse<{
391
+ parameters: {
392
+ query?: never;
393
+ header?: never;
394
+ path: {
395
+ institutionId: string;
396
+ classroomId: string;
397
+ };
398
+ cookie?: never;
399
+ };
400
+ requestBody: {
401
+ content: {
402
+ "application/json": components["schemas"]["UpdateInstitutionClassroomDto"];
403
+ };
404
+ };
405
+ responses: {
406
+ 200: {
407
+ headers: {
408
+ [name: string]: unknown;
409
+ };
410
+ content: {
411
+ "application/json": {
412
+ status?: string;
413
+ data?: components["schemas"]["InstitutionClassroom"];
414
+ };
415
+ };
416
+ };
417
+ 400: components["responses"]["BadRequest"];
418
+ 401: components["responses"]["Unauthorized"];
419
+ 404: components["responses"]["NotFound"];
420
+ 500: components["responses"]["ServerError"];
421
+ };
422
+ }, {
423
+ params: {
424
+ path: {
425
+ institutionId: string;
426
+ classroomId: string;
427
+ };
428
+ };
429
+ body: {
430
+ isActive?: boolean;
431
+ };
432
+ }, `${string}/${string}`>>;
433
+ removeClassroom(institutionId: string, classroomId: string): Promise<import("openapi-fetch").FetchResponse<{
434
+ parameters: {
435
+ query?: never;
436
+ header?: never;
437
+ path: {
438
+ institutionId: string;
439
+ classroomId: string;
440
+ };
441
+ cookie?: never;
442
+ };
443
+ requestBody?: never;
444
+ responses: {
445
+ 204: {
446
+ headers: {
447
+ [name: string]: unknown;
448
+ };
449
+ content?: never;
450
+ };
451
+ 400: components["responses"]["BadRequest"];
452
+ 401: components["responses"]["Unauthorized"];
453
+ 404: components["responses"]["NotFound"];
454
+ 500: components["responses"]["ServerError"];
455
+ };
456
+ }, {
457
+ params: {
458
+ path: {
459
+ institutionId: string;
460
+ classroomId: string;
461
+ };
462
+ };
463
+ }, `${string}/${string}`>>;
464
+ getRegistrations(institutionId: string): Promise<import("openapi-fetch").FetchResponse<{
465
+ parameters: {
466
+ query?: never;
467
+ header?: never;
468
+ path: {
469
+ institutionId: string;
470
+ };
471
+ cookie?: never;
472
+ };
473
+ requestBody?: never;
474
+ responses: {
475
+ 200: {
476
+ headers: {
477
+ [name: string]: unknown;
478
+ };
479
+ content: {
480
+ "application/json": {
481
+ status?: string;
482
+ data?: components["schemas"]["InstitutionRegistration"][];
483
+ };
484
+ };
485
+ };
486
+ 401: components["responses"]["Unauthorized"];
487
+ 404: components["responses"]["NotFound"];
488
+ 500: components["responses"]["ServerError"];
489
+ };
490
+ }, {
491
+ params: {
492
+ path: {
493
+ institutionId: string;
494
+ };
495
+ };
496
+ }, `${string}/${string}`>>;
497
+ getRegistrationById(institutionId: string, registrationId: string): Promise<import("openapi-fetch").FetchResponse<{
498
+ parameters: {
499
+ query?: never;
500
+ header?: never;
501
+ path: {
502
+ institutionId: string;
503
+ registrationId: string;
504
+ };
505
+ cookie?: never;
506
+ };
507
+ requestBody?: never;
508
+ responses: {
509
+ 200: {
510
+ headers: {
511
+ [name: string]: unknown;
512
+ };
513
+ content: {
514
+ "application/json": {
515
+ status?: string;
516
+ data?: components["schemas"]["InstitutionRegistration"];
517
+ };
518
+ };
519
+ };
520
+ 401: components["responses"]["Unauthorized"];
521
+ 404: components["responses"]["NotFound"];
522
+ 500: components["responses"]["ServerError"];
523
+ };
524
+ }, {
525
+ params: {
526
+ path: {
527
+ institutionId: string;
528
+ registrationId: string;
529
+ };
530
+ };
531
+ }, `${string}/${string}`>>;
532
+ getRegistrationByUserId(institutionId: string, userId: string): Promise<import("openapi-fetch").FetchResponse<{
533
+ parameters: {
534
+ query?: never;
535
+ header?: never;
536
+ path: {
537
+ institutionId: string;
538
+ userId: string;
539
+ };
540
+ cookie?: never;
541
+ };
542
+ requestBody?: never;
543
+ responses: {
544
+ 200: {
545
+ headers: {
546
+ [name: string]: unknown;
547
+ };
548
+ content: {
549
+ "application/json": {
550
+ status?: string;
551
+ data?: components["schemas"]["InstitutionRegistration"];
552
+ };
553
+ };
554
+ };
555
+ 401: components["responses"]["Unauthorized"];
556
+ 404: components["responses"]["NotFound"];
557
+ 500: components["responses"]["ServerError"];
558
+ };
559
+ }, {
560
+ params: {
561
+ path: {
562
+ institutionId: string;
563
+ userId: string;
564
+ };
565
+ };
566
+ }, `${string}/${string}`>>;
567
+ registerUser(institutionId: string, data: CreateInstitutionRegistrationDto): Promise<import("openapi-fetch").FetchResponse<{
568
+ parameters: {
569
+ query?: never;
570
+ header?: never;
571
+ path: {
572
+ institutionId: string;
573
+ };
574
+ cookie?: never;
575
+ };
576
+ requestBody: {
577
+ content: {
578
+ "application/json": components["schemas"]["CreateInstitutionRegistrationDto"];
579
+ };
580
+ };
581
+ responses: {
582
+ 201: {
583
+ headers: {
584
+ [name: string]: unknown;
585
+ };
586
+ content: {
587
+ "application/json": {
588
+ status?: string;
589
+ data?: components["schemas"]["InstitutionRegistration"];
590
+ };
591
+ };
592
+ };
593
+ 400: components["responses"]["BadRequest"];
594
+ 401: components["responses"]["Unauthorized"];
595
+ 404: components["responses"]["NotFound"];
596
+ 409: components["responses"]["Conflict"];
597
+ 500: components["responses"]["ServerError"];
598
+ };
599
+ }, {
600
+ params: {
601
+ path: {
602
+ institutionId: string;
603
+ };
604
+ };
605
+ body: {
606
+ userId: string;
607
+ institutionClassroomId?: string | null;
608
+ isStudent: boolean;
609
+ isActive: boolean;
610
+ };
611
+ }, `${string}/${string}`>>;
612
+ updateRegistration(institutionId: string, registrationId: string, data: UpdateInstitutionRegistrationDto): Promise<import("openapi-fetch").FetchResponse<{
613
+ parameters: {
614
+ query?: never;
615
+ header?: never;
616
+ path: {
617
+ institutionId: string;
618
+ registrationId: string;
619
+ };
620
+ cookie?: never;
621
+ };
622
+ requestBody: {
623
+ content: {
624
+ "application/json": components["schemas"]["UpdateInstitutionRegistrationDto"];
625
+ };
626
+ };
627
+ responses: {
628
+ 200: {
629
+ headers: {
630
+ [name: string]: unknown;
631
+ };
632
+ content: {
633
+ "application/json": {
634
+ status?: string;
635
+ data?: components["schemas"]["InstitutionRegistration"];
636
+ };
637
+ };
638
+ };
639
+ 400: components["responses"]["BadRequest"];
640
+ 401: components["responses"]["Unauthorized"];
641
+ 404: components["responses"]["NotFound"];
642
+ 500: components["responses"]["ServerError"];
643
+ };
644
+ }, {
645
+ params: {
646
+ path: {
647
+ institutionId: string;
648
+ registrationId: string;
649
+ };
650
+ };
651
+ body: {
652
+ institutionClassroomId?: string | null;
653
+ isStudent?: boolean;
654
+ isActive?: boolean;
655
+ };
656
+ }, `${string}/${string}`>>;
657
+ assignUserToClassroom(institutionId: string, registrationId: string, data: AssignClassroomDto): Promise<import("openapi-fetch").FetchResponse<{
658
+ parameters: {
659
+ query?: never;
660
+ header?: never;
661
+ path: {
662
+ institutionId: string;
663
+ registrationId: string;
664
+ };
665
+ cookie?: never;
666
+ };
667
+ requestBody: {
668
+ content: {
669
+ "application/json": components["schemas"]["AssignClassroomDto"];
670
+ };
671
+ };
672
+ responses: {
673
+ 200: {
674
+ headers: {
675
+ [name: string]: unknown;
676
+ };
677
+ content: {
678
+ "application/json": {
679
+ status?: string;
680
+ data?: components["schemas"]["InstitutionRegistration"];
681
+ };
682
+ };
683
+ };
684
+ 400: components["responses"]["BadRequest"];
685
+ 401: components["responses"]["Unauthorized"];
686
+ 404: components["responses"]["NotFound"];
687
+ 500: components["responses"]["ServerError"];
688
+ };
689
+ }, {
690
+ params: {
691
+ path: {
692
+ institutionId: string;
693
+ registrationId: string;
694
+ };
695
+ };
696
+ body: {
697
+ institutionClassroomId?: string | null;
698
+ };
699
+ }, `${string}/${string}`>>;
700
+ removeRegistration(institutionId: string, registrationId: string): Promise<import("openapi-fetch").FetchResponse<{
701
+ parameters: {
702
+ query?: never;
703
+ header?: never;
704
+ path: {
705
+ institutionId: string;
706
+ registrationId: string;
707
+ };
708
+ cookie?: never;
709
+ };
710
+ requestBody?: never;
711
+ responses: {
712
+ 204: {
713
+ headers: {
714
+ [name: string]: unknown;
715
+ };
716
+ content?: never;
717
+ };
718
+ 400: components["responses"]["BadRequest"];
719
+ 401: components["responses"]["Unauthorized"];
720
+ 404: components["responses"]["NotFound"];
721
+ 500: components["responses"]["ServerError"];
722
+ };
723
+ }, {
724
+ params: {
725
+ path: {
726
+ institutionId: string;
727
+ registrationId: string;
728
+ };
729
+ };
730
+ }, `${string}/${string}`>>;
731
+ };
732
+ export type InstitutionService = ReturnType<typeof createInstitutionService>;
733
+ export {};