@timeback/powerpath 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,24 +1,919 @@
1
+ import * as _timeback_internal_client_infra from '@timeback/internal-client-infra';
2
+ import { PowerPathPaths, RequestOptions, PaginatedResponse, ClientConfig, TransportOnlyConfig, ProviderClientConfig, BaseTransportConfig, Paginator as Paginator$1, ListParams, ProviderRegistry, TimebackProvider, AuthCheckResult, BaseTransport } from '@timeback/internal-client-infra';
3
+ export { AuthCheckResult, EnvAuth, Environment, ExplicitAuth, ListParams, PageResult } from '@timeback/internal-client-infra';
4
+
1
5
  /**
2
- * PowerPath API client SDK for Timeback.
6
+ * PowerPath Base Types
3
7
  *
4
- * @example Environment mode (Timeback APIs)
5
- * ```typescript
6
- * import { PowerPathClient } from '@timeback/powerpath'
8
+ * Common types and enums for PowerPath API responses.
9
+ */
10
+
11
+ // ═══════════════════════════════════════════════════════════════════════════════
12
+ // ENUMS
13
+ // ═══════════════════════════════════════════════════════════════════════════════
14
+
15
+ /**
16
+ * Test assignment status values.
17
+ */
18
+ type TestAssignmentStatus =
19
+ | 'assigned'
20
+ | 'in_progress'
21
+ | 'completed'
22
+ | 'failed'
23
+ | 'expired'
24
+ | 'cancelled'
25
+
26
+ // ═══════════════════════════════════════════════════════════════════════════════
27
+ // PAGINATION
28
+ // ═══════════════════════════════════════════════════════════════════════════════
29
+
30
+ /**
31
+ * Pagination metadata from PowerPath list responses.
32
+ */
33
+ interface PaginationMeta {
34
+ /** Total items across all pages */
35
+ totalCount: number
36
+ /** Total number of pages */
37
+ pageCount: number
38
+ /** Current page number (1-indexed) */
39
+ pageNumber: number
40
+ /**
41
+ * Offset for the next page of results.
42
+ *
43
+ * This API uses offset pagination: request `offset` is the number of items to skip.
44
+ * List responses also include an `offset` field; treat it as the server-provided
45
+ * next offset (and fall back to `currentOffset + limit` when implementing iterators).
46
+ */
47
+ offset: number
48
+ /** Items per page (default 100, max 3000) */
49
+ limit: number
50
+ }
51
+
52
+ /**
53
+ * PowerPath Response Types
54
+ *
55
+ * Entity types returned by PowerPath API endpoints.
56
+ */
57
+
58
+
59
+
60
+ // ═══════════════════════════════════════════════════════════════════════════════
61
+ // TEST ASSIGNMENTS
62
+ // ═══════════════════════════════════════════════════════════════════════════════
63
+
64
+ /**
65
+ * A single test assignment entity.
66
+ */
67
+ interface TestAssignment {
68
+ sourcedId: string
69
+ studentSourcedId: string
70
+ studentEmail: string
71
+ assignedByUserSourcedId?: string
72
+ subject: string
73
+ grade: string
74
+ assignmentStatus: TestAssignmentStatus
75
+ testName?: string
76
+ assignedAt?: string
77
+ expiresAt?: string
78
+ completedAt?: string
79
+ resourceSourcedId?: string
80
+ componentResourceSourcedId?: string
81
+ }
82
+
83
+ /**
84
+ * List response for test assignments.
85
+ */
86
+ interface TestAssignmentsListResponse extends PaginationMeta {
87
+ testAssignments: TestAssignment[]
88
+ }
89
+
90
+ /**
91
+ * Result from creating a test assignment.
92
+ */
93
+ interface AssignmentResult {
94
+ assignmentId: string
95
+ lessonId: string
96
+ resourceId: string
97
+ }
98
+
99
+ /**
100
+ * Result from bulk operations.
101
+ */
102
+ interface BulkResult {
103
+ success: boolean
104
+ results: AssignmentResult[]
105
+ errors: Array<{ row: number; message: string }>
106
+ }
107
+
108
+ // ═══════════════════════════════════════════════════════════════════════════════
109
+ // ASSESSMENTS
110
+ // ═══════════════════════════════════════════════════════════════════════════════
111
+
112
+ /**
113
+ * Result from creating an external test (test-out, placement, or internal).
114
+ */
115
+ interface ExternalTestCreateResponse {
116
+ lessonId: string
117
+ resourceId: string
118
+ }
119
+
120
+ /**
121
+ * A single attempt record.
122
+ */
123
+ interface Attempt {
124
+ attempt?: number
125
+ score: number
126
+ scoreStatus: string
127
+ }
128
+
129
+ /**
130
+ * Result from creating a new attempt.
131
+ */
132
+ interface CreateAttemptResponse {
133
+ attempt: Attempt
134
+ }
135
+
136
+ /**
137
+ * Result from getting attempts for a lesson.
138
+ */
139
+ interface GetAttemptsResponse {
140
+ attempts: Attempt[]
141
+ }
142
+
143
+ /**
144
+ * Result from getting assessment progress.
145
+ * Shape varies by context; stable fields are typed.
146
+ */
147
+ interface GetAssessmentProgressResponse {
148
+ lessonType?: string
149
+ [key: string]: unknown
150
+ }
151
+
152
+ /**
153
+ * Result from resetting an attempt.
154
+ */
155
+ interface ResetAttemptResponse {
156
+ success: boolean
157
+ score: number
158
+ }
159
+
160
+ // ═══════════════════════════════════════════════════════════════════════════════
161
+ // PLACEMENT
162
+ // ═══════════════════════════════════════════════════════════════════════════════
163
+
164
+ /**
165
+ * Result from getting all placement tests.
166
+ */
167
+ interface GetAllPlacementTestsResponse {
168
+ placementTests: unknown[]
169
+ }
170
+
171
+ /**
172
+ * Result from getting current placement level.
173
+ */
174
+ interface GetCurrentLevelResponse {
175
+ gradeLevel?: unknown
176
+ onboarded?: boolean
177
+ availableTests: number
178
+ }
179
+
180
+ /**
181
+ * Result from getting the next placement test.
182
+ */
183
+ interface GetNextPlacementTestResponse {
184
+ availableTests: number
185
+ lesson: string
186
+ }
187
+
188
+ /**
189
+ * Result from getting subject progress.
190
+ */
191
+ interface GetSubjectProgressResponse {
192
+ progress: unknown[]
193
+ }
194
+
195
+ /**
196
+ * Result from resetting placement.
197
+ */
198
+ interface ResetPlacementResponse {
199
+ success: boolean
200
+ placementResultsDeleted: number
201
+ onboardingReset: boolean
202
+ }
203
+
204
+ // ═══════════════════════════════════════════════════════════════════════════════
205
+ // SCREENING
206
+ // ═══════════════════════════════════════════════════════════════════════════════
207
+
208
+ /**
209
+ * Result from screening getResults.
210
+ * Response shape depends on MAP integration configuration.
211
+ */
212
+ interface ScreeningResultsResponse {
213
+ [key: string]: unknown
214
+ }
215
+
216
+ /**
217
+ * Result from screening getSession.
218
+ * Response shape depends on MAP integration configuration.
219
+ */
220
+ interface ScreeningSessionResponse {
221
+ [key: string]: unknown
222
+ }
223
+
224
+ /**
225
+ * Result from resetting a screening session.
226
+ */
227
+ interface ScreeningResetSessionResponse {
228
+ success?: boolean
229
+ [key: string]: unknown
230
+ }
231
+
232
+ /**
233
+ * Result from assigning a screening test.
234
+ */
235
+ interface ScreeningAssignTestResponse {
236
+ success?: boolean
237
+ [key: string]: unknown
238
+ }
239
+
240
+ // ═══════════════════════════════════════════════════════════════════════════════
241
+ // LESSON PLANS
242
+ // ═══════════════════════════════════════════════════════════════════════════════
243
+
244
+ /**
245
+ * Result from creating a lesson plan.
246
+ */
247
+ interface LessonPlanCreateResponse {
248
+ lessonPlanId: string
249
+ }
250
+
251
+ /**
252
+ * A lesson plan operation record.
253
+ */
254
+ interface LessonPlanOperation {
255
+ id: string
256
+ type: string
257
+ payload?: unknown
258
+ reason?: string
259
+ createdAt: string
260
+ sequenceNumber: number
261
+ createdBy?: string
262
+ }
263
+
264
+ /**
265
+ * Response containing lesson plan operations.
266
+ */
267
+ interface LessonPlanOperationsResponse {
268
+ operations: LessonPlanOperation[]
269
+ }
270
+
271
+ /**
272
+ * Result from a single lesson plan operation.
273
+ */
274
+ interface LessonPlanOperationResult {
275
+ success: boolean
276
+ message?: string
277
+ operationId?: string
278
+ }
279
+
280
+ /**
281
+ * Result from syncing lesson plan operations.
282
+ */
283
+ interface LessonPlanSyncResult {
284
+ success: boolean
285
+ message?: string
286
+ operationCount: number
287
+ operationResults: Array<{ success: boolean; errors?: Array<{ message: string }> }>
288
+ }
289
+
290
+ /**
291
+ * Result from syncing a course.
292
+ */
293
+ interface LessonPlanCourseSyncResult {
294
+ lessonPlansAffected: string[]
295
+ }
296
+
297
+ /**
298
+ * Response containing a lesson plan.
299
+ */
300
+ interface LessonPlanResponse {
301
+ lessonPlan: Record<string, unknown>
302
+ }
303
+
304
+ /**
305
+ * Response containing course progress.
306
+ */
307
+ interface CourseProgressResponse {
308
+ lineItems: Record<string, unknown>[]
309
+ }
310
+
311
+ /**
312
+ * Result from updating student item response.
313
+ */
314
+ interface UpdateStudentItemResponseResult {
315
+ success?: boolean
316
+ [key: string]: unknown
317
+ }
318
+
319
+ // ═══════════════════════════════════════════════════════════════════════════════
320
+ // SYLLABUS
321
+ // ═══════════════════════════════════════════════════════════════════════════════
322
+
323
+ /**
324
+ * Response containing syllabus data.
325
+ */
326
+ interface SyllabusResponse {
327
+ syllabus?: unknown
328
+ }
329
+
330
+ type input<T> = T extends {
331
+ _zod: {
332
+ input: any;
333
+ };
334
+ } ? T["_zod"]["input"] : unknown;
335
+
336
+ /**
337
+ * PowerPath Schemas
338
+ *
339
+ * Zod schemas for the PowerPath adaptive learning API.
340
+ */
341
+
342
+
343
+
344
+ declare const ExternalTestOut = ExternalTestBase.extend({
345
+ lessonType: z.literal('test-out'),
346
+ xp: z.number(),
347
+ })
348
+
349
+ declare const ExternalPlacement = ExternalTestBase.extend({
350
+ lessonType: z.literal('placement'),
351
+ courseIdOnFail: NonEmptyString.optional(),
352
+ xp: z.number().optional(),
353
+ })
354
+
355
+ declare const PowerPathCreateExternalPlacementTestInput = ExternalPlacement
356
+
357
+ declare const PowerPathCreateExternalTestOutInput = ExternalTestOut
358
+
359
+ declare const PowerPathCreateInternalTestInput = z.union([
360
+ InternalTestBase.extend({
361
+ testType: z.literal('qti'),
362
+ qti: z.object({
363
+ url: z.url(),
364
+ title: NonEmptyString.optional(),
365
+ metadata: z.record(z.string(), z.unknown()).optional(),
366
+ }),
367
+ }),
368
+ InternalTestBase.extend({
369
+ testType: z.literal('assessment-bank'),
370
+ assessmentBank: z.object({
371
+ resources: z.array(
372
+ z.object({
373
+ url: z.url(),
374
+ title: NonEmptyString.optional(),
375
+ metadata: z.record(z.string(), z.unknown()).optional(),
376
+ }),
377
+ ),
378
+ }),
379
+ }),
380
+ ])
381
+
382
+ declare const PowerPathCreateNewAttemptInput = z.object({
383
+ student: NonEmptyString,
384
+ lesson: NonEmptyString,
385
+ })
386
+
387
+ declare const PowerPathFinalStudentAssessmentResponseInput = z.object({
388
+ student: NonEmptyString,
389
+ lesson: NonEmptyString,
390
+ })
391
+
392
+ declare const PowerPathLessonPlansCreateInput = z.object({
393
+ courseId: NonEmptyString,
394
+ userId: NonEmptyString,
395
+ classId: NonEmptyString.optional(),
396
+ })
397
+
398
+ declare const PowerPathLessonPlanOperationInput = z.union([
399
+ z.object({
400
+ type: z.literal('set-skipped'),
401
+ payload: z.object({
402
+ target: LessonPlanTarget,
403
+ value: z.boolean(),
404
+ }),
405
+ }),
406
+ z.object({
407
+ type: z.literal('add-custom-resource'),
408
+ payload: z.object({
409
+ resource_id: NonEmptyString,
410
+ parent_component_id: NonEmptyString,
411
+ skipped: z.boolean().optional(),
412
+ }),
413
+ }),
414
+ z.object({
415
+ type: z.literal('move-item-before'),
416
+ payload: z.object({
417
+ target: LessonPlanTarget,
418
+ reference_id: NonEmptyString,
419
+ }),
420
+ }),
421
+ z.object({
422
+ type: z.literal('move-item-after'),
423
+ payload: z.object({
424
+ target: LessonPlanTarget,
425
+ reference_id: NonEmptyString,
426
+ }),
427
+ }),
428
+ z.object({
429
+ type: z.literal('move-item-to-start'),
430
+ payload: z.object({
431
+ target: LessonPlanTarget,
432
+ }),
433
+ }),
434
+ z.object({
435
+ type: z.literal('move-item-to-end'),
436
+ payload: z.object({
437
+ target: LessonPlanTarget,
438
+ }),
439
+ }),
440
+ z.object({
441
+ type: z.literal('change-item-parent'),
442
+ payload: z.object({
443
+ target: LessonPlanTarget,
444
+ new_parent_id: NonEmptyString,
445
+ position: z.enum(['start', 'end']).optional(),
446
+ }),
447
+ }),
448
+ ])
449
+
450
+ declare const PowerPathLessonPlanOperationsInput = z.object({
451
+ operation: z.array(PowerPathLessonPlanOperationInput),
452
+ reason: NonEmptyString.optional(),
453
+ })
454
+
455
+ declare const PowerPathLessonPlanUpdateStudentItemResponseInput = z.object({
456
+ studentId: NonEmptyString,
457
+ componentResourceId: NonEmptyString,
458
+ result: z.object({
459
+ status: z.enum(['active', 'tobedeleted']),
460
+ metadata: z.record(z.string(), z.unknown()).optional(),
461
+ score: z.number().optional(),
462
+ textScore: NonEmptyString.optional(),
463
+ scoreDate: NonEmptyString,
464
+ scorePercentile: z.number().optional(),
465
+ scoreStatus: ScoreStatus,
466
+ comment: NonEmptyString.optional(),
467
+ learningObjectiveSet: z
468
+ .array(
469
+ z.object({
470
+ source: NonEmptyString,
471
+ learningObjectiveResults: z.array(
472
+ z.object({
473
+ learningObjectiveId: NonEmptyString,
474
+ score: z.number().optional(),
475
+ textScore: NonEmptyString.optional(),
476
+ }),
477
+ ),
478
+ }),
479
+ )
480
+ .optional(),
481
+ inProgress: NonEmptyString.optional(),
482
+ incomplete: NonEmptyString.optional(),
483
+ late: NonEmptyString.optional(),
484
+ missing: NonEmptyString.optional(),
485
+ }),
486
+ })
487
+
488
+ declare const PowerPathMakeExternalTestAssignmentInput = z.object({
489
+ student: NonEmptyString,
490
+ lesson: NonEmptyString,
491
+ applicationName: NonEmptyString.optional(),
492
+ testId: NonEmptyString.optional(),
493
+ skipCourseEnrollment: z.boolean().optional(),
494
+ })
495
+
496
+ declare const PowerPathPlacementResetUserPlacementInput = z.object({
497
+ student: NonEmptyString,
498
+ subject: TimebackSubject,
499
+ })
500
+
501
+ declare const PowerPathResetAttemptInput = z.object({
502
+ student: NonEmptyString,
503
+ lesson: NonEmptyString,
504
+ })
505
+
506
+ declare const PowerPathScreeningResetSessionInput = z.object({
507
+ userId: NonEmptyString,
508
+ })
509
+
510
+ declare const PowerPathScreeningAssignTestInput = z.object({
511
+ userId: NonEmptyString,
512
+ subject: z.enum(['Math', 'Reading', 'Language', 'Science']),
513
+ })
514
+
515
+ declare const PowerPathTestAssignmentsCreateInput = z.object({
516
+ student: NonEmptyString,
517
+ subject: TimebackSubject,
518
+ grade: TimebackGrade,
519
+ testName: NonEmptyString.optional(),
520
+ })
521
+
522
+ declare const PowerPathTestAssignmentsUpdateInput = z.object({
523
+ testName: NonEmptyString,
524
+ })
525
+
526
+ declare const PowerPathTestAssignmentsBulkInput = z.object({
527
+ items: z.array(PowerPathTestAssignmentItemInput),
528
+ })
529
+
530
+ declare const PowerPathTestAssignmentsImportInput = z.object({
531
+ spreadsheetUrl: z.url(),
532
+ sheet: NonEmptyString,
533
+ })
534
+
535
+ declare const PowerPathTestAssignmentsListParams = z.object({
536
+ student: NonEmptyString,
537
+ status: z
538
+ .enum(['assigned', 'in_progress', 'completed', 'failed', 'expired', 'cancelled'])
539
+ .optional(),
540
+ subject: NonEmptyString.optional(),
541
+ grade: TimebackGrade.optional(),
542
+ limit: z.number().int().positive().max(3000).optional(),
543
+ offset: z.number().int().nonnegative().optional(),
544
+ })
545
+
546
+ declare const PowerPathTestAssignmentsAdminParams = z.object({
547
+ student: NonEmptyString.optional(),
548
+ status: z
549
+ .enum(['assigned', 'in_progress', 'completed', 'failed', 'expired', 'cancelled'])
550
+ .optional(),
551
+ subject: NonEmptyString.optional(),
552
+ grade: TimebackGrade.optional(),
553
+ limit: z.number().int().positive().max(3000).optional(),
554
+ offset: z.number().int().nonnegative().optional(),
555
+ })
556
+
557
+ declare const PowerPathUpdateStudentQuestionResponseInput = z.object({
558
+ student: NonEmptyString,
559
+ question: NonEmptyString,
560
+ response: z.union([NonEmptyString, z.array(NonEmptyString)]).optional(),
561
+ responses: z.record(z.string(), z.union([NonEmptyString, z.array(NonEmptyString)])).optional(),
562
+ lesson: NonEmptyString,
563
+ })
564
+
565
+ declare const PowerPathGetAssessmentProgressParams = z.object({
566
+ student: NonEmptyString,
567
+ lesson: NonEmptyString,
568
+ attempt: z.number().int().positive().optional(),
569
+ })
570
+
571
+ declare const PowerPathGetNextQuestionParams = z.object({
572
+ student: NonEmptyString,
573
+ lesson: NonEmptyString,
574
+ })
575
+
576
+ declare const PowerPathGetAttemptsParams = z.object({
577
+ student: NonEmptyString,
578
+ lesson: NonEmptyString,
579
+ })
580
+
581
+ declare const PowerPathTestOutParams = z.object({
582
+ student: NonEmptyString,
583
+ lesson: NonEmptyString.optional(),
584
+ finalized: z.boolean().optional(),
585
+ toolProvider: NonEmptyString.optional(),
586
+ attempt: z.number().int().positive().optional(),
587
+ })
588
+
589
+ declare const PowerPathImportExternalTestAssignmentResultsParams = z.object({
590
+ student: NonEmptyString,
591
+ lesson: NonEmptyString,
592
+ applicationName: NonEmptyString.optional(),
593
+ })
594
+
595
+ declare const PowerPathPlacementQueryParams = z.object({
596
+ student: NonEmptyString,
597
+ subject: TimebackSubject,
598
+ })
599
+
600
+ declare const PowerPathSyllabusQueryParams = z.object({
601
+ status: z.enum(['active', 'tobedeleted']).optional(),
602
+ })
603
+
604
+ // ═══════════════════════════════════════════════════════════════════════════════
605
+ // TYPE EXPORTS (REQUEST INPUTS)
606
+ // ═══════════════════════════════════════════════════════════════════════════════
607
+
608
+ // Shorter type aliases (like OneRoster pattern: schema = OneRosterFoo, type = Foo)
609
+ type CreateExternalPlacementTestInput = input<
610
+ typeof PowerPathCreateExternalPlacementTestInput
611
+ >
612
+ type CreateExternalTestOutInput = input<typeof PowerPathCreateExternalTestOutInput>
613
+ type CreateInternalTestInput = input<typeof PowerPathCreateInternalTestInput>
614
+ type CreateNewAttemptInput = input<typeof PowerPathCreateNewAttemptInput>
615
+ type FinalStudentAssessmentResponseInput = input<
616
+ typeof PowerPathFinalStudentAssessmentResponseInput
617
+ >
618
+ type LessonPlansCreateInput = input<typeof PowerPathLessonPlansCreateInput>
619
+ type LessonPlanOperationInput = input<typeof PowerPathLessonPlanOperationInput>
620
+ type LessonPlanOperationsInput = input<typeof PowerPathLessonPlanOperationsInput>
621
+ type LessonPlanUpdateStudentItemResponseInput = input<
622
+ typeof PowerPathLessonPlanUpdateStudentItemResponseInput
623
+ >
624
+ type MakeExternalTestAssignmentInput = input<
625
+ typeof PowerPathMakeExternalTestAssignmentInput
626
+ >
627
+ type PlacementResetUserPlacementInput = input<
628
+ typeof PowerPathPlacementResetUserPlacementInput
629
+ >
630
+ type ResetAttemptInput = input<typeof PowerPathResetAttemptInput>
631
+ type ScreeningResetSessionInput = input<typeof PowerPathScreeningResetSessionInput>
632
+ type ScreeningAssignTestInput = input<typeof PowerPathScreeningAssignTestInput>
633
+ type TestAssignmentsCreateInput = input<typeof PowerPathTestAssignmentsCreateInput>
634
+ type TestAssignmentsUpdateInput = input<typeof PowerPathTestAssignmentsUpdateInput>
635
+ type TestAssignmentsBulkInput = input<typeof PowerPathTestAssignmentsBulkInput>
636
+ type TestAssignmentsImportInput = input<typeof PowerPathTestAssignmentsImportInput>
637
+ type TestAssignmentsListParams = input<typeof PowerPathTestAssignmentsListParams>
638
+ type TestAssignmentsAdminParams = input<typeof PowerPathTestAssignmentsAdminParams>
639
+ type UpdateStudentQuestionResponseInput = input<
640
+ typeof PowerPathUpdateStudentQuestionResponseInput
641
+ >
642
+ type GetAssessmentProgressParams = input<typeof PowerPathGetAssessmentProgressParams>
643
+ type GetNextQuestionParams = input<typeof PowerPathGetNextQuestionParams>
644
+ type GetAttemptsParams = input<typeof PowerPathGetAttemptsParams>
645
+ type TestOutParams = input<typeof PowerPathTestOutParams>
646
+ type ImportExternalTestAssignmentResultsParams = input<
647
+ typeof PowerPathImportExternalTestAssignmentResultsParams
648
+ >
649
+ type PlacementQueryParams = input<typeof PowerPathPlacementQueryParams>
650
+ type SyllabusQueryParams = input<typeof PowerPathSyllabusQueryParams>
651
+
652
+ /**
653
+ * Transport interface for PowerPath client.
654
+ *
655
+ * Extends base transport requirements with PowerPath-specific paths.
656
+ * Required when using transport mode with PowerPathClient.
657
+ */
658
+ interface PowerPathTransportLike {
659
+ /** Base URL of the API */
660
+ baseUrl: string;
661
+ /** API path profiles for PowerPath operations */
662
+ paths: PowerPathPaths;
663
+ /** Make an authenticated request */
664
+ request<T>(path: string, options?: RequestOptions): Promise<T>;
665
+ /** Make a paginated request (PowerPath returns pagination metadata in body) */
666
+ requestPaginated<T>(path: string, options?: RequestOptions): Promise<PaginatedResponse<T>>;
667
+ }
668
+ /**
669
+ * All supported PowerPath client configuration types.
670
+ *
671
+ * Supports four modes:
672
+ * - **Provider mode**: `{ provider: TimebackProvider }` — pre-built provider with token sharing
673
+ * - **Environment mode**: `{ platform?, env, auth }` — Timeback hosted APIs
674
+ * - **Explicit mode**: `{ baseUrl, auth: { authUrl } }` — custom API URLs
675
+ * - **Transport mode**: `{ transport }` — custom transport with paths
676
+ *
677
+ * The `platform` field (in env mode) selects which Timeback implementation to use:
678
+ * - `'BEYOND_AI'` (default): BeyondAI's Timeback platform
679
+ * - `'LEARNWITH_AI'`: Samy's LearnWith.AI platform
680
+ */
681
+ type PowerPathClientConfig = ClientConfig | TransportOnlyConfig<PowerPathTransportLike> | ProviderClientConfig;
682
+ /**
683
+ * Configuration for PowerPath transport.
684
+ */
685
+ type PowerPathTransportConfig = BaseTransportConfig & {
686
+ /** API path profiles for PowerPath operations */
687
+ paths: PowerPathPaths;
688
+ };
689
+ /**
690
+ * Instance type of PowerPathClient.
691
+ */
692
+ type PowerPathClientInstance = InstanceType<typeof PowerPathClient>;
693
+
694
+ /**
695
+ * Assessment Resource
696
+ *
697
+ * PowerPath assessment operations: tests, attempts, and responses.
698
+ */
699
+
700
+ /**
701
+ * Assessment resource for PowerPath operations.
702
+ */
703
+ declare class AssessmentResource {
704
+ private readonly transport;
705
+ constructor(transport: PowerPathTransportLike);
706
+ createExternalPlacementTest(input: CreateExternalPlacementTestInput): Promise<ExternalTestCreateResponse>;
707
+ createExternalTestOut(input: CreateExternalTestOutInput): Promise<ExternalTestCreateResponse>;
708
+ createInternalTest(input: CreateInternalTestInput): Promise<ExternalTestCreateResponse>;
709
+ createNewAttempt(input: CreateNewAttemptInput): Promise<CreateAttemptResponse>;
710
+ finalStudentAssessmentResponse(input: FinalStudentAssessmentResponseInput): Promise<Record<string, unknown>>;
711
+ getAssessmentProgress(params: GetAssessmentProgressParams): Promise<GetAssessmentProgressResponse>;
712
+ getAttempts(params: GetAttemptsParams): Promise<GetAttemptsResponse>;
713
+ getNextQuestion(params: GetNextQuestionParams): Promise<Record<string, unknown>>;
714
+ importExternalTestAssignmentResults(params: ImportExternalTestAssignmentResultsParams): Promise<Record<string, unknown>>;
715
+ makeExternalTestAssignment(input: MakeExternalTestAssignmentInput): Promise<ExternalTestCreateResponse>;
716
+ resetAttempt(input: ResetAttemptInput): Promise<ResetAttemptResponse>;
717
+ testOut(params: TestOutParams): Promise<Record<string, unknown>>;
718
+ updateStudentQuestionResponse(input: UpdateStudentQuestionResponseInput): Promise<Record<string, unknown>>;
719
+ }
720
+
721
+ /**
722
+ * Lesson Plans Resource
723
+ *
724
+ * PowerPath lesson plan operations and progress tracking.
725
+ */
726
+
727
+ /**
728
+ * Lesson plans resource for managing course lesson plans and progress.
729
+ */
730
+ declare class LessonPlansResource {
731
+ private readonly transport;
732
+ constructor(transport: PowerPathTransportLike);
733
+ create(input: LessonPlansCreateInput): Promise<LessonPlanCreateResponse>;
734
+ get(courseId: string, userId: string): Promise<LessonPlanResponse>;
735
+ deleteAll(courseId: string): Promise<void>;
736
+ listOperations(lessonPlanId: string): Promise<LessonPlanOperationsResponse>;
737
+ createOperations(lessonPlanId: string, input: LessonPlanOperationsInput): Promise<LessonPlanOperationResult>;
738
+ sync(lessonPlanId: string): Promise<LessonPlanSyncResult>;
739
+ syncCourse(courseId: string): Promise<LessonPlanCourseSyncResult>;
740
+ recreate(lessonPlanId: string): Promise<LessonPlanSyncResult>;
741
+ getCourseProgress(courseId: string, studentId: string): Promise<CourseProgressResponse>;
742
+ getTree(lessonPlanId: string): Promise<LessonPlanResponse>;
743
+ getStructure(lessonPlanId: string): Promise<LessonPlanResponse>;
744
+ updateStudentItemResponse(input: LessonPlanUpdateStudentItemResponseInput): Promise<UpdateStudentItemResponseResult>;
745
+ }
746
+
747
+ /**
748
+ * Placement Resource
749
+ *
750
+ * PowerPath placement testing operations.
751
+ */
752
+
753
+ /**
754
+ * Placement resource for PowerPath placement APIs.
755
+ */
756
+ declare class PlacementResource {
757
+ private readonly transport;
758
+ constructor(transport: PowerPathTransportLike);
759
+ getPlacement(studentId: string): Promise<Record<string, unknown>>;
760
+ getAllPlacementTests(params: PlacementQueryParams): Promise<GetAllPlacementTestsResponse>;
761
+ getCurrentLevel(params: PlacementQueryParams): Promise<GetCurrentLevelResponse>;
762
+ getNextPlacementTest(params: PlacementQueryParams): Promise<GetNextPlacementTestResponse>;
763
+ getSubjectProgress(params: PlacementQueryParams): Promise<GetSubjectProgressResponse>;
764
+ resetUserPlacement(input: PlacementResetUserPlacementInput): Promise<ResetPlacementResponse>;
765
+ }
766
+
767
+ /**
768
+ * Screening Resource
769
+ *
770
+ * PowerPath screening session operations.
771
+ */
772
+
773
+ /**
774
+ * Screening resource for PowerPath screening APIs.
775
+ */
776
+ declare class ScreeningResource {
777
+ private readonly transport;
778
+ constructor(transport: PowerPathTransportLike);
779
+ getResults(userId: string): Promise<ScreeningResultsResponse>;
780
+ getSession(userId: string): Promise<ScreeningSessionResponse>;
781
+ resetSession(input: ScreeningResetSessionInput): Promise<ScreeningResetSessionResponse>;
782
+ assignTest(input: ScreeningAssignTestInput): Promise<ScreeningAssignTestResponse>;
783
+ }
784
+
785
+ /**
786
+ * Syllabus Resource
787
+ *
788
+ * PowerPath syllabus operations.
789
+ */
790
+
791
+ /**
792
+ * Syllabus resource for PowerPath APIs.
793
+ */
794
+ declare class SyllabusResource {
795
+ private readonly transport;
796
+ constructor(transport: PowerPathTransportLike);
797
+ get(courseSourcedId: string, params?: SyllabusQueryParams): Promise<SyllabusResponse>;
798
+ }
799
+
800
+ /**
801
+ * Pagination Utilities
802
+ *
803
+ * Re-exports the common Paginator with PowerPath-specific configuration.
804
+ */
805
+
806
+ /**
807
+ * PowerPath-specific Paginator that uses the PowerPath transport.
7
808
  *
809
+ * Accepts params with `max` included for consumer convenience,
810
+ * then extracts and forwards it to the base Paginator.
811
+ *
812
+ * Validates list parameters before making any network requests.
813
+ */
814
+ declare class Paginator<T> extends Paginator$1<T, unknown> {
815
+ constructor(transport: PowerPathTransportLike, path: string, params?: ListParams, unwrapKey?: string, transform?: (item: T) => T);
816
+ }
817
+
818
+ /**
819
+ * Test Assignments Resource
820
+ *
821
+ * PowerPath test assignment operations.
822
+ */
823
+
824
+ type TestAssignmentsStreamParams = TestAssignmentsListParams & {
825
+ max?: number;
826
+ };
827
+ type TestAssignmentsAdminStreamParams = TestAssignmentsAdminParams & {
828
+ max?: number;
829
+ };
830
+ /**
831
+ * Test assignments resource for PowerPath APIs.
832
+ */
833
+ declare class TestAssignmentsResource {
834
+ private readonly transport;
835
+ constructor(transport: PowerPathTransportLike);
836
+ /**
837
+ * Stream test assignments for a student with lazy pagination.
838
+ *
839
+ * Matches the OneRoster client pattern: returns a Paginator (AsyncIterable)
840
+ * with `toArray()` and `firstPage()` helpers.
841
+ *
842
+ * @param params - Query params (student required; supports limit/offset)
843
+ * @returns Paginator that yields `TestAssignment` items
844
+ */
845
+ stream(params: TestAssignmentsStreamParams): Paginator<TestAssignment>;
846
+ /**
847
+ * Convenience helper to fetch all test assignments for a student.
848
+ *
849
+ * @param params - List params (supports filters + limit/offset)
850
+ * @returns All matching test assignments
851
+ */
852
+ listAll(params: TestAssignmentsStreamParams): Promise<TestAssignment[]>;
853
+ list(params: TestAssignmentsListParams): Promise<TestAssignmentsListResponse>;
854
+ create(input: TestAssignmentsCreateInput): Promise<AssignmentResult>;
855
+ get(id: string): Promise<TestAssignment>;
856
+ update(id: string, input: TestAssignmentsUpdateInput): Promise<TestAssignment>;
857
+ delete(id: string): Promise<void>;
858
+ admin(params?: TestAssignmentsAdminParams): Promise<TestAssignmentsListResponse>;
859
+ /**
860
+ * Stream all test assignments (admin) with lazy pagination.
861
+ *
862
+ * @param params - Optional admin filters (supports student/status/subject/grade + limit/offset)
863
+ * @returns Paginator that yields `TestAssignment` items
864
+ */
865
+ adminStream(params?: TestAssignmentsAdminStreamParams): Paginator<TestAssignment>;
866
+ /**
867
+ * Convenience helper to fetch all test assignments (admin).
868
+ *
869
+ * @param params - Optional admin filters
870
+ * @returns All matching test assignments
871
+ */
872
+ adminListAll(params?: TestAssignmentsAdminStreamParams): Promise<TestAssignment[]>;
873
+ bulk(input: TestAssignmentsBulkInput): Promise<BulkResult>;
874
+ import(input: TestAssignmentsImportInput): Promise<BulkResult>;
875
+ }
876
+
877
+ /**
878
+ * PowerPath Client
879
+ *
880
+ * Main entry point for the PowerPath SDK.
881
+ */
882
+ /**
883
+ * PowerPath API client for adaptive learning workflows.
884
+ *
885
+ * Provides access to PowerPath endpoints including placement testing,
886
+ * lesson plans, assessment flow, screening sessions, and test assignments.
887
+ *
888
+ * @example
889
+ * ```typescript
890
+ * // Environment mode (Timeback APIs)
8
891
  * const client = new PowerPathClient({
9
- * env: 'staging',
892
+ * env: 'staging', // or 'production'
10
893
  * auth: {
11
894
  * clientId: 'your-client-id',
12
895
  * clientSecret: 'your-client-secret',
13
896
  * },
14
897
  * })
898
+ * ```
899
+ *
900
+ * @example
901
+ * ```typescript
902
+ * // Provider mode (shared tokens)
903
+ * import { TimebackProvider } from '@timeback/internal-client-infra'
904
+ *
905
+ * const provider = new TimebackProvider({
906
+ * platform: 'BEYOND_AI',
907
+ * env: 'staging',
908
+ * auth: { clientId: '...', clientSecret: '...' },
909
+ * })
15
910
  *
16
- * // Create an internal test
17
- * await client.assessments.createInternalTest({ ... })
911
+ * const client = new PowerPathClient({ provider })
18
912
  * ```
19
913
  *
20
- * @example Explicit mode (custom API)
914
+ * @example
21
915
  * ```typescript
916
+ * // Explicit mode (custom API)
22
917
  * const client = new PowerPathClient({
23
918
  * baseUrl: 'https://api.example.com',
24
919
  * auth: {
@@ -28,13 +923,107 @@
28
923
  * },
29
924
  * })
30
925
  * ```
926
+ *
927
+ * @example
928
+ * ```typescript
929
+ * // Environment variables fallback
930
+ * // Set POWERPATH_BASE_URL, POWERPATH_TOKEN_URL,
931
+ * // POWERPATH_CLIENT_ID, POWERPATH_CLIENT_SECRET
932
+ * const client = new PowerPathClient()
933
+ * ```
934
+ */
935
+ declare const PowerPathClient: {
936
+ new (config?: PowerPathClientConfig): {
937
+ readonly transport: PowerPathTransportLike;
938
+ readonly _provider?: _timeback_internal_client_infra.TimebackProvider | undefined;
939
+ readonly assessments: AssessmentResource;
940
+ readonly lessonPlans: LessonPlansResource;
941
+ readonly placement: PlacementResource;
942
+ readonly screening: ScreeningResource;
943
+ readonly syllabus: SyllabusResource;
944
+ readonly testAssignments: TestAssignmentsResource;
945
+ getTransport(): PowerPathTransportLike;
946
+ checkAuth(): Promise<_timeback_internal_client_infra.AuthCheckResult>;
947
+ };
948
+ };
949
+
950
+ /**
951
+ * PowerPath Client Factory
952
+ *
953
+ * Creates PowerPathClient classes bound to specific provider registries.
954
+ */
955
+
956
+ /**
957
+ * Create a PowerPathClient class bound to a specific provider registry.
958
+ *
959
+ * @param registry - Provider registry to use (defaults to all Timeback platforms)
960
+ * @returns PowerPathClient class bound to the registry
961
+ */
962
+ declare function createPowerPathClient(registry?: ProviderRegistry): {
963
+ new (config?: PowerPathClientConfig): {
964
+ /** @internal */
965
+ readonly transport: PowerPathTransportLike;
966
+ /** @internal */
967
+ readonly _provider?: TimebackProvider | undefined;
968
+ /** Create tests, attempts, and assessment responses */
969
+ readonly assessments: AssessmentResource;
970
+ /** Manage lesson plans and course progress */
971
+ readonly lessonPlans: LessonPlansResource;
972
+ /** Placement testing and progress */
973
+ readonly placement: PlacementResource;
974
+ /** Screening sessions and results */
975
+ readonly screening: ScreeningResource;
976
+ /** Course syllabus retrieval */
977
+ readonly syllabus: SyllabusResource;
978
+ /** Test assignment CRUD and bulk operations */
979
+ readonly testAssignments: TestAssignmentsResource;
980
+ /**
981
+ * Get the underlying transport for advanced use cases.
982
+ * @returns The transport instance used by this client
983
+ */
984
+ getTransport(): PowerPathTransportLike;
985
+ /**
986
+ * Verify that OAuth authentication is working.
987
+ * @returns Auth check result
988
+ * @throws {Error} If client was initialized with custom transport (no provider)
989
+ */
990
+ checkAuth(): Promise<AuthCheckResult>;
991
+ };
992
+ };
993
+
994
+ /**
995
+ * Transport Layer
996
+ *
997
+ * HTTP transport for PowerPath API communication.
998
+ */
999
+
1000
+ /**
1001
+ * HTTP transport layer for PowerPath API communication.
1002
+ *
1003
+ * Uses body-based pagination (totalCount, pageNumber, pageCount in response body).
31
1004
  */
32
- export { PowerPathClient, type PowerPathClientInstance } from './client';
33
- export { createPowerPathClient } from './factory';
34
- export type { PowerPathClientConfig } from './types/client';
35
- export type { Environment, EnvAuth, ExplicitAuth } from './types/client';
36
- export type { AuthCheckResult, ListParams, PageResult } from '@timeback/internal-client-infra';
37
- export type { AssignmentResult, BulkResult, TestAssignment, TestAssignmentStatus, TestAssignmentsListResponse, Attempt, CreateAttemptResponse, ExternalTestCreateResponse, GetAssessmentProgressResponse, GetAttemptsResponse, ResetAttemptResponse, GetAllPlacementTestsResponse, GetCurrentLevelResponse, GetNextPlacementTestResponse, GetSubjectProgressResponse, ResetPlacementResponse, ScreeningAssignTestResponse, ScreeningResetSessionResponse, ScreeningResultsResponse, ScreeningSessionResponse, CourseProgressResponse, LessonPlanCourseSyncResult, LessonPlanCreateResponse, LessonPlanOperation, LessonPlanOperationResult, LessonPlanOperationsResponse, LessonPlanResponse, LessonPlanSyncResult, UpdateStudentItemResponseResult, SyllabusResponse, PaginationMeta, } from '@timeback/types/protocols/powerpath';
38
- export type { CreateExternalPlacementTestInput, CreateExternalTestOutInput, CreateInternalTestInput, CreateNewAttemptInput, FinalStudentAssessmentResponseInput, GetAssessmentProgressParams, GetAttemptsParams, GetNextQuestionParams, ImportExternalTestAssignmentResultsParams, LessonPlanOperationInput, LessonPlanOperationsInput, LessonPlansCreateInput, LessonPlanUpdateStudentItemResponseInput, MakeExternalTestAssignmentInput, PlacementQueryParams, PlacementResetUserPlacementInput, ResetAttemptInput, ScreeningAssignTestInput, ScreeningResetSessionInput, SyllabusQueryParams, TestAssignmentsAdminParams, TestAssignmentsBulkInput, TestAssignmentsCreateInput, TestAssignmentsImportInput, TestAssignmentsListParams, TestAssignmentsUpdateInput, TestOutParams, UpdateStudentQuestionResponseInput, } from '@timeback/types/zod';
39
- export { Paginator, Transport } from './lib';
40
- //# sourceMappingURL=index.d.ts.map
1005
+ declare class Transport extends BaseTransport {
1006
+ /** API path profiles for PowerPath operations */
1007
+ readonly paths: PowerPathPaths;
1008
+ constructor(config: PowerPathTransportConfig);
1009
+ /**
1010
+ * Make a paginated request using body-based pagination.
1011
+ *
1012
+ * PowerPath APIs return pagination metadata in the response body:
1013
+ * - `totalCount`: Total items across all pages
1014
+ * - `pageCount`: Total number of pages
1015
+ * - `pageNumber`: Current page (1-indexed)
1016
+ *
1017
+ * The returned `data` is the full response body. Use Paginator's `unwrapKey`
1018
+ * to extract the actual items (e.g., "testAssignments").
1019
+ *
1020
+ * @template T - Expected item type in the response
1021
+ * @param path - API endpoint path
1022
+ * @param options - Request options
1023
+ * @returns Normalized paginated response with body as data
1024
+ */
1025
+ requestPaginated<T>(path: string, options?: RequestOptions): Promise<PaginatedResponse<T>>;
1026
+ }
1027
+
1028
+ export { Paginator, PowerPathClient, Transport, createPowerPathClient };
1029
+ export type { AssignmentResult, Attempt, BulkResult, CourseProgressResponse, CreateAttemptResponse, CreateExternalPlacementTestInput, CreateExternalTestOutInput, CreateInternalTestInput, CreateNewAttemptInput, ExternalTestCreateResponse, FinalStudentAssessmentResponseInput, GetAllPlacementTestsResponse, GetAssessmentProgressParams, GetAssessmentProgressResponse, GetAttemptsParams, GetAttemptsResponse, GetCurrentLevelResponse, GetNextPlacementTestResponse, GetNextQuestionParams, GetSubjectProgressResponse, ImportExternalTestAssignmentResultsParams, LessonPlanCourseSyncResult, LessonPlanCreateResponse, LessonPlanOperation, LessonPlanOperationInput, LessonPlanOperationResult, LessonPlanOperationsInput, LessonPlanOperationsResponse, LessonPlanResponse, LessonPlanSyncResult, LessonPlanUpdateStudentItemResponseInput, LessonPlansCreateInput, MakeExternalTestAssignmentInput, PaginationMeta, PlacementQueryParams, PlacementResetUserPlacementInput, PowerPathClientConfig, PowerPathClientInstance, ResetAttemptInput, ResetAttemptResponse, ResetPlacementResponse, ScreeningAssignTestInput, ScreeningAssignTestResponse, ScreeningResetSessionInput, ScreeningResetSessionResponse, ScreeningResultsResponse, ScreeningSessionResponse, SyllabusQueryParams, SyllabusResponse, TestAssignment, TestAssignmentStatus, TestAssignmentsAdminParams, TestAssignmentsBulkInput, TestAssignmentsCreateInput, TestAssignmentsImportInput, TestAssignmentsListParams, TestAssignmentsListResponse, TestAssignmentsUpdateInput, TestOutParams, UpdateStudentItemResponseResult, UpdateStudentQuestionResponseInput };