academe-kit 0.9.2 → 0.9.4

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