academe-kit 0.1.9 → 0.2.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.
@@ -0,0 +1,792 @@
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
+ getUsers(institutionId: string, options?: {
465
+ classroomId?: string;
466
+ isStudent?: boolean;
467
+ isActive?: boolean;
468
+ hasCertificates?: boolean;
469
+ hasGuardian?: boolean;
470
+ search?: string;
471
+ page?: number;
472
+ limit?: number;
473
+ }): Promise<import("openapi-fetch").FetchResponse<{
474
+ parameters: {
475
+ query?: {
476
+ classroomId?: string;
477
+ isStudent?: boolean;
478
+ isActive?: boolean;
479
+ hasCertificates?: boolean;
480
+ hasGuardian?: boolean;
481
+ search?: string;
482
+ page?: number;
483
+ limit?: number;
484
+ };
485
+ header?: never;
486
+ path: {
487
+ institutionId: string;
488
+ };
489
+ cookie?: never;
490
+ };
491
+ requestBody?: never;
492
+ responses: {
493
+ 200: {
494
+ headers: {
495
+ [name: string]: unknown;
496
+ };
497
+ content: {
498
+ "application/json": components["schemas"]["InstitutionUserListResponse"];
499
+ };
500
+ };
501
+ 400: components["responses"]["BadRequest"];
502
+ 401: components["responses"]["Unauthorized"];
503
+ 404: components["responses"]["NotFound"];
504
+ 500: components["responses"]["ServerError"];
505
+ };
506
+ }, {
507
+ params: {
508
+ path: {
509
+ institutionId: string;
510
+ };
511
+ query: {
512
+ classroomId?: string;
513
+ isStudent?: boolean;
514
+ isActive?: boolean;
515
+ hasCertificates?: boolean;
516
+ hasGuardian?: boolean;
517
+ search?: string;
518
+ page?: number;
519
+ limit?: number;
520
+ } | undefined;
521
+ };
522
+ }, `${string}/${string}`>>;
523
+ getRegistrations(institutionId: string): Promise<import("openapi-fetch").FetchResponse<{
524
+ parameters: {
525
+ query?: never;
526
+ header?: never;
527
+ path: {
528
+ institutionId: string;
529
+ };
530
+ cookie?: never;
531
+ };
532
+ requestBody?: never;
533
+ responses: {
534
+ 200: {
535
+ headers: {
536
+ [name: string]: unknown;
537
+ };
538
+ content: {
539
+ "application/json": {
540
+ status?: string;
541
+ data?: components["schemas"]["InstitutionRegistration"][];
542
+ };
543
+ };
544
+ };
545
+ 401: components["responses"]["Unauthorized"];
546
+ 404: components["responses"]["NotFound"];
547
+ 500: components["responses"]["ServerError"];
548
+ };
549
+ }, {
550
+ params: {
551
+ path: {
552
+ institutionId: string;
553
+ };
554
+ };
555
+ }, `${string}/${string}`>>;
556
+ getRegistrationById(institutionId: string, registrationId: string): Promise<import("openapi-fetch").FetchResponse<{
557
+ parameters: {
558
+ query?: never;
559
+ header?: never;
560
+ path: {
561
+ institutionId: string;
562
+ registrationId: string;
563
+ };
564
+ cookie?: never;
565
+ };
566
+ requestBody?: never;
567
+ responses: {
568
+ 200: {
569
+ headers: {
570
+ [name: string]: unknown;
571
+ };
572
+ content: {
573
+ "application/json": {
574
+ status?: string;
575
+ data?: components["schemas"]["InstitutionRegistration"];
576
+ };
577
+ };
578
+ };
579
+ 401: components["responses"]["Unauthorized"];
580
+ 404: components["responses"]["NotFound"];
581
+ 500: components["responses"]["ServerError"];
582
+ };
583
+ }, {
584
+ params: {
585
+ path: {
586
+ institutionId: string;
587
+ registrationId: string;
588
+ };
589
+ };
590
+ }, `${string}/${string}`>>;
591
+ getRegistrationByUserId(institutionId: string, userId: string): Promise<import("openapi-fetch").FetchResponse<{
592
+ parameters: {
593
+ query?: never;
594
+ header?: never;
595
+ path: {
596
+ institutionId: string;
597
+ userId: string;
598
+ };
599
+ cookie?: never;
600
+ };
601
+ requestBody?: never;
602
+ responses: {
603
+ 200: {
604
+ headers: {
605
+ [name: string]: unknown;
606
+ };
607
+ content: {
608
+ "application/json": {
609
+ status?: string;
610
+ data?: components["schemas"]["InstitutionRegistration"];
611
+ };
612
+ };
613
+ };
614
+ 401: components["responses"]["Unauthorized"];
615
+ 404: components["responses"]["NotFound"];
616
+ 500: components["responses"]["ServerError"];
617
+ };
618
+ }, {
619
+ params: {
620
+ path: {
621
+ institutionId: string;
622
+ userId: string;
623
+ };
624
+ };
625
+ }, `${string}/${string}`>>;
626
+ registerUser(institutionId: string, data: CreateInstitutionRegistrationDto): Promise<import("openapi-fetch").FetchResponse<{
627
+ parameters: {
628
+ query?: never;
629
+ header?: never;
630
+ path: {
631
+ institutionId: string;
632
+ };
633
+ cookie?: never;
634
+ };
635
+ requestBody: {
636
+ content: {
637
+ "application/json": components["schemas"]["CreateInstitutionRegistrationDto"];
638
+ };
639
+ };
640
+ responses: {
641
+ 201: {
642
+ headers: {
643
+ [name: string]: unknown;
644
+ };
645
+ content: {
646
+ "application/json": {
647
+ status?: string;
648
+ data?: components["schemas"]["InstitutionRegistration"];
649
+ };
650
+ };
651
+ };
652
+ 400: components["responses"]["BadRequest"];
653
+ 401: components["responses"]["Unauthorized"];
654
+ 404: components["responses"]["NotFound"];
655
+ 409: components["responses"]["Conflict"];
656
+ 500: components["responses"]["ServerError"];
657
+ };
658
+ }, {
659
+ params: {
660
+ path: {
661
+ institutionId: string;
662
+ };
663
+ };
664
+ body: {
665
+ userId: string;
666
+ institutionClassroomId?: string | null;
667
+ isStudent: boolean;
668
+ isActive: boolean;
669
+ };
670
+ }, `${string}/${string}`>>;
671
+ updateRegistration(institutionId: string, registrationId: string, data: UpdateInstitutionRegistrationDto): Promise<import("openapi-fetch").FetchResponse<{
672
+ parameters: {
673
+ query?: never;
674
+ header?: never;
675
+ path: {
676
+ institutionId: string;
677
+ registrationId: string;
678
+ };
679
+ cookie?: never;
680
+ };
681
+ requestBody: {
682
+ content: {
683
+ "application/json": components["schemas"]["UpdateInstitutionRegistrationDto"];
684
+ };
685
+ };
686
+ responses: {
687
+ 200: {
688
+ headers: {
689
+ [name: string]: unknown;
690
+ };
691
+ content: {
692
+ "application/json": {
693
+ status?: string;
694
+ data?: components["schemas"]["InstitutionRegistration"];
695
+ };
696
+ };
697
+ };
698
+ 400: components["responses"]["BadRequest"];
699
+ 401: components["responses"]["Unauthorized"];
700
+ 404: components["responses"]["NotFound"];
701
+ 500: components["responses"]["ServerError"];
702
+ };
703
+ }, {
704
+ params: {
705
+ path: {
706
+ institutionId: string;
707
+ registrationId: string;
708
+ };
709
+ };
710
+ body: {
711
+ institutionClassroomId?: string | null;
712
+ isStudent?: boolean;
713
+ isActive?: boolean;
714
+ };
715
+ }, `${string}/${string}`>>;
716
+ assignUserToClassroom(institutionId: string, registrationId: string, data: AssignClassroomDto): Promise<import("openapi-fetch").FetchResponse<{
717
+ parameters: {
718
+ query?: never;
719
+ header?: never;
720
+ path: {
721
+ institutionId: string;
722
+ registrationId: string;
723
+ };
724
+ cookie?: never;
725
+ };
726
+ requestBody: {
727
+ content: {
728
+ "application/json": components["schemas"]["AssignClassroomDto"];
729
+ };
730
+ };
731
+ responses: {
732
+ 200: {
733
+ headers: {
734
+ [name: string]: unknown;
735
+ };
736
+ content: {
737
+ "application/json": {
738
+ status?: string;
739
+ data?: components["schemas"]["InstitutionRegistration"];
740
+ };
741
+ };
742
+ };
743
+ 400: components["responses"]["BadRequest"];
744
+ 401: components["responses"]["Unauthorized"];
745
+ 404: components["responses"]["NotFound"];
746
+ 500: components["responses"]["ServerError"];
747
+ };
748
+ }, {
749
+ params: {
750
+ path: {
751
+ institutionId: string;
752
+ registrationId: string;
753
+ };
754
+ };
755
+ body: {
756
+ institutionClassroomId?: string | null;
757
+ };
758
+ }, `${string}/${string}`>>;
759
+ removeRegistration(institutionId: string, registrationId: string): Promise<import("openapi-fetch").FetchResponse<{
760
+ parameters: {
761
+ query?: never;
762
+ header?: never;
763
+ path: {
764
+ institutionId: string;
765
+ registrationId: string;
766
+ };
767
+ cookie?: never;
768
+ };
769
+ requestBody?: never;
770
+ responses: {
771
+ 204: {
772
+ headers: {
773
+ [name: string]: unknown;
774
+ };
775
+ content?: never;
776
+ };
777
+ 400: components["responses"]["BadRequest"];
778
+ 401: components["responses"]["Unauthorized"];
779
+ 404: components["responses"]["NotFound"];
780
+ 500: components["responses"]["ServerError"];
781
+ };
782
+ }, {
783
+ params: {
784
+ path: {
785
+ institutionId: string;
786
+ registrationId: string;
787
+ };
788
+ };
789
+ }, `${string}/${string}`>>;
790
+ };
791
+ export type InstitutionService = ReturnType<typeof createInstitutionService>;
792
+ export {};