@examplary/sdk 2.0.1 → 2.1.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.mjs ADDED
@@ -0,0 +1,801 @@
1
+ // src/context.ts
2
+ import axios from "axios";
3
+
4
+ // src/error.ts
5
+ import {
6
+ AxiosError
7
+ } from "axios";
8
+ var ExamplaryError = class _ExamplaryError extends AxiosError {
9
+ constructor(message, code, config, request2, response) {
10
+ super(message, code, config, request2, response);
11
+ this.name = "ExamplaryError";
12
+ }
13
+ static fromAxiosError(error) {
14
+ const e = new _ExamplaryError(
15
+ error.message,
16
+ error.code,
17
+ error.config,
18
+ error.request,
19
+ error.response
20
+ );
21
+ const data = error.response?.data;
22
+ if (typeof data?.error === "string") {
23
+ e.originalMessage = error.message;
24
+ e.message = data.error;
25
+ } else if (typeof data?.error?.message === "string") {
26
+ e.originalMessage = error.message;
27
+ e.message = data.error.message;
28
+ }
29
+ return e;
30
+ }
31
+ };
32
+
33
+ // src/context.ts
34
+ var createClientContext = (options) => {
35
+ const { apiKey, baseUrl, headers, ...rest } = options;
36
+ const instance = axios.create({
37
+ baseURL: baseUrl ?? "https://api.examplary.ai",
38
+ ...rest,
39
+ headers: {
40
+ Authorization: `Bearer ${apiKey}`,
41
+ ...headers
42
+ }
43
+ });
44
+ instance.interceptors.response.use(
45
+ (response) => response,
46
+ (error) => Promise.reject(ExamplaryError.fromAxiosError(error))
47
+ );
48
+ return { axios: instance, apiKey };
49
+ };
50
+
51
+ // src/request.ts
52
+ var API_KEY_REGEX = /^examp_[A-Za-z0-9]+$/;
53
+ var request = async (ctx, method, pathTemplate, pathKeys, queryKeys, hasBody, args, options) => {
54
+ if (!API_KEY_REGEX.test(ctx.apiKey)) {
55
+ throw new ExamplaryError("Invalid API key");
56
+ }
57
+ const flat = args ?? {};
58
+ const url = pathTemplate.replace(/\{(\w+)\}/g, (_, key) => {
59
+ const value = flat[key];
60
+ if (value === void 0 || value === null) {
61
+ throw new ExamplaryError(`Missing required path parameter "${key}"`);
62
+ }
63
+ return encodeURIComponent(String(value));
64
+ });
65
+ const params = {};
66
+ for (const k of queryKeys) {
67
+ if (flat[k] !== void 0) params[k] = flat[k];
68
+ }
69
+ let data;
70
+ if (hasBody) {
71
+ const consumed = /* @__PURE__ */ new Set([...pathKeys, ...queryKeys]);
72
+ const body = {};
73
+ let any = false;
74
+ for (const [k, v] of Object.entries(flat)) {
75
+ if (consumed.has(k)) continue;
76
+ body[k] = v;
77
+ any = true;
78
+ }
79
+ if (any) data = body;
80
+ }
81
+ const response = await ctx.axios.request({
82
+ ...options,
83
+ method,
84
+ url,
85
+ params: Object.keys(params).length ? params : void 0,
86
+ data
87
+ });
88
+ return response.data;
89
+ };
90
+
91
+ // generated/sdk.ts
92
+ var QuestionTypes = class {
93
+ constructor(ctx) {
94
+ this.ctx = ctx;
95
+ }
96
+ listPublic(arg, options) {
97
+ const args = arg;
98
+ return request(this.ctx, "GET", "/question-types/public", [], [], false, args, options);
99
+ }
100
+ get(arg, options) {
101
+ const args = typeof arg === "string" ? { id: arg } : arg;
102
+ return request(this.ctx, "GET", "/question-types/{id}", ["id"], [], false, args, options);
103
+ }
104
+ delete(arg, options) {
105
+ const args = typeof arg === "string" ? { id: arg } : arg;
106
+ return request(this.ctx, "DELETE", "/question-types/{id}", ["id"], [], false, args, options);
107
+ }
108
+ getQti3Pci(arg, options) {
109
+ const args = typeof arg === "string" ? { questionTypeId: arg } : arg;
110
+ return request(this.ctx, "GET", "/question-types/{questionTypeId}/export/qti3-pci", ["questionTypeId"], [], false, args, options);
111
+ }
112
+ list(arg, options) {
113
+ const args = arg;
114
+ return request(this.ctx, "GET", "/question-types", [], [], false, args, options);
115
+ }
116
+ upsert(arg, options) {
117
+ const args = arg;
118
+ return request(this.ctx, "POST", "/question-types", [], [], true, args, options);
119
+ }
120
+ enable(arg, options) {
121
+ const args = typeof arg === "string" ? { questionTypeId: arg } : arg;
122
+ return request(this.ctx, "POST", "/question-types/{questionTypeId}/enable", ["questionTypeId"], [], false, args, options);
123
+ }
124
+ disable(arg, options) {
125
+ const args = typeof arg === "string" ? { questionTypeId: arg } : arg;
126
+ return request(this.ctx, "POST", "/question-types/{questionTypeId}/disable", ["questionTypeId"], [], false, args, options);
127
+ }
128
+ };
129
+ var LibraryPublishersItems = class {
130
+ constructor(ctx) {
131
+ this.ctx = ctx;
132
+ }
133
+ list(arg, options) {
134
+ const args = typeof arg === "string" ? { publisherId: arg } : arg;
135
+ return request(this.ctx, "GET", "/library/publishers/{publisherId}/items", ["publisherId"], [], false, args, options);
136
+ }
137
+ create(arg, options) {
138
+ const args = arg;
139
+ return request(this.ctx, "POST", "/library/publishers/{publisherId}/items", ["publisherId"], [], true, args, options);
140
+ }
141
+ };
142
+ var LibraryPublishers = class {
143
+ constructor(ctx) {
144
+ this.ctx = ctx;
145
+ this.items = new LibraryPublishersItems(this.ctx);
146
+ }
147
+ listFeatured(arg, options) {
148
+ const args = arg;
149
+ return request(this.ctx, "GET", "/library/publishers/featured", [], [], false, args, options);
150
+ }
151
+ listAll(arg, options) {
152
+ const args = arg;
153
+ return request(this.ctx, "GET", "/library/publishers", [], [], false, args, options);
154
+ }
155
+ create(arg, options) {
156
+ const args = arg;
157
+ return request(this.ctx, "POST", "/library/publishers", [], [], true, args, options);
158
+ }
159
+ listMine(arg, options) {
160
+ const args = arg;
161
+ return request(this.ctx, "GET", "/library/publishers/mine", [], [], false, args, options);
162
+ }
163
+ update(arg, options) {
164
+ const args = arg;
165
+ return request(this.ctx, "PATCH", "/library/publishers/{publisherId}", ["publisherId"], [], true, args, options);
166
+ }
167
+ delete(arg, options) {
168
+ const args = typeof arg === "string" ? { publisherId: arg } : arg;
169
+ return request(this.ctx, "DELETE", "/library/publishers/{publisherId}", ["publisherId"], [], false, args, options);
170
+ }
171
+ };
172
+ var LibraryItems = class {
173
+ constructor(ctx) {
174
+ this.ctx = ctx;
175
+ }
176
+ listFeatured(arg, options) {
177
+ const args = arg;
178
+ return request(this.ctx, "GET", "/library/items/featured", [], [], false, args, options);
179
+ }
180
+ update(arg, options) {
181
+ const args = arg;
182
+ return request(this.ctx, "PATCH", "/library/items/{itemId}", ["itemId"], [], true, args, options);
183
+ }
184
+ delete(arg, options) {
185
+ const args = typeof arg === "string" ? { itemId: arg } : arg;
186
+ return request(this.ctx, "DELETE", "/library/items/{itemId}", ["itemId"], [], false, args, options);
187
+ }
188
+ };
189
+ var Library = class {
190
+ constructor(ctx) {
191
+ this.ctx = ctx;
192
+ this.publishers = new LibraryPublishers(this.ctx);
193
+ this.items = new LibraryItems(this.ctx);
194
+ }
195
+ };
196
+ var Oauth = class {
197
+ constructor(ctx) {
198
+ this.ctx = ctx;
199
+ }
200
+ authorize(arg, options) {
201
+ const args = arg;
202
+ return request(this.ctx, "GET", "/oauth/authorize", [], ["response_type", "client_id", "redirect_uri", "scope", "state", "code_challenge", "code_challenge_method"], false, args, options);
203
+ }
204
+ token(arg, options) {
205
+ const args = arg;
206
+ return request(this.ctx, "POST", "/oauth/token", [], [], false, args, options);
207
+ }
208
+ };
209
+ var EmbedSessions = class {
210
+ constructor(ctx) {
211
+ this.ctx = ctx;
212
+ }
213
+ create(arg, options) {
214
+ const args = arg;
215
+ return request(this.ctx, "POST", "/embed-sessions", [], [], true, args, options);
216
+ }
217
+ get(arg, options) {
218
+ const args = typeof arg === "string" ? { id: arg } : arg;
219
+ return request(this.ctx, "GET", "/embed-sessions/{id}", ["id"], [], false, args, options);
220
+ }
221
+ revoke(arg, options) {
222
+ const args = typeof arg === "string" ? { id: arg } : arg;
223
+ return request(this.ctx, "DELETE", "/embed-sessions/{id}", ["id"], [], false, args, options);
224
+ }
225
+ };
226
+ var Me = class {
227
+ constructor(ctx) {
228
+ this.ctx = ctx;
229
+ }
230
+ get(arg, options) {
231
+ const args = arg;
232
+ return request(this.ctx, "GET", "/me", [], [], false, args, options);
233
+ }
234
+ update(arg, options) {
235
+ const args = arg;
236
+ return request(this.ctx, "PATCH", "/me", [], [], true, args, options);
237
+ }
238
+ };
239
+ var Media = class {
240
+ constructor(ctx) {
241
+ this.ctx = ctx;
242
+ }
243
+ upload(arg, options) {
244
+ const args = arg;
245
+ return request(this.ctx, "GET", "/media/upload", [], ["filename", "type", "contentType"], false, args, options);
246
+ }
247
+ };
248
+ var OrgCustomDomain = class {
249
+ constructor(ctx) {
250
+ this.ctx = ctx;
251
+ }
252
+ get(arg, options) {
253
+ const args = arg;
254
+ return request(this.ctx, "GET", "/org/custom-domain", [], [], false, args, options);
255
+ }
256
+ update(arg, options) {
257
+ const args = arg;
258
+ return request(this.ctx, "POST", "/org/custom-domain", [], [], true, args, options);
259
+ }
260
+ };
261
+ var Org = class {
262
+ constructor(ctx) {
263
+ this.ctx = ctx;
264
+ this.customDomain = new OrgCustomDomain(this.ctx);
265
+ }
266
+ get(arg, options) {
267
+ const args = arg;
268
+ return request(this.ctx, "GET", "/org", [], [], false, args, options);
269
+ }
270
+ update(arg, options) {
271
+ const args = arg;
272
+ return request(this.ctx, "PATCH", "/org", [], [], true, args, options);
273
+ }
274
+ delete(arg, options) {
275
+ const args = arg;
276
+ return request(this.ctx, "DELETE", "/org", [], [], false, args, options);
277
+ }
278
+ };
279
+ var Orgs = class {
280
+ constructor(ctx) {
281
+ this.ctx = ctx;
282
+ }
283
+ list(arg, options) {
284
+ const args = arg;
285
+ return request(this.ctx, "GET", "/orgs", [], [], false, args, options);
286
+ }
287
+ create(arg, options) {
288
+ const args = arg;
289
+ return request(this.ctx, "POST", "/orgs", [], [], true, args, options);
290
+ }
291
+ };
292
+ var ApiKeys = class {
293
+ constructor(ctx) {
294
+ this.ctx = ctx;
295
+ }
296
+ get(arg, options) {
297
+ const args = arg;
298
+ return request(this.ctx, "GET", "/api-keys", [], [], false, args, options);
299
+ }
300
+ reset(arg, options) {
301
+ const args = arg;
302
+ return request(this.ctx, "POST", "/api-keys/reset", [], [], false, args, options);
303
+ }
304
+ };
305
+ var Attributes = class {
306
+ constructor(ctx) {
307
+ this.ctx = ctx;
308
+ }
309
+ list(arg, options) {
310
+ const args = arg;
311
+ return request(this.ctx, "GET", "/attributes", [], [], false, args, options);
312
+ }
313
+ create(arg, options) {
314
+ const args = arg;
315
+ return request(this.ctx, "POST", "/attributes", [], [], true, args, options);
316
+ }
317
+ reorder(arg, options) {
318
+ const args = arg;
319
+ return request(this.ctx, "POST", "/attributes/reorder", [], [], true, args, options);
320
+ }
321
+ update(arg, options) {
322
+ const args = arg;
323
+ return request(this.ctx, "POST", "/attributes/{id}", ["id"], [], true, args, options);
324
+ }
325
+ delete(arg, options) {
326
+ const args = typeof arg === "string" ? { id: arg } : arg;
327
+ return request(this.ctx, "DELETE", "/attributes/{id}", ["id"], [], false, args, options);
328
+ }
329
+ };
330
+ var Taxonomies = class {
331
+ constructor(ctx) {
332
+ this.ctx = ctx;
333
+ }
334
+ list(arg, options) {
335
+ const args = arg;
336
+ return request(this.ctx, "GET", "/taxonomies", [], [], false, args, options);
337
+ }
338
+ create(arg, options) {
339
+ const args = arg;
340
+ return request(this.ctx, "POST", "/taxonomies", [], [], true, args, options);
341
+ }
342
+ update(arg, options) {
343
+ const args = arg;
344
+ return request(this.ctx, "POST", "/taxonomies/{id}", ["id"], [], true, args, options);
345
+ }
346
+ delete(arg, options) {
347
+ const args = typeof arg === "string" ? { id: arg } : arg;
348
+ return request(this.ctx, "DELETE", "/taxonomies/{id}", ["id"], [], false, args, options);
349
+ }
350
+ };
351
+ var Permissions = class {
352
+ constructor(ctx) {
353
+ this.ctx = ctx;
354
+ }
355
+ autocomplete(arg, options) {
356
+ const args = arg;
357
+ return request(this.ctx, "GET", "/permissions/autocomplete", [], ["q", "type"], false, args, options);
358
+ }
359
+ list(arg, options) {
360
+ const args = typeof arg === "string" ? { resource: arg } : arg;
361
+ return request(this.ctx, "GET", "/permissions/{resource}", ["resource"], [], false, args, options);
362
+ }
363
+ assign(arg, options) {
364
+ const args = arg;
365
+ return request(this.ctx, "POST", "/permissions/{resource}", ["resource"], [], true, args, options);
366
+ }
367
+ getActorRole(arg, options) {
368
+ const args = arg;
369
+ return request(this.ctx, "GET", "/permissions/{resource}/{actor}", ["actor", "resource"], [], false, args, options);
370
+ }
371
+ delete(arg, options) {
372
+ const args = arg;
373
+ return request(this.ctx, "DELETE", "/permissions/{resource}/{actor}", ["resource", "actor"], [], false, args, options);
374
+ }
375
+ };
376
+ var StudentLevels = class {
377
+ constructor(ctx) {
378
+ this.ctx = ctx;
379
+ }
380
+ list(arg, options) {
381
+ const args = arg;
382
+ return request(this.ctx, "GET", "/student-levels", [], [], false, args, options);
383
+ }
384
+ };
385
+ var Users = class {
386
+ constructor(ctx) {
387
+ this.ctx = ctx;
388
+ }
389
+ list(arg, options) {
390
+ const args = arg;
391
+ return request(this.ctx, "GET", "/users", [], [], false, args, options);
392
+ }
393
+ create(arg, options) {
394
+ const args = arg;
395
+ return request(this.ctx, "POST", "/users", [], [], true, args, options);
396
+ }
397
+ update(arg, options) {
398
+ const args = typeof arg === "string" ? { id: arg } : arg;
399
+ return request(this.ctx, "PATCH", "/users/{id}", ["id"], [], false, args, options);
400
+ }
401
+ delete(arg, options) {
402
+ const args = typeof arg === "string" ? { id: arg } : arg;
403
+ return request(this.ctx, "DELETE", "/users/{id}", ["id"], [], false, args, options);
404
+ }
405
+ };
406
+ var ExamsSessions = class {
407
+ constructor(ctx) {
408
+ this.ctx = ctx;
409
+ }
410
+ list(arg, options) {
411
+ const args = typeof arg === "string" ? { examId: arg } : arg;
412
+ return request(this.ctx, "GET", "/exams/{examId}/sessions", ["examId"], [], false, args, options);
413
+ }
414
+ import(arg, options) {
415
+ const args = arg;
416
+ return request(this.ctx, "POST", "/exams/{examId}/sessions", ["examId"], [], true, args, options);
417
+ }
418
+ scan(arg, options) {
419
+ const args = typeof arg === "string" ? { examId: arg } : arg;
420
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/scan", ["examId"], [], false, args, options);
421
+ }
422
+ scanDocument(arg, options) {
423
+ const args = arg;
424
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/scan-document", ["examId"], [], true, args, options);
425
+ }
426
+ get(arg, options) {
427
+ const args = arg;
428
+ return request(this.ctx, "GET", "/exams/{examId}/sessions/{sessionId}", ["examId", "sessionId"], [], false, args, options);
429
+ }
430
+ delete(arg, options) {
431
+ const args = arg;
432
+ return request(this.ctx, "DELETE", "/exams/{examId}/sessions/{sessionId}", ["examId", "sessionId"], [], false, args, options);
433
+ }
434
+ saveFeedback(arg, options) {
435
+ const args = arg;
436
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/{sessionId}/feedback", ["examId", "sessionId"], [], true, args, options);
437
+ }
438
+ saveOverallFeedback(arg, options) {
439
+ const args = arg;
440
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/{sessionId}/overall-feedback", ["examId", "sessionId"], [], true, args, options);
441
+ }
442
+ generateOverallFeedback(arg, options) {
443
+ const args = arg;
444
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/{sessionId}/generate-overall-feedback", ["examId", "sessionId"], [], false, args, options);
445
+ }
446
+ acceptAllSuggestions(arg, options) {
447
+ const args = arg;
448
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/{sessionId}/suggestions/accept-all", ["examId", "sessionId"], [], false, args, options);
449
+ }
450
+ acceptSuggestion(arg, options) {
451
+ const args = arg;
452
+ return request(this.ctx, "POST", "/exams/{examId}/sessions/{sessionId}/suggestions/{questionId}/accept", ["examId", "sessionId", "questionId"], [], false, args, options);
453
+ }
454
+ editAnswer(arg, options) {
455
+ const args = arg;
456
+ return request(this.ctx, "PATCH", "/exams/{examId}/sessions/{sessionId}/answers/{questionId}", ["examId", "sessionId", "questionId"], [], true, args, options);
457
+ }
458
+ };
459
+ var ExamsQuestions = class {
460
+ constructor(ctx) {
461
+ this.ctx = ctx;
462
+ }
463
+ import(arg, options) {
464
+ const args = arg;
465
+ return request(this.ctx, "POST", "/exams/{examId}/questions/import", ["examId"], [], true, args, options);
466
+ }
467
+ generate(arg, options) {
468
+ const args = arg;
469
+ return request(this.ctx, "POST", "/exams/{examId}/questions/generate", ["examId"], [], true, args, options);
470
+ }
471
+ get(arg, options) {
472
+ const args = arg;
473
+ return request(this.ctx, "GET", "/exams/{examId}/questions/{questionId}", ["examId", "questionId"], ["format"], false, args, options);
474
+ }
475
+ regenerate(arg, options) {
476
+ const args = arg;
477
+ return request(this.ctx, "POST", "/exams/{examId}/questions/{questionId}/generate", ["examId", "questionId"], [], true, args, options);
478
+ }
479
+ };
480
+ var ExamsExport = class {
481
+ constructor(ctx) {
482
+ this.ctx = ctx;
483
+ }
484
+ qti3Zip(arg, options) {
485
+ const args = typeof arg === "string" ? { examId: arg } : arg;
486
+ return request(this.ctx, "POST", "/exams/{examId}/export/qti3-zip", ["examId"], [], false, args, options);
487
+ }
488
+ qti21Zip(arg, options) {
489
+ const args = typeof arg === "string" ? { examId: arg } : arg;
490
+ return request(this.ctx, "POST", "/exams/{examId}/export/qti21-zip", ["examId"], [], false, args, options);
491
+ }
492
+ };
493
+ var Exams = class {
494
+ constructor(ctx) {
495
+ this.ctx = ctx;
496
+ this.sessions = new ExamsSessions(this.ctx);
497
+ this.questions = new ExamsQuestions(this.ctx);
498
+ this.export = new ExamsExport(this.ctx);
499
+ }
500
+ list(arg, options) {
501
+ const args = arg;
502
+ return request(this.ctx, "GET", "/exams", [], ["folder", "role"], false, args, options);
503
+ }
504
+ create(arg, options) {
505
+ const args = arg;
506
+ return request(this.ctx, "POST", "/exams", [], [], true, args, options);
507
+ }
508
+ import(arg, options) {
509
+ const args = arg;
510
+ return request(this.ctx, "POST", "/exams/import", [], [], true, args, options);
511
+ }
512
+ get(arg, options) {
513
+ const args = typeof arg === "string" ? { id: arg } : arg;
514
+ return request(this.ctx, "GET", "/exams/{id}", ["id"], [], false, args, options);
515
+ }
516
+ update(arg, options) {
517
+ const args = typeof arg === "string" ? { id: arg } : arg;
518
+ return request(this.ctx, "POST", "/exams/{id}", ["id"], [], false, args, options);
519
+ }
520
+ delete(arg, options) {
521
+ const args = typeof arg === "string" ? { id: arg } : arg;
522
+ return request(this.ctx, "DELETE", "/exams/{id}", ["id"], [], false, args, options);
523
+ }
524
+ duplicate(arg, options) {
525
+ const args = arg;
526
+ return request(this.ctx, "POST", "/exams/{examId}/duplicate", ["examId"], [], true, args, options);
527
+ }
528
+ print(arg, options) {
529
+ const args = typeof arg === "string" ? { examId: arg } : arg;
530
+ return request(this.ctx, "POST", "/exams/{examId}/print", ["examId"], [], false, args, options);
531
+ }
532
+ startGeneration(arg, options) {
533
+ const args = typeof arg === "string" ? { examId: arg } : arg;
534
+ return request(this.ctx, "POST", "/exams/{examId}/generate", ["examId"], [], false, args, options);
535
+ }
536
+ cancelGeneration(arg, options) {
537
+ const args = typeof arg === "string" ? { examId: arg } : arg;
538
+ return request(this.ctx, "POST", "/exams/{examId}/generate/cancel", ["examId"], [], false, args, options);
539
+ }
540
+ getContextSuggestions(arg, options) {
541
+ const args = typeof arg === "string" ? { examId: arg } : arg;
542
+ return request(this.ctx, "GET", "/exams/{examId}/context-suggestions", ["examId"], [], false, args, options);
543
+ }
544
+ };
545
+ var PracticeSpacesStudents = class {
546
+ constructor(ctx) {
547
+ this.ctx = ctx;
548
+ }
549
+ list(arg, options) {
550
+ const args = typeof arg === "string" ? { practiceSpaceId: arg } : arg;
551
+ return request(this.ctx, "GET", "/practice-spaces/{practiceSpaceId}/students", ["practiceSpaceId"], [], false, args, options);
552
+ }
553
+ get(arg, options) {
554
+ const args = arg;
555
+ return request(this.ctx, "GET", "/practice-spaces/{practiceSpaceId}/students/{studentId}", ["practiceSpaceId", "studentId"], [], false, args, options);
556
+ }
557
+ };
558
+ var PracticeSpacesSessions = class {
559
+ constructor(ctx) {
560
+ this.ctx = ctx;
561
+ }
562
+ create(arg, options) {
563
+ const args = arg;
564
+ return request(this.ctx, "POST", "/practice-spaces/{practiceSpaceId}/sessions", ["practiceSpaceId"], [], true, args, options);
565
+ }
566
+ getMine(arg, options) {
567
+ const args = typeof arg === "string" ? { practiceSpaceId: arg } : arg;
568
+ return request(this.ctx, "GET", "/practice-spaces/{practiceSpaceId}/sessions/mine", ["practiceSpaceId"], [], false, args, options);
569
+ }
570
+ get(arg, options) {
571
+ const args = arg;
572
+ return request(this.ctx, "GET", "/practice-spaces/{practiceSpaceId}/sessions/{sessionId}", ["practiceSpaceId", "sessionId"], [], false, args, options);
573
+ }
574
+ saveAnswer(arg, options) {
575
+ const args = arg;
576
+ return request(this.ctx, "POST", "/practice-spaces/{practiceSpaceId}/sessions/{sessionId}/answers/{questionId}", ["practiceSpaceId", "sessionId", "questionId"], [], true, args, options);
577
+ }
578
+ };
579
+ var PracticeSpaces = class {
580
+ constructor(ctx) {
581
+ this.ctx = ctx;
582
+ this.students = new PracticeSpacesStudents(this.ctx);
583
+ this.sessions = new PracticeSpacesSessions(this.ctx);
584
+ }
585
+ list(arg, options) {
586
+ const args = arg;
587
+ return request(this.ctx, "GET", "/practice-spaces", [], ["folder", "role"], false, args, options);
588
+ }
589
+ create(arg, options) {
590
+ const args = arg;
591
+ return request(this.ctx, "POST", "/practice-spaces", [], [], true, args, options);
592
+ }
593
+ get(arg, options) {
594
+ const args = typeof arg === "string" ? { id: arg } : arg;
595
+ return request(this.ctx, "GET", "/practice-spaces/{id}", ["id"], [], false, args, options);
596
+ }
597
+ update(arg, options) {
598
+ const args = arg;
599
+ return request(this.ctx, "PATCH", "/practice-spaces/{id}", ["id"], [], true, args, options);
600
+ }
601
+ delete(arg, options) {
602
+ const args = typeof arg === "string" ? { id: arg } : arg;
603
+ return request(this.ctx, "DELETE", "/practice-spaces/{id}", ["id"], [], false, args, options);
604
+ }
605
+ duplicate(arg, options) {
606
+ const args = arg;
607
+ return request(this.ctx, "POST", "/practice-spaces/{practiceSpaceId}/duplicate", ["practiceSpaceId"], [], true, args, options);
608
+ }
609
+ generateTopics(arg, options) {
610
+ const args = typeof arg === "string" ? { practiceSpaceId: arg } : arg;
611
+ return request(this.ctx, "POST", "/practice-spaces/{practiceSpaceId}/generate-topics", ["practiceSpaceId"], [], false, args, options);
612
+ }
613
+ cancelGenerateTopics(arg, options) {
614
+ const args = typeof arg === "string" ? { practiceSpaceId: arg } : arg;
615
+ return request(this.ctx, "POST", "/practice-spaces/{practiceSpaceId}/cancel-generate-topics", ["practiceSpaceId"], [], false, args, options);
616
+ }
617
+ questionsPreview(arg, options) {
618
+ const args = typeof arg === "string" ? { practiceSpaceId: arg } : arg;
619
+ return request(this.ctx, "GET", "/practice-spaces/{practiceSpaceId}/questions-preview", ["practiceSpaceId"], [], false, args, options);
620
+ }
621
+ getProgress(arg, options) {
622
+ const args = typeof arg === "string" ? { practiceSpaceId: arg } : arg;
623
+ return request(this.ctx, "GET", "/practice-spaces/{practiceSpaceId}/progress", ["practiceSpaceId"], [], false, args, options);
624
+ }
625
+ generateTopicFeedback(arg, options) {
626
+ const args = arg;
627
+ return request(this.ctx, "POST", "/practice-spaces/{practiceSpaceId}/progress/topic-feedback", ["practiceSpaceId"], [], true, args, options);
628
+ }
629
+ };
630
+ var SourceMaterials = class {
631
+ constructor(ctx) {
632
+ this.ctx = ctx;
633
+ }
634
+ list(arg, options) {
635
+ const args = arg;
636
+ return request(this.ctx, "GET", "/source-materials", [], ["externalId"], false, args, options);
637
+ }
638
+ create(arg, options) {
639
+ const args = arg;
640
+ return request(this.ctx, "POST", "/source-materials", [], [], true, args, options);
641
+ }
642
+ get(arg, options) {
643
+ const args = typeof arg === "string" ? { id: arg } : arg;
644
+ return request(this.ctx, "GET", "/source-materials/{id}", ["id"], [], false, args, options);
645
+ }
646
+ update(arg, options) {
647
+ const args = arg;
648
+ return request(this.ctx, "PATCH", "/source-materials/{id}", ["id"], [], true, args, options);
649
+ }
650
+ delete(arg, options) {
651
+ const args = typeof arg === "string" ? { id: arg } : arg;
652
+ return request(this.ctx, "DELETE", "/source-materials/{id}", ["id"], [], false, args, options);
653
+ }
654
+ slice(arg, options) {
655
+ const args = arg;
656
+ return request(this.ctx, "POST", "/source-materials/{sourceMaterialId}/slice", ["sourceMaterialId"], [], true, args, options);
657
+ }
658
+ };
659
+ var Folders = class {
660
+ constructor(ctx) {
661
+ this.ctx = ctx;
662
+ }
663
+ list(arg, options) {
664
+ const args = arg;
665
+ return request(this.ctx, "GET", "/folders", [], [], false, args, options);
666
+ }
667
+ create(arg, options) {
668
+ const args = arg;
669
+ return request(this.ctx, "POST", "/folders", [], [], true, args, options);
670
+ }
671
+ update(arg, options) {
672
+ const args = arg;
673
+ return request(this.ctx, "POST", "/folders/{id}", ["id"], [], true, args, options);
674
+ }
675
+ delete(arg, options) {
676
+ const args = typeof arg === "string" ? { id: arg } : arg;
677
+ return request(this.ctx, "DELETE", "/folders/{id}", ["id"], [], false, args, options);
678
+ }
679
+ };
680
+ var Groups = class {
681
+ constructor(ctx) {
682
+ this.ctx = ctx;
683
+ }
684
+ list(arg, options) {
685
+ const args = arg;
686
+ return request(this.ctx, "GET", "/groups", [], [], false, args, options);
687
+ }
688
+ create(arg, options) {
689
+ const args = arg;
690
+ return request(this.ctx, "POST", "/groups", [], [], true, args, options);
691
+ }
692
+ update(arg, options) {
693
+ const args = arg;
694
+ return request(this.ctx, "PATCH", "/groups/{id}", ["id"], [], true, args, options);
695
+ }
696
+ delete(arg, options) {
697
+ const args = typeof arg === "string" ? { id: arg } : arg;
698
+ return request(this.ctx, "DELETE", "/groups/{id}", ["id"], [], false, args, options);
699
+ }
700
+ listMembers(arg, options) {
701
+ const args = typeof arg === "string" ? { groupId: arg } : arg;
702
+ return request(this.ctx, "GET", "/groups/{groupId}/members", ["groupId"], [], false, args, options);
703
+ }
704
+ addMember(arg, options) {
705
+ const args = arg;
706
+ return request(this.ctx, "POST", "/groups/{groupId}/members", ["groupId"], [], true, args, options);
707
+ }
708
+ updateMember(arg, options) {
709
+ const args = arg;
710
+ return request(this.ctx, "PATCH", "/groups/{groupId}/members/{userId}", ["groupId", "userId"], [], true, args, options);
711
+ }
712
+ removeMember(arg, options) {
713
+ const args = arg;
714
+ return request(this.ctx, "DELETE", "/groups/{groupId}/members/{userId}", ["groupId", "userId"], [], false, args, options);
715
+ }
716
+ };
717
+ var QuestionBank = class {
718
+ constructor(ctx) {
719
+ this.ctx = ctx;
720
+ }
721
+ list(arg, options) {
722
+ const args = arg;
723
+ return request(this.ctx, "GET", "/question-bank", [], [], false, args, options);
724
+ }
725
+ create(arg, options) {
726
+ const args = arg;
727
+ return request(this.ctx, "POST", "/question-bank", [], [], true, args, options);
728
+ }
729
+ update(arg, options) {
730
+ const args = arg;
731
+ return request(this.ctx, "PATCH", "/question-bank/{id}", ["id"], [], true, args, options);
732
+ }
733
+ delete(arg, options) {
734
+ const args = typeof arg === "string" ? { id: arg } : arg;
735
+ return request(this.ctx, "DELETE", "/question-bank/{id}", ["id"], [], false, args, options);
736
+ }
737
+ };
738
+ var Jobs = class {
739
+ constructor(ctx) {
740
+ this.ctx = ctx;
741
+ }
742
+ get(arg, options) {
743
+ const args = typeof arg === "string" ? { id: arg } : arg;
744
+ return request(this.ctx, "GET", "/jobs/{id}", ["id"], [], false, args, options);
745
+ }
746
+ cancel(arg, options) {
747
+ const args = typeof arg === "string" ? { id: arg } : arg;
748
+ return request(this.ctx, "DELETE", "/jobs/{id}", ["id"], [], false, args, options);
749
+ }
750
+ };
751
+ var Examplary = class {
752
+ constructor(options) {
753
+ this.ctx = createClientContext(options);
754
+ this.questionTypes = new QuestionTypes(this.ctx);
755
+ this.library = new Library(this.ctx);
756
+ this.oauth = new Oauth(this.ctx);
757
+ this.embedSessions = new EmbedSessions(this.ctx);
758
+ this.me = new Me(this.ctx);
759
+ this.media = new Media(this.ctx);
760
+ this.org = new Org(this.ctx);
761
+ this.orgs = new Orgs(this.ctx);
762
+ this.apiKeys = new ApiKeys(this.ctx);
763
+ this.attributes = new Attributes(this.ctx);
764
+ this.taxonomies = new Taxonomies(this.ctx);
765
+ this.permissions = new Permissions(this.ctx);
766
+ this.studentLevels = new StudentLevels(this.ctx);
767
+ this.users = new Users(this.ctx);
768
+ this.exams = new Exams(this.ctx);
769
+ this.practiceSpaces = new PracticeSpaces(this.ctx);
770
+ this.sourceMaterials = new SourceMaterials(this.ctx);
771
+ this.folders = new Folders(this.ctx);
772
+ this.groups = new Groups(this.ctx);
773
+ this.questionBank = new QuestionBank(this.ctx);
774
+ this.jobs = new Jobs(this.ctx);
775
+ }
776
+ getRubrics(arg, options) {
777
+ const args = arg;
778
+ return request(this.ctx, "GET", "/rubrics", [], [], false, args, options);
779
+ }
780
+ postRubrics(arg, options) {
781
+ const args = arg;
782
+ return request(this.ctx, "POST", "/rubrics", [], [], true, args, options);
783
+ }
784
+ postRubricsGenerate(arg, options) {
785
+ const args = arg;
786
+ return request(this.ctx, "POST", "/rubrics/generate", [], [], true, args, options);
787
+ }
788
+ patchRubricsId(arg, options) {
789
+ const args = arg;
790
+ return request(this.ctx, "PATCH", "/rubrics/{id}", ["id"], [], true, args, options);
791
+ }
792
+ deleteRubricsId(arg, options) {
793
+ const args = typeof arg === "string" ? { id: arg } : arg;
794
+ return request(this.ctx, "DELETE", "/rubrics/{id}", ["id"], [], false, args, options);
795
+ }
796
+ };
797
+ export {
798
+ Examplary,
799
+ ExamplaryError
800
+ };
801
+ //# sourceMappingURL=index.mjs.map