@timeback/qti 0.1.3 → 0.1.5

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.d.ts CHANGED
@@ -1,30 +1,1409 @@
1
+ import * as _timeback_internal_client_infra from '@timeback/internal-client-infra';
2
+ import { RequestOptions, PaginatedResponse, ClientConfig, TransportOnlyConfig, ProviderClientConfig, Paginator as Paginator$1, ListParams, BaseTransport, BaseTransportConfig, ProviderRegistry, TimebackProvider, AuthCheckResult } from '@timeback/internal-client-infra';
3
+ export { AuthCheckResult, EnvAuth, Environment, ExplicitAuth, ListParams, PageResult } from '@timeback/internal-client-infra';
4
+
1
5
  /**
2
- * QTI API client SDK for Timeback.
6
+ * API Response Types
7
+ *
8
+ * Types for QTI API responses.
9
+ */
10
+
11
+ // ═══════════════════════════════════════════════════════════════════════════════
12
+ // LIST RESPONSE
13
+ // ═══════════════════════════════════════════════════════════════════════════════
14
+
15
+ /**
16
+ * Paginated list response from QTI API.
17
+ *
18
+ * QTI returns pagination metadata directly in the response body alongside items.
19
+ */
20
+ interface ListResponse<T> {
21
+ /** Array of items in this page */
22
+ items: T[]
23
+ /** Total items across all pages */
24
+ total: number
25
+ /** Current page number (1-indexed) */
26
+ page: number
27
+ /** Total number of pages */
28
+ pages: number
29
+ /** Items per page */
30
+ limit: number
31
+ /** Sort field */
32
+ sort: string
33
+ /** Sort order */
34
+ order: 'asc' | 'desc'
35
+ }
36
+
37
+ // ═══════════════════════════════════════════════════════════════════════════════
38
+ // DELETE RESPONSE
39
+ // ═══════════════════════════════════════════════════════════════════════════════
40
+
41
+ /**
42
+ * Response from DELETE operations.
43
+ */
44
+ interface DeleteResponse {
45
+ message: string
46
+ }
47
+
48
+ /**
49
+ * Base Types
50
+ *
51
+ * Common types shared across QTI resources.
52
+ */
53
+
54
+ // ═══════════════════════════════════════════════════════════════════════════════
55
+ // ENUMS
56
+ // ═══════════════════════════════════════════════════════════════════════════════
57
+
58
+ /**
59
+ * Assessment item interaction types.
60
+ */
61
+ type AssessmentItemType =
62
+ | 'choice'
63
+ | 'text-entry'
64
+ | 'extended-text'
65
+ | 'inline-choice'
66
+ | 'match'
67
+ | 'order'
68
+ | 'associate'
69
+ | 'select-point'
70
+ | 'graphic-order'
71
+ | 'graphic-associate'
72
+ | 'graphic-gap-match'
73
+ | 'hotspot'
74
+ | 'hottext'
75
+ | 'slider'
76
+ | 'drawing'
77
+ | 'media'
78
+ | 'upload'
79
+
80
+ /**
81
+ * Cardinality of a response or outcome variable.
82
+ */
83
+ type Cardinality = 'single' | 'multiple' | 'ordered' | 'record'
84
+
85
+ /**
86
+ * Base type of a response or outcome variable.
87
+ */
88
+ type BaseType =
89
+ | 'identifier'
90
+ | 'boolean'
91
+ | 'integer'
92
+ | 'float'
93
+ | 'string'
94
+ | 'point'
95
+ | 'pair'
96
+ | 'directedPair'
97
+ | 'duration'
98
+ | 'file'
99
+ | 'uri'
100
+
101
+ /**
102
+ * Difficulty level for assessment items.
103
+ */
104
+ type Difficulty = 'easy' | 'medium' | 'hard'
105
+
106
+ /**
107
+ * Grade level (K-12 + pre-K as -1).
108
+ */
109
+ type Grade = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13
110
+
111
+ /**
112
+ * Navigation mode for test parts.
113
+ */
114
+ type NavigationMode = 'linear' | 'nonlinear'
115
+
116
+ /**
117
+ * Submission mode for test parts.
118
+ */
119
+ type SubmissionMode = 'individual' | 'simultaneous'
120
+
121
+ /**
122
+ * Show/hide indicator for feedback.
123
+ */
124
+ type ShowHide = 'show' | 'hide'
125
+
126
+ /**
127
+ * Feedback type.
128
+ */
129
+ type FeedbackType = 'QUESTION' | 'LESSON'
130
+
131
+ // ═══════════════════════════════════════════════════════════════════════════════
132
+ // COMMON STRUCTURES
133
+ // ═══════════════════════════════════════════════════════════════════════════════
134
+
135
+ /**
136
+ * Correct response value.
137
+ */
138
+ interface CorrectResponse {
139
+ value: string[]
140
+ }
141
+
142
+ /**
143
+ * Response declaration for assessment items.
144
+ */
145
+ interface ResponseDeclaration {
146
+ identifier: string
147
+ cardinality: Cardinality
148
+ baseType?: BaseType
149
+ correctResponse: CorrectResponse
150
+ }
151
+
152
+ /**
153
+ * Outcome declaration for items and tests.
154
+ */
155
+ interface OutcomeDeclaration {
156
+ identifier: string
157
+ cardinality: Cardinality
158
+ baseType?: BaseType
159
+ }
160
+
161
+ /**
162
+ * Test outcome declaration with additional properties.
163
+ */
164
+ interface TestOutcomeDeclaration {
165
+ identifier: string
166
+ cardinality?: Cardinality
167
+ baseType: BaseType
168
+ normalMaximum?: number
169
+ normalMinimum?: number
170
+ defaultValue?: {
171
+ value?: unknown
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Inline feedback configuration.
177
+ */
178
+ interface InlineFeedback {
179
+ outcomeIdentifier: string
180
+ variableIdentifier: string
181
+ }
182
+
183
+ /**
184
+ * Response processing configuration.
185
+ */
186
+ interface ResponseProcessing {
187
+ templateType: 'match_correct' | 'map_response'
188
+ responseDeclarationIdentifier: string
189
+ outcomeIdentifier: string
190
+ correctResponseIdentifier: string
191
+ incorrectResponseIdentifier: string
192
+ inlineFeedback?: InlineFeedback
193
+ }
194
+
195
+ /**
196
+ * Learning objective set for metadata.
197
+ */
198
+ interface LearningObjectiveSet {
199
+ source: string
200
+ learningObjectiveIds: string[]
201
+ }
202
+
203
+ /**
204
+ * Item metadata.
205
+ */
206
+ interface ItemMetadata {
207
+ subject?: string
208
+ grade?: Grade
209
+ difficulty?: Difficulty
210
+ learningObjectiveSet?: LearningObjectiveSet[]
211
+ }
212
+
213
+ /**
214
+ * Modal feedback element.
215
+ */
216
+ interface ModalFeedback {
217
+ outcomeIdentifier: string
218
+ identifier: string
219
+ showHide: ShowHide
220
+ content: string
221
+ title: string
222
+ }
223
+
224
+ /**
225
+ * Inline feedback element.
226
+ */
227
+ interface FeedbackInline {
228
+ outcomeIdentifier: string
229
+ identifier: string
230
+ showHide: ShowHide
231
+ content: string
232
+ class: string[]
233
+ }
234
+
235
+ /**
236
+ * Block feedback element.
237
+ */
238
+ interface FeedbackBlock {
239
+ outcomeIdentifier: string
240
+ identifier: string
241
+ showHide: ShowHide
242
+ content: string
243
+ class: string[]
244
+ }
245
+
246
+ /**
247
+ * Stylesheet reference.
248
+ */
249
+ interface Stylesheet {
250
+ href: string
251
+ type: string
252
+ }
253
+
254
+ /**
255
+ * Catalog info entry.
256
+ */
257
+ interface CatalogInfo {
258
+ id: string
259
+ support: string
260
+ content: string
261
+ }
262
+
263
+ /**
264
+ * Assessment Items Types
265
+ *
266
+ * Types for QTI assessment item resources.
267
+ */
268
+
269
+
270
+
271
+ // ═══════════════════════════════════════════════════════════════════════════════
272
+ // ASSESSMENT ITEM
273
+ // ═══════════════════════════════════════════════════════════════════════════════
274
+
275
+ /**
276
+ * Assessment item entity.
277
+ */
278
+ interface AssessmentItem {
279
+ identifier: string
280
+ title: string
281
+ type: AssessmentItemType
282
+ qtiVersion: string
283
+ timeDependent: boolean
284
+ adaptive: boolean
285
+ responseDeclarations?: ResponseDeclaration[]
286
+ outcomeDeclarations?: OutcomeDeclaration[]
287
+ responseProcessing?: ResponseProcessing
288
+ metadata?: ItemMetadata
289
+ /** Raw QTI XML string */
290
+ rawXml: string
291
+ /**
292
+ * Parsed XML→JSON content.
293
+ * Structure varies by item type.
294
+ */
295
+ content: Record<string, unknown>
296
+ modalFeedback?: ModalFeedback[]
297
+ feedbackInline?: FeedbackInline[]
298
+ feedbackBlock?: FeedbackBlock[]
299
+ createdAt: string
300
+ updatedAt: string
301
+ __v?: number
302
+ }
303
+
304
+ /**
305
+ * Result of processing a response.
306
+ */
307
+ interface ProcessResponseResult {
308
+ score: number
309
+ feedback: {
310
+ identifier: string
311
+ value: string
312
+ }
313
+ }
314
+
315
+ // ═══════════════════════════════════════════════════════════════════════════════
316
+ // SECTION ITEM REFERENCE
317
+ // ═══════════════════════════════════════════════════════════════════════════════
318
+
319
+ /**
320
+ * Reference to an assessment item within a section.
321
+ */
322
+ interface AssessmentItemRef {
323
+ identifier: string
324
+ /**
325
+ * Item reference href.
326
+ *
327
+ * The QTI docs show this field as `string` in most responses, but it can also
328
+ * appear as an array (and in one place, a nested array) in request/response
329
+ * examples for test-part payloads.
330
+ */
331
+ href?: string | string[] | string[][]
332
+ sequence?: number
333
+ }
334
+
335
+ // ═══════════════════════════════════════════════════════════════════════════════
336
+ // SECTION
337
+ // ═══════════════════════════════════════════════════════════════════════════════
338
+
339
+ /**
340
+ * Assessment section within a test part.
341
+ */
342
+ interface AssessmentSection {
343
+ identifier: string
344
+ title: string
345
+ visible: boolean
346
+ required?: boolean
347
+ fixed?: boolean
348
+ sequence?: number
349
+ 'qti-assessment-item-ref'?: AssessmentItemRef[]
350
+ }
351
+
352
+ // ═══════════════════════════════════════════════════════════════════════════════
353
+ // TEST PART
354
+ // ═══════════════════════════════════════════════════════════════════════════════
355
+
356
+ /**
357
+ * Test part within an assessment test.
358
+ */
359
+ interface TestPart {
360
+ identifier: string
361
+ navigationMode: NavigationMode
362
+ submissionMode: SubmissionMode
363
+ 'qti-assessment-section': AssessmentSection | AssessmentSection[]
364
+ }
365
+
366
+ // ═══════════════════════════════════════════════════════════════════════════════
367
+ // ASSESSMENT TEST
368
+ // ═══════════════════════════════════════════════════════════════════════════════
369
+
370
+ /**
371
+ * Assessment test entity.
372
+ */
373
+ interface AssessmentTest {
374
+ identifier: string
375
+ title: string
376
+ qtiVersion: string
377
+ 'qti-test-part': TestPart[]
378
+ 'qti-outcome-declaration': TestOutcomeDeclaration[]
379
+ timeLimit?: number
380
+ maxAttempts?: number
381
+ toolsEnabled?: Record<string, boolean>
382
+ metadata?: Record<string, unknown>
383
+ /** Raw QTI XML string */
384
+ rawXml: string
385
+ /**
386
+ * Parsed XML→JSON content.
387
+ * Structure varies by test.
388
+ */
389
+ content: Record<string, unknown>
390
+ createdAt: string
391
+ updatedAt: string
392
+ __v?: number
393
+ isValidXml?: boolean
394
+ }
395
+
396
+ // ═══════════════════════════════════════════════════════════════════════════════
397
+ // QUESTIONS RESPONSE
398
+ // ═══════════════════════════════════════════════════════════════════════════════
399
+
400
+ /**
401
+ * Question reference within a test.
402
+ */
403
+ interface QuestionReference {
404
+ identifier: string
405
+ href: string
406
+ testPart: string
407
+ section: string
408
+ }
409
+
410
+ /**
411
+ * Question with full item details.
412
+ */
413
+ interface QuestionWithItem {
414
+ reference: QuestionReference
415
+ question: AssessmentItem
416
+ }
417
+
418
+ /**
419
+ * Response from GET /assessment-tests/{identifier}/questions.
420
+ */
421
+ interface QuestionsResponse {
422
+ assessmentTest: string
423
+ title: string
424
+ totalQuestions: number
425
+ questions: QuestionWithItem[]
426
+ }
427
+
428
+ /**
429
+ * Lesson Types
430
+ *
431
+ * Types for QTI lesson and question feedback resources.
432
+ */
433
+
434
+
435
+
436
+ // ═══════════════════════════════════════════════════════════════════════════════
437
+ // LESSON FEEDBACK
438
+ // ═══════════════════════════════════════════════════════════════════════════════
439
+
440
+ /**
441
+ * Lesson feedback entity.
442
+ */
443
+ interface LessonFeedback {
444
+ questionId?: string
445
+ userId: string
446
+ feedback: string
447
+ type: FeedbackType
448
+ lessonId: string
449
+ humanApproved?: boolean | boolean[]
450
+ }
451
+
452
+ /**
453
+ * Stimuli Types
454
+ *
455
+ * Types for QTI stimulus resources.
456
+ */
457
+
458
+
459
+
460
+ // ═══════════════════════════════════════════════════════════════════════════════
461
+ // STIMULUS
462
+ // ═══════════════════════════════════════════════════════════════════════════════
463
+
464
+ /**
465
+ * Stimulus entity.
466
+ */
467
+ interface Stimulus {
468
+ identifier: string
469
+ title: string
470
+ label?: string
471
+ language?: string
472
+ stylesheet?: Stylesheet
473
+ catalogInfo: CatalogInfo[]
474
+ toolName?: string
475
+ toolVersion?: string
476
+ metadata?: Record<string, unknown>
477
+ /** Raw QTI XML string */
478
+ rawXml: string
479
+ /**
480
+ * Parsed XML→JSON content.
481
+ * Structure varies.
482
+ */
483
+ content: Record<string, unknown>
484
+ createdAt: string
485
+ updatedAt: string
486
+ __v?: number
487
+ }
488
+
489
+ /**
490
+ * Validation Types
491
+ *
492
+ * Types for QTI XML validation resources.
493
+ */
494
+
495
+ // ═══════════════════════════════════════════════════════════════════════════════
496
+ // VALIDATION
497
+ // ═══════════════════════════════════════════════════════════════════════════════
498
+
499
+ /**
500
+ * Single validation result.
501
+ */
502
+ interface ValidationResult {
503
+ success: boolean
504
+ entityId: string
505
+ xmlContent: string
506
+ validationErrors: string[]
507
+ message: string
508
+ }
509
+
510
+ /**
511
+ * Batch validation result.
512
+ */
513
+ interface BatchValidationResult {
514
+ results: ValidationResult[]
515
+ }
516
+
517
+ /**
518
+ * Transport interface for QTI client.
519
+ *
520
+ * Required when using transport mode with QtiClient.
521
+ */
522
+ interface QtiTransportLike {
523
+ /** Base URL of the API */
524
+ baseUrl: string;
525
+ /** Make an authenticated request */
526
+ request<T>(path: string, options?: RequestOptions): Promise<T>;
527
+ /** Make a paginated request */
528
+ requestPaginated<T>(path: string, options?: RequestOptions): Promise<PaginatedResponse<T>>;
529
+ }
530
+ /**
531
+ * All supported QTI client configuration types.
532
+ *
533
+ * Supports four modes:
534
+ * - **Provider mode**: `{ provider: TimebackProvider }` — pre-built provider with token sharing
535
+ * - **Environment mode**: `{ platform?, env, auth }` — Timeback hosted APIs
536
+ * - **Explicit mode**: `{ baseUrl, auth: { authUrl } }` — custom API URLs
537
+ * - **Transport mode**: `{ transport }` — custom transport
538
+ *
539
+ * The `platform` field (in env mode) selects which Timeback implementation to use:
540
+ * - `'BEYOND_AI'` (default): BeyondAI's Timeback platform
541
+ * - `'LEARNWITH_AI'`: Samy's LearnWith.AI platform
542
+ */
543
+ type QtiClientConfig = ClientConfig | TransportOnlyConfig<QtiTransportLike> | ProviderClientConfig;
544
+ /**
545
+ * Instance type of QtiClient.
546
+ */
547
+ type QtiClientInstance = InstanceType<typeof QtiClient>;
548
+
549
+ /**
550
+ * Pagination Utilities
551
+ *
552
+ * Re-exports the common Paginator with QTI-specific configuration.
553
+ */
554
+
555
+ /**
556
+ * QTI-specific Paginator that uses page-based pagination.
557
+ *
558
+ * QTI APIs use `page` and `limit` params (1-indexed pages) instead of
559
+ * `offset` and `limit`. The base Paginator handles this via `paginationStyle: 'page'`.
560
+ *
561
+ * @typeParam T - The type of items being paginated
562
+ */
563
+ declare class Paginator<T> extends Paginator$1<T> {
564
+ /**
565
+ * Create a new QTI Paginator.
566
+ *
567
+ * @param transport - QTI transport instance
568
+ * @param path - API endpoint path
569
+ * @param params - List parameters including optional max
570
+ */
571
+ constructor(transport: QtiTransportLike, path: string, params?: ListParams);
572
+ }
573
+
574
+ /**
575
+ * Transport Layer
576
+ *
577
+ * HTTP transport for QTI API communication.
578
+ */
579
+
580
+ /**
581
+ * Configuration for QTI transport.
582
+ */
583
+ type QtiTransportConfig = BaseTransportConfig;
584
+ /**
585
+ * HTTP transport layer for QTI API communication.
586
+ *
587
+ * Uses body-based pagination with page/limit params.
588
+ */
589
+ declare class Transport extends BaseTransport {
590
+ constructor(config: QtiTransportConfig);
591
+ /**
592
+ * Make a paginated request using body-based pagination.
593
+ *
594
+ * QTI APIs return pagination metadata in the response body:
595
+ * - `items`: Array of items
596
+ * - `total`: Total items across all pages
597
+ * - `pages`: Total number of pages
598
+ * - `page`: Current page (1-indexed)
599
+ * - `limit`: Items per page
600
+ * - `sort`: Sort field
601
+ * - `order`: Sort order
602
+ *
603
+ * @template T - Expected item type in the response
604
+ * @param path - API endpoint path
605
+ * @param options - Request options
606
+ * @returns Normalized paginated response for Paginator compatibility
607
+ */
608
+ requestPaginated<T>(path: string, options?: RequestOptions): Promise<PaginatedResponse<T>>;
609
+ }
610
+
611
+ type input<T> = T extends {
612
+ _zod: {
613
+ input: any;
614
+ };
615
+ } ? T["_zod"]["input"] : unknown;
616
+
617
+ /**
618
+ * QTI Schemas
619
+ *
620
+ * Strict Zod schemas for QTI-related CLI/API inputs.
621
+ *
622
+ * These are intentionally "full-shape" schemas so CLI code can validate input
623
+ * and then pass typed values directly into the QTI SDK without widening/casting.
624
+ */
625
+
626
+
627
+
628
+ // ═══════════════════════════════════════════════════════════════════════════════
629
+ // LIST PARAMS
630
+ // ═══════════════════════════════════════════════════════════════════════════════
631
+
632
+ declare const QtiPaginationParams = z
633
+ .object({
634
+ page: z.number().int().positive().optional(),
635
+ limit: z.number().int().positive().optional(),
636
+ sort: z.string().optional(),
637
+ order: z.enum(['asc', 'desc']).optional(),
638
+ })
639
+ .strict()
640
+
641
+ // ═══════════════════════════════════════════════════════════════════════════════
642
+ // ASSESSMENT ITEMS (REQUEST INPUTS)
643
+ // ═══════════════════════════════════════════════════════════════════════════════
644
+
645
+ /**
646
+ * XML-format creation input.
647
+ *
648
+ * The preferred way to create assessment items — send raw QTI 3.0 XML and the
649
+ * server validates it against IMS QTI XSDs.
650
+ */
651
+ declare const QtiAssessmentItemXmlCreateInput = z
652
+ .object({
653
+ format: z.string().pipe(z.literal('xml')),
654
+ xml: z.string().min(1),
655
+ metadata: QtiItemMetadata.optional(),
656
+ })
657
+ .strict()
658
+
659
+ /**
660
+ * JSON-format creation input (experimental on the server side).
661
+ *
662
+ * Sends a structured/parsed representation of a QTI item.
663
+ */
664
+ declare const QtiAssessmentItemJsonCreateInput = z
665
+ .object({
666
+ identifier: z.string().min(1),
667
+ title: z.string().min(1),
668
+ type: QtiAssessmentItemType,
669
+ qtiVersion: z.string().optional(),
670
+ timeDependent: z.boolean().optional(),
671
+ adaptive: z.boolean().optional(),
672
+ responseDeclarations: z.array(QtiResponseDeclaration).optional(),
673
+ outcomeDeclarations: z.array(QtiOutcomeDeclaration).optional(),
674
+ responseProcessing: QtiResponseProcessing.optional(),
675
+ metadata: QtiItemMetadata.optional(),
676
+ modalFeedback: z.array(QtiModalFeedback).optional(),
677
+ feedbackInline: z.array(QtiFeedbackInline).optional(),
678
+ feedbackBlock: z.array(QtiFeedbackBlock).optional(),
679
+ })
680
+ .strict()
681
+
682
+ /**
683
+ * Union of XML and JSON creation inputs for assessment items.
684
+ *
685
+ * Accepts either `{ format: 'xml', xml, metadata? }` or the structured JSON
686
+ * shape with `{ identifier, title, type, ... }`.
687
+ */
688
+ declare const QtiAssessmentItemCreateInput = z.union([
689
+ QtiAssessmentItemXmlCreateInput,
690
+ QtiAssessmentItemJsonCreateInput,
691
+ ])
692
+
693
+ declare const QtiAssessmentItemUpdateInput = z
694
+ .object({
695
+ identifier: z.string().min(1).optional(),
696
+ title: z.string().min(1),
697
+ type: QtiAssessmentItemType,
698
+ qtiVersion: z.string().optional(),
699
+ timeDependent: z.boolean().optional(),
700
+ adaptive: z.boolean().optional(),
701
+ responseDeclarations: z.array(QtiResponseDeclaration).optional(),
702
+ outcomeDeclarations: z.array(QtiOutcomeDeclaration).optional(),
703
+ responseProcessing: QtiResponseProcessing.optional(),
704
+ metadata: QtiItemMetadata.optional(),
705
+ modalFeedback: z.array(QtiModalFeedback).optional(),
706
+ feedbackInline: z.array(QtiFeedbackInline).optional(),
707
+ feedbackBlock: z.array(QtiFeedbackBlock).optional(),
708
+ rawXml: z.string(),
709
+ content: z.record(z.string(), z.unknown()),
710
+ })
711
+ .strict()
712
+
713
+ declare const QtiAssessmentItemProcessResponseInput = z
714
+ .object({
715
+ response: z.union([z.string(), z.array(z.string())]),
716
+ })
717
+ .strict()
718
+
719
+ // ═══════════════════════════════════════════════════════════════════════════════
720
+ // ASSESSMENT TESTS (REQUEST INPUTS)
721
+ // ═══════════════════════════════════════════════════════════════════════════════
722
+
723
+ declare const QtiAssessmentItemRef = z
724
+ .object({
725
+ identifier: z.string().min(1),
726
+ href: z.union([z.string(), z.array(z.string()), z.array(z.array(z.string()))]).optional(),
727
+ sequence: z.number().optional(),
728
+ })
729
+ .strict()
730
+
731
+ declare const QtiAssessmentSection = z
732
+ .object({
733
+ identifier: z.string().min(1),
734
+ title: z.string().min(1),
735
+ visible: z.boolean(),
736
+ required: z.boolean().optional(),
737
+ fixed: z.boolean().optional(),
738
+ sequence: z.number().optional(),
739
+ 'qti-assessment-item-ref': z.array(QtiAssessmentItemRef).optional(),
740
+ })
741
+ .strict()
742
+
743
+ declare const QtiTestPart = z
744
+ .object({
745
+ identifier: z.string().min(1),
746
+ navigationMode: z.string().pipe(QtiNavigationMode),
747
+ submissionMode: z.string().pipe(QtiSubmissionMode),
748
+ 'qti-assessment-section': z.array(QtiAssessmentSection),
749
+ })
750
+ .strict()
751
+
752
+ declare const QtiReorderItemsInput = z
753
+ .object({
754
+ items: z.array(QtiAssessmentItemRef).min(1),
755
+ })
756
+ .strict()
757
+
758
+ declare const QtiAssessmentTestMetadataUpdateInput = z
759
+ .object({
760
+ metadata: z.record(z.string(), z.unknown()).optional(),
761
+ })
762
+ .strict()
763
+
764
+ declare const QtiAssessmentTestCreateInput = z
765
+ .object({
766
+ identifier: z.string().min(1),
767
+ title: z.string().min(1),
768
+ qtiVersion: z.string().optional(),
769
+ toolName: z.string().optional(),
770
+ toolVersion: z.string().optional(),
771
+ timeLimit: z.number().optional(),
772
+ maxAttempts: z.number().optional(),
773
+ toolsEnabled: z.record(z.string(), z.boolean()).optional(),
774
+ metadata: z.record(z.string(), z.unknown()).optional(),
775
+ 'qti-test-part': z.array(QtiTestPart),
776
+ 'qti-outcome-declaration': z.array(QtiTestOutcomeDeclaration).optional(),
777
+ })
778
+ .strict()
779
+
780
+ declare const QtiAssessmentTestUpdateInput = z
781
+ .object({
782
+ identifier: z.string().min(1).optional(),
783
+ title: z.string().min(1),
784
+ qtiVersion: z.string().optional(),
785
+ toolName: z.string().optional(),
786
+ toolVersion: z.string().optional(),
787
+ timeLimit: z.number().optional(),
788
+ maxAttempts: z.number().optional(),
789
+ toolsEnabled: z.record(z.string(), z.boolean()).optional(),
790
+ metadata: z.record(z.string(), z.unknown()).optional(),
791
+ 'qti-test-part': z.array(QtiTestPart),
792
+ 'qti-outcome-declaration': z.array(QtiTestOutcomeDeclaration).optional(),
793
+ })
794
+ .strict()
795
+
796
+ // ═══════════════════════════════════════════════════════════════════════════════
797
+ // STIMULI (REQUEST INPUTS)
798
+ // ═══════════════════════════════════════════════════════════════════════════════
799
+
800
+ declare const QtiStimulusCreateInput = z
801
+ .object({
802
+ identifier: z.string().min(1),
803
+ title: z.string().min(1),
804
+ label: z.string().optional(),
805
+ language: z.string().optional(),
806
+ stylesheet: QtiStylesheet.optional(),
807
+ content: z.string(),
808
+ catalogInfo: z.array(QtiCatalogInfo).optional(),
809
+ toolName: z.string().optional(),
810
+ toolVersion: z.string().optional(),
811
+ metadata: z.record(z.string(), z.unknown()).optional(),
812
+ })
813
+ .strict()
814
+
815
+ declare const QtiStimulusUpdateInput = z
816
+ .object({
817
+ identifier: z.string().min(1).optional(),
818
+ title: z.string().min(1),
819
+ label: z.string().optional(),
820
+ language: z.string().optional(),
821
+ stylesheet: QtiStylesheet.optional(),
822
+ content: z.string(),
823
+ catalogInfo: z.array(QtiCatalogInfo).optional(),
824
+ toolName: z.string().optional(),
825
+ toolVersion: z.string().optional(),
826
+ metadata: z.record(z.string(), z.unknown()).optional(),
827
+ })
828
+ .strict()
829
+
830
+ // ═══════════════════════════════════════════════════════════════════════════════
831
+ // VALIDATION (REQUEST INPUTS)
832
+ // ═══════════════════════════════════════════════════════════════════════════════
833
+
834
+ declare const QtiValidateInput = z
835
+ .object({
836
+ xml: z.string().optional(),
837
+ schema: QtiValidationSchema,
838
+ entityId: z.string().optional(),
839
+ })
840
+ .strict()
841
+
842
+ declare const QtiValidateBatchInput = z
843
+ .object({
844
+ xml: z.array(z.string()),
845
+ schema: QtiValidationSchema,
846
+ entityIds: z.array(z.string()),
847
+ })
848
+ .strict()
849
+
850
+ // ═══════════════════════════════════════════════════════════════════════════════
851
+ // LESSON FEEDBACK (REQUEST INPUTS)
852
+ // ═══════════════════════════════════════════════════════════════════════════════
853
+
854
+ declare const QtiLessonFeedbackInput = z
855
+ .object({
856
+ questionId: z.string().optional(),
857
+ userId: z.string().min(1),
858
+ feedback: z.string().min(1),
859
+ lessonId: z.string().min(1),
860
+ humanApproved: z.boolean().optional(),
861
+ })
862
+ .strict()
863
+
864
+ type ListAssessmentTestsParams = input<typeof QtiPaginationParams>
865
+ type ListTestPartsParams = input<typeof QtiPaginationParams>
866
+ type ListSectionsParams = input<typeof QtiPaginationParams>
867
+ type ListAssessmentItemsParams = input<typeof QtiPaginationParams>
868
+ type ListStimuliParams = input<typeof QtiPaginationParams>
869
+
870
+ type CreateAssessmentTestRequest = input<typeof QtiAssessmentTestCreateInput>
871
+ type UpdateAssessmentTestRequest = input<typeof QtiAssessmentTestUpdateInput>
872
+ type UpdateTestMetadataRequest = input<typeof QtiAssessmentTestMetadataUpdateInput>
873
+ type CreateTestPartRequest = input<typeof QtiTestPart>
874
+ type UpdateTestPartRequest = input<typeof QtiTestPart>
875
+ type CreateSectionRequest = input<typeof QtiAssessmentSection>
876
+ type UpdateSectionRequest = input<typeof QtiAssessmentSection>
877
+ type AddItemRequest = input<typeof QtiAssessmentItemRef>
878
+ type ReorderItemsRequest = input<typeof QtiReorderItemsInput>
879
+
880
+ type CreateAssessmentItemXmlRequest = input<typeof QtiAssessmentItemXmlCreateInput>
881
+ type CreateAssessmentItemJsonRequest = input<typeof QtiAssessmentItemJsonCreateInput>
882
+ type CreateAssessmentItemRequest = input<typeof QtiAssessmentItemCreateInput>
883
+ type UpdateAssessmentItemRequest = input<typeof QtiAssessmentItemUpdateInput>
884
+ type ProcessResponseRequest = input<typeof QtiAssessmentItemProcessResponseInput>
885
+
886
+ type CreateStimulusRequest = input<typeof QtiStimulusCreateInput>
887
+ type UpdateStimulusRequest = input<typeof QtiStimulusUpdateInput>
888
+
889
+ type ValidateRequest = input<typeof QtiValidateInput>
890
+ type ValidateBatchRequest = input<typeof QtiValidateBatchInput>
891
+
892
+ type SubmitLessonRequest = input<typeof QtiLessonFeedbackInput>
893
+ type SubmitQuestionRequest = input<typeof QtiLessonFeedbackInput>
894
+
895
+ /**
896
+ * Assessment Items Resource
897
+ *
898
+ * CRUD operations for QTI assessment items.
899
+ */
900
+
901
+ /**
902
+ * Assessment items resource for managing QTI assessment items.
903
+ *
904
+ * Provides methods to list, get, create, update, delete items,
905
+ * and process responses.
906
+ */
907
+ declare class AssessmentItemsResource {
908
+ private readonly transport;
909
+ constructor(transport: Transport);
910
+ /**
911
+ * List assessment items with pagination.
912
+ *
913
+ * @param params - Pagination and filter parameters
914
+ * @returns Paginated list of assessment items
915
+ */
916
+ list(params?: ListAssessmentItemsParams): Promise<ListResponse<AssessmentItem>>;
917
+ /**
918
+ * Stream assessment items with automatic pagination.
919
+ *
920
+ * QTI list endpoints use page-based pagination; this returns a Paginator
921
+ * that converts to the correct `page`/`limit` params.
922
+ *
923
+ * @param params - Optional pagination params (offset/limit) + max cap
924
+ * @returns Paginator for async iteration
925
+ */
926
+ stream(params?: ListParams & {
927
+ max?: number;
928
+ }): Paginator<AssessmentItem>;
929
+ /**
930
+ * Get a single assessment item by identifier.
931
+ *
932
+ * @param identifier - Assessment item identifier
933
+ * @returns The assessment item
934
+ */
935
+ get(identifier: string): Promise<AssessmentItem>;
936
+ /**
937
+ * Create a new assessment item.
938
+ *
939
+ * @param body - Assessment item data
940
+ * @returns The created assessment item
941
+ */
942
+ create(body: CreateAssessmentItemRequest): Promise<AssessmentItem>;
943
+ /**
944
+ * Update an assessment item.
945
+ *
946
+ * @param identifier - Assessment item identifier
947
+ * @param body - Updated assessment item data
948
+ * @returns The updated assessment item
949
+ */
950
+ update(identifier: string, body: UpdateAssessmentItemRequest): Promise<AssessmentItem>;
951
+ /**
952
+ * Delete an assessment item.
953
+ *
954
+ * @param identifier - Assessment item identifier
955
+ * @returns Delete response
956
+ */
957
+ delete(identifier: string): Promise<DeleteResponse>;
958
+ /**
959
+ * Process a response for an assessment item.
960
+ *
961
+ * Validates and scores the response against the item's correct answer.
962
+ *
963
+ * @param identifier - Assessment item identifier
964
+ * @param body - Response to process
965
+ * @returns Score and feedback
966
+ */
967
+ processResponse(identifier: string, body: Omit<ProcessResponseRequest, 'identifier'>): Promise<ProcessResponseResult>;
968
+ /**
969
+ * Create an assessment item from raw QTI 3.0 XML.
970
+ *
971
+ * This is the preferred creation method — the server validates the XML
972
+ * against IMS QTI XSDs. Optionally include metadata (subject, grade, etc.).
973
+ *
974
+ * @param body - XML string and optional metadata
975
+ * @returns The created assessment item
976
+ *
977
+ * @example
978
+ * ```typescript
979
+ * const item = await client.assessmentItems.createFromXml({
980
+ * format: 'xml',
981
+ * xml: '<qti-assessment-item ...>...</qti-assessment-item>',
982
+ * metadata: { subject: 'Math', difficulty: 'easy' },
983
+ * })
984
+ * ```
985
+ */
986
+ createFromXml(body: CreateAssessmentItemXmlRequest): Promise<AssessmentItem>;
987
+ /**
988
+ * Create an assessment item from metadata.
989
+ *
990
+ * Alternative creation endpoint that accepts metadata-focused input.
991
+ *
992
+ * @param body - Assessment item metadata
993
+ * @returns The created assessment item
994
+ */
995
+ createFromMetadata(body: CreateAssessmentItemJsonRequest): Promise<AssessmentItem>;
996
+ }
997
+
998
+ /**
999
+ * Assessment Tests Resource
1000
+ *
1001
+ * CRUD operations for QTI assessment tests including nested test parts,
1002
+ * sections, and items.
1003
+ */
1004
+
1005
+ /**
1006
+ * Helper for managing items within a section.
1007
+ */
1008
+ declare class SectionItemsHelper {
1009
+ private readonly transport;
1010
+ private readonly testId;
1011
+ private readonly testPartId;
1012
+ private readonly sectionId;
1013
+ constructor(transport: Transport, testId: string, testPartId: string, sectionId: string);
1014
+ /**
1015
+ * Add an item to the section.
1016
+ *
1017
+ * @param body - Item reference data
1018
+ * @returns The updated section
1019
+ */
1020
+ add(body: AddItemRequest): Promise<AssessmentSection>;
1021
+ /**
1022
+ * Remove an item from the section.
1023
+ *
1024
+ * @param itemIdentifier - Item identifier to remove
1025
+ * @returns Delete response
1026
+ */
1027
+ remove(itemIdentifier: string): Promise<DeleteResponse>;
1028
+ /**
1029
+ * Reorder items in the section.
1030
+ *
1031
+ * @param body - New item order
1032
+ * @returns The updated section
1033
+ */
1034
+ reorder(body: ReorderItemsRequest): Promise<AssessmentSection>;
1035
+ }
1036
+ /**
1037
+ * Helper for managing sections within a test part.
1038
+ */
1039
+ declare class TestPartSectionsHelper {
1040
+ private readonly transport;
1041
+ private readonly testId;
1042
+ private readonly testPartId;
1043
+ constructor(transport: Transport, testId: string, testPartId: string);
1044
+ /**
1045
+ * List sections in a test part.
1046
+ *
1047
+ * @param params - Pagination parameters
1048
+ * @returns Paginated list of sections
1049
+ */
1050
+ list(params?: ListSectionsParams): Promise<ListResponse<AssessmentSection>>;
1051
+ /**
1052
+ * Get a section by identifier.
1053
+ *
1054
+ * @param identifier - Section identifier
1055
+ * @returns The section
1056
+ */
1057
+ get(identifier: string): Promise<AssessmentSection>;
1058
+ /**
1059
+ * Create a new section.
1060
+ *
1061
+ * @param body - Section data
1062
+ * @returns The created section
1063
+ */
1064
+ create(body: CreateSectionRequest): Promise<AssessmentSection>;
1065
+ /**
1066
+ * Update a section.
1067
+ *
1068
+ * @param identifier - Section identifier
1069
+ * @param body - Updated section data
1070
+ * @returns The updated section
1071
+ */
1072
+ update(identifier: string, body: UpdateSectionRequest): Promise<AssessmentSection>;
1073
+ /**
1074
+ * Delete a section.
1075
+ *
1076
+ * @param identifier - Section identifier
1077
+ * @returns Delete response
1078
+ */
1079
+ delete(identifier: string): Promise<DeleteResponse>;
1080
+ /**
1081
+ * Get items helper for a specific section.
1082
+ *
1083
+ * @param sectionId - Section identifier
1084
+ * @returns Items helper
1085
+ */
1086
+ items(sectionId: string): SectionItemsHelper;
1087
+ }
1088
+ /**
1089
+ * Helper for managing test parts within an assessment test.
1090
+ */
1091
+ declare class AssessmentTestPartsHelper {
1092
+ private readonly transport;
1093
+ private readonly testId;
1094
+ constructor(transport: Transport, testId: string);
1095
+ /**
1096
+ * List test parts.
1097
+ *
1098
+ * @param params - Pagination parameters
1099
+ * @returns Paginated list of test parts
1100
+ */
1101
+ list(params?: ListTestPartsParams): Promise<ListResponse<TestPart>>;
1102
+ /**
1103
+ * Get a test part by identifier.
1104
+ *
1105
+ * @param identifier - Test part identifier
1106
+ * @returns The test part
1107
+ */
1108
+ get(identifier: string): Promise<TestPart>;
1109
+ /**
1110
+ * Create a new test part.
1111
+ *
1112
+ * @param body - Test part data
1113
+ * @returns The created test part
1114
+ */
1115
+ create(body: CreateTestPartRequest): Promise<TestPart>;
1116
+ /**
1117
+ * Update a test part.
1118
+ *
1119
+ * @param identifier - Test part identifier
1120
+ * @param body - Updated test part data
1121
+ * @returns The updated test part
1122
+ */
1123
+ update(identifier: string, body: UpdateTestPartRequest): Promise<TestPart>;
1124
+ /**
1125
+ * Delete a test part.
1126
+ *
1127
+ * @param identifier - Test part identifier
1128
+ * @returns Delete response
1129
+ */
1130
+ delete(identifier: string): Promise<DeleteResponse>;
1131
+ /**
1132
+ * Get sections helper for a specific test part.
1133
+ *
1134
+ * @param testPartId - Test part identifier
1135
+ * @returns Sections helper
1136
+ */
1137
+ sections(testPartId: string): TestPartSectionsHelper;
1138
+ }
1139
+ /**
1140
+ * Assessment tests resource for managing QTI assessment tests.
1141
+ *
1142
+ * Provides methods to list, get, create, update, delete tests,
1143
+ * and access nested test parts, sections, and items.
1144
+ */
1145
+ declare class AssessmentTestsResource {
1146
+ private readonly transport;
1147
+ constructor(transport: Transport);
1148
+ /**
1149
+ * List assessment tests with pagination.
1150
+ *
1151
+ * @param params - Pagination and filter parameters
1152
+ * @returns Paginated list of assessment tests
1153
+ */
1154
+ list(params?: ListAssessmentTestsParams): Promise<ListResponse<AssessmentTest>>;
1155
+ /**
1156
+ * Stream assessment tests with automatic pagination.
1157
+ *
1158
+ * @param params - Optional pagination params (offset/limit) + max cap
1159
+ * @returns Paginator for async iteration
1160
+ */
1161
+ stream(params?: ListParams & {
1162
+ max?: number;
1163
+ }): Paginator<AssessmentTest>;
1164
+ /**
1165
+ * Get a single assessment test by identifier.
1166
+ *
1167
+ * @param identifier - Assessment test identifier
1168
+ * @returns The assessment test
1169
+ */
1170
+ get(identifier: string): Promise<AssessmentTest>;
1171
+ /**
1172
+ * Create a new assessment test.
1173
+ *
1174
+ * @param body - Assessment test data
1175
+ * @returns The created assessment test
1176
+ */
1177
+ create(body: CreateAssessmentTestRequest): Promise<AssessmentTest>;
1178
+ /**
1179
+ * Update an assessment test.
1180
+ *
1181
+ * @param identifier - Assessment test identifier
1182
+ * @param body - Updated assessment test data
1183
+ * @returns The updated assessment test
1184
+ */
1185
+ update(identifier: string, body: UpdateAssessmentTestRequest): Promise<AssessmentTest>;
1186
+ /**
1187
+ * Delete an assessment test.
1188
+ *
1189
+ * @param identifier - Assessment test identifier
1190
+ * @returns Delete response
1191
+ */
1192
+ delete(identifier: string): Promise<DeleteResponse>;
1193
+ /**
1194
+ * Update test metadata.
1195
+ *
1196
+ * @param identifier - Assessment test identifier
1197
+ * @param body - Metadata to update
1198
+ * @returns The updated assessment test
1199
+ */
1200
+ updateMetadata(identifier: string, body: UpdateTestMetadataRequest): Promise<AssessmentTest>;
1201
+ /**
1202
+ * Get all questions from an assessment test.
1203
+ *
1204
+ * Returns the full item details for each question referenced in the test.
1205
+ *
1206
+ * @param identifier - Assessment test identifier
1207
+ * @returns Questions with their full item details
1208
+ */
1209
+ getQuestions(identifier: string): Promise<QuestionsResponse>;
1210
+ /**
1211
+ * Get test parts helper for a specific test.
1212
+ *
1213
+ * @param testId - Assessment test identifier
1214
+ * @returns Test parts helper
1215
+ */
1216
+ testParts(testId: string): AssessmentTestPartsHelper;
1217
+ }
1218
+
1219
+ /**
1220
+ * General Resource
1221
+ *
1222
+ * General QTI endpoints that don't fit into other resources.
1223
+ */
1224
+
1225
+ /**
1226
+ * General resource for miscellaneous QTI operations.
1227
+ *
1228
+ * Provides methods for general operations like delete-by-id.
1229
+ */
1230
+ declare class GeneralResource {
1231
+ private readonly transport;
1232
+ constructor(transport: Transport);
1233
+ /**
1234
+ * Delete any entity by its ID.
1235
+ *
1236
+ * This is a general delete endpoint that can remove any QTI entity.
1237
+ *
1238
+ * @param id - Entity identifier
1239
+ * @returns Delete confirmation message
1240
+ */
1241
+ deleteById(id: string): Promise<DeleteResponse>;
1242
+ }
1243
+
1244
+ /**
1245
+ * Lesson Resource
1246
+ *
1247
+ * Lesson and question feedback endpoints.
1248
+ */
1249
+
1250
+ /**
1251
+ * Lesson resource for managing lesson and question feedback.
1252
+ *
1253
+ * Provides methods to submit and retrieve lesson/question feedback.
1254
+ */
1255
+ declare class LessonResource {
1256
+ private readonly transport;
1257
+ constructor(transport: Transport);
1258
+ /**
1259
+ * Submit lesson feedback.
1260
+ *
1261
+ * @param body - Lesson feedback data
1262
+ * @returns The created feedback
1263
+ */
1264
+ submitLesson(body: SubmitLessonRequest): Promise<LessonFeedback>;
1265
+ /**
1266
+ * Get lesson feedback by lesson ID.
1267
+ *
1268
+ * @param lessonId - Lesson identifier
1269
+ * @returns The lesson feedback
1270
+ */
1271
+ getLesson(lessonId: string): Promise<LessonFeedback>;
1272
+ /**
1273
+ * Submit question feedback.
1274
+ *
1275
+ * @param body - Question feedback data
1276
+ * @returns The created feedback
1277
+ */
1278
+ submitQuestion(body: SubmitQuestionRequest): Promise<LessonFeedback>;
1279
+ }
1280
+
1281
+ /**
1282
+ * Stimuli Resource
1283
+ *
1284
+ * CRUD operations for QTI stimuli.
1285
+ */
1286
+
1287
+ /**
1288
+ * Stimuli resource for managing QTI stimulus materials.
1289
+ *
1290
+ * Provides methods to list, get, create, update, and delete stimuli.
1291
+ */
1292
+ declare class StimuliResource {
1293
+ private readonly transport;
1294
+ constructor(transport: Transport);
1295
+ /**
1296
+ * List stimuli with pagination.
1297
+ *
1298
+ * @param params - Pagination and filter parameters
1299
+ * @returns Paginated list of stimuli
1300
+ */
1301
+ list(params?: ListStimuliParams): Promise<ListResponse<Stimulus>>;
1302
+ /**
1303
+ * Stream stimuli with automatic pagination.
1304
+ *
1305
+ * @param params - Optional pagination params (offset/limit) + max cap
1306
+ * @returns Paginator for async iteration
1307
+ */
1308
+ stream(params?: ListParams & {
1309
+ max?: number;
1310
+ }): Paginator<Stimulus>;
1311
+ /**
1312
+ * Get a single stimulus by identifier.
1313
+ *
1314
+ * @param identifier - Stimulus identifier
1315
+ * @returns The stimulus
1316
+ */
1317
+ get(identifier: string): Promise<Stimulus>;
1318
+ /**
1319
+ * Create a new stimulus.
1320
+ *
1321
+ * @param body - Stimulus data
1322
+ * @returns The created stimulus
1323
+ */
1324
+ create(body: CreateStimulusRequest): Promise<Stimulus>;
1325
+ /**
1326
+ * Update a stimulus.
1327
+ *
1328
+ * @param identifier - Stimulus identifier
1329
+ * @param body - Updated stimulus data
1330
+ * @returns The updated stimulus
1331
+ */
1332
+ update(identifier: string, body: UpdateStimulusRequest): Promise<Stimulus>;
1333
+ /**
1334
+ * Delete a stimulus.
1335
+ *
1336
+ * @param identifier - Stimulus identifier
1337
+ * @returns Delete response
1338
+ */
1339
+ delete(identifier: string): Promise<DeleteResponse>;
1340
+ }
1341
+
1342
+ /**
1343
+ * Validate Resource
1344
+ *
1345
+ * QTI XML validation endpoints.
1346
+ */
1347
+
1348
+ /**
1349
+ * Validation resource for checking QTI XML validity.
1350
+ *
1351
+ * Provides methods to validate single items or batch validate multiple items.
1352
+ */
1353
+ declare class ValidateResource {
1354
+ private readonly transport;
1355
+ constructor(transport: Transport);
1356
+ /**
1357
+ * Validate a single QTI XML document.
1358
+ *
1359
+ * @param body - Validation request with XML and schema type
1360
+ * @returns Validation result
1361
+ */
1362
+ validate(body: ValidateRequest): Promise<ValidationResult>;
1363
+ /**
1364
+ * Validate multiple QTI XML documents in batch.
1365
+ *
1366
+ * @param body - Batch validation request
1367
+ * @returns Batch validation results
1368
+ */
1369
+ batch(body: ValidateBatchRequest): Promise<BatchValidationResult>;
1370
+ }
1371
+
1372
+ /**
1373
+ * QTI Client
1374
+ *
1375
+ * Main entry point for the QTI SDK.
1376
+ */
1377
+ /**
1378
+ * QTI API client for assessment content management.
1379
+ *
1380
+ * Provides access to QTI endpoints including assessment items, tests,
1381
+ * stimuli, validation, and lesson feedback.
3
1382
  *
4
1383
  * @example
5
1384
  * ```typescript
6
1385
  * // Environment mode (Timeback APIs)
7
- * import { QtiClient } from '@timeback/qti'
8
- *
9
1386
  * const client = new QtiClient({
10
- * env: 'staging',
1387
+ * env: 'staging', // or 'production'
11
1388
  * auth: {
12
1389
  * clientId: 'your-client-id',
13
1390
  * clientSecret: 'your-client-secret',
14
1391
  * },
15
1392
  * })
1393
+ * ```
16
1394
  *
17
- * // List assessment items
18
- * const { items, total, page, pages } = await client.assessmentItems.list()
19
- *
20
- * // Get a specific item
21
- * const item = await client.assessmentItems.get('item-123')
1395
+ * @example
1396
+ * ```typescript
1397
+ * // Provider mode (shared tokens)
1398
+ * import { TimebackProvider } from '@timeback/internal-client-infra'
22
1399
  *
23
- * // Validate XML
24
- * const result = await client.validate.validate({
25
- * schema: 'item',
26
- * xml: '<qti-assessment-item>...</qti-assessment-item>',
1400
+ * const provider = new TimebackProvider({
1401
+ * platform: 'BEYOND_AI',
1402
+ * env: 'staging',
1403
+ * auth: { clientId: '...', clientSecret: '...' },
27
1404
  * })
1405
+ *
1406
+ * const client = new QtiClient({ provider })
28
1407
  * ```
29
1408
  *
30
1409
  * @example
@@ -39,12 +1418,73 @@
39
1418
  * },
40
1419
  * })
41
1420
  * ```
1421
+ *
1422
+ * @example
1423
+ * ```typescript
1424
+ * // Environment variables fallback
1425
+ * // Set QTI_BASE_URL, QTI_TOKEN_URL,
1426
+ * // QTI_CLIENT_ID, QTI_CLIENT_SECRET
1427
+ * const client = new QtiClient()
1428
+ * ```
1429
+ */
1430
+ declare const QtiClient: {
1431
+ new (config?: QtiClientConfig): {
1432
+ readonly transport: QtiTransportLike;
1433
+ readonly _provider?: _timeback_internal_client_infra.TimebackProvider | undefined;
1434
+ readonly assessmentItems: AssessmentItemsResource;
1435
+ readonly assessmentTests: AssessmentTestsResource;
1436
+ readonly stimuli: StimuliResource;
1437
+ readonly validate: ValidateResource;
1438
+ readonly lesson: LessonResource;
1439
+ readonly general: GeneralResource;
1440
+ getTransport(): QtiTransportLike;
1441
+ checkAuth(): Promise<_timeback_internal_client_infra.AuthCheckResult>;
1442
+ };
1443
+ };
1444
+
1445
+ /**
1446
+ * QTI Client Factory
1447
+ *
1448
+ * Creates QtiClient classes bound to specific provider registries.
1449
+ */
1450
+
1451
+ /**
1452
+ * Create a QtiClient class bound to a specific provider registry.
1453
+ *
1454
+ * @param registry - Provider registry to use (defaults to all Timeback platforms)
1455
+ * @returns QtiClient class bound to the registry
42
1456
  */
43
- export { QtiClient, type QtiClientInstance } from './client';
44
- export { createQtiClient } from './factory';
45
- export type { QtiClientConfig } from './types/client';
46
- export type { Environment, EnvAuth, ExplicitAuth } from './types/client';
47
- export type { AuthCheckResult, ListParams, PageResult } from '@timeback/internal-client-infra';
48
- export type { AssessmentItem, AssessmentItemType, AssessmentTest, ListResponse, Stimulus, ValidationResult, } from './types';
49
- export { Paginator, Transport } from './lib';
50
- //# sourceMappingURL=index.d.ts.map
1457
+ declare function createQtiClient(registry?: ProviderRegistry): {
1458
+ new (config?: QtiClientConfig): {
1459
+ /** @internal */
1460
+ readonly transport: QtiTransportLike;
1461
+ /** @internal */
1462
+ readonly _provider?: TimebackProvider | undefined;
1463
+ /** Query and manage assessment items (questions) */
1464
+ readonly assessmentItems: AssessmentItemsResource;
1465
+ /** Query and manage assessment tests with nested test parts, sections, and items */
1466
+ readonly assessmentTests: AssessmentTestsResource;
1467
+ /** Query and manage stimulus materials (passages, images, etc.) */
1468
+ readonly stimuli: StimuliResource;
1469
+ /** Validate QTI XML documents */
1470
+ readonly validate: ValidateResource;
1471
+ /** Submit and retrieve lesson/question feedback */
1472
+ readonly lesson: LessonResource;
1473
+ /** General operations like delete-by-id */
1474
+ readonly general: GeneralResource;
1475
+ /**
1476
+ * Get the underlying transport for advanced use cases.
1477
+ * @returns The transport instance used by this client
1478
+ */
1479
+ getTransport(): QtiTransportLike;
1480
+ /**
1481
+ * Verify that OAuth authentication is working.
1482
+ * @returns Auth check result
1483
+ * @throws {Error} If client was initialized with custom transport (no provider)
1484
+ */
1485
+ checkAuth(): Promise<AuthCheckResult>;
1486
+ };
1487
+ };
1488
+
1489
+ export { Paginator, QtiClient, Transport, createQtiClient };
1490
+ export type { AssessmentItem, AssessmentItemType, AssessmentTest, ListResponse, QtiClientConfig, QtiClientInstance, Stimulus, ValidationResult };