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