@speakableio/core 0.1.100 → 0.1.102

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.
@@ -1,75 +1,6 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
3
- import * as _tanstack_react_query from '@tanstack/react-query';
4
- import { QueryClient } from '@tanstack/react-query';
5
1
  import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
6
- import { Firestore, getDoc, getDocs, addDoc, setDoc, updateDoc, deleteDoc, runTransaction, writeBatch, doc, collection, query, serverTimestamp, orderBy, limit, startAt, startAfter, endAt, endBefore, where, increment, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
2
+ import { Firestore, getDoc, getDocs, addDoc, setDoc, updateDoc, deleteDoc, runTransaction, writeBatch, doc, collection, query, serverTimestamp, orderBy, limit, startAt, startAfter, endAt, endBefore, where, increment, Timestamp as Timestamp$1 } from 'firebase/firestore';
7
3
 
8
- type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
9
- interface FirestoreHelpers {
10
- getDoc: typeof getDoc;
11
- getDocs: typeof getDocs;
12
- addDoc: typeof addDoc;
13
- setDoc: typeof setDoc;
14
- updateDoc: typeof updateDoc;
15
- deleteDoc: typeof deleteDoc;
16
- runTransaction: typeof runTransaction;
17
- writeBatch: typeof writeBatch;
18
- doc: typeof doc;
19
- collection: typeof collection;
20
- query: typeof query;
21
- serverTimestamp: typeof serverTimestamp;
22
- orderBy: typeof orderBy;
23
- limit: typeof limit;
24
- startAt: typeof startAt;
25
- startAfter: typeof startAfter;
26
- endAt: typeof endAt;
27
- endBefore: typeof endBefore;
28
- where: typeof where;
29
- increment: typeof increment;
30
- }
31
- type CustomTimestamp = Timestamp | Timestamp$1;
32
- type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
33
-
34
- declare enum FeedbackTypesCard {
35
- SuggestedResponse = "suggested_response",
36
- Wida = "wida",
37
- GrammarInsights = "grammar_insights",
38
- Actfl = "actfl",
39
- ProficiencyLevel = "proficiency_level"
40
- }
41
- declare enum LeniencyCard {
42
- CONFIDENCE = "confidence",
43
- EASY = "easy",
44
- NORMAL = "normal",
45
- HARD = "hard"
46
- }
47
- declare const LENIENCY_OPTIONS: {
48
- label: string;
49
- value: LeniencyCard;
50
- }[];
51
- declare const STUDENT_LEVELS_OPTIONS: {
52
- label: string;
53
- description: string;
54
- value: string;
55
- }[];
56
- declare const BASE_RESPOND_FIELD_VALUES: {
57
- title: string;
58
- allowRetries: boolean;
59
- respondTime: number;
60
- maxCharacters: number;
61
- };
62
- declare const BASE_REPEAT_FIELD_VALUES: {
63
- repeat: number;
64
- };
65
- declare const BASE_MULTIPLE_CHOICE_FIELD_VALUES: {
66
- MCQType: string;
67
- answer: string[];
68
- choices: {
69
- option: string;
70
- value: string;
71
- }[];
72
- };
73
4
  declare enum VerificationCardStatus {
74
5
  VERIFIED = "VERIFIED",
75
6
  WARNING = "WARNING",
@@ -77,12 +8,6 @@ declare enum VerificationCardStatus {
77
8
  NOT_WORKING = "NOT_WORKING",
78
9
  NOT_CHECKED = "NOT_CHECKED"
79
10
  }
80
- declare const CARDS_COLLECTION = "flashcards";
81
- type RefsCardsFiresotre = `${typeof CARDS_COLLECTION}/${string}`;
82
- declare const refsCardsFiresotre: {
83
- allCards: string;
84
- card: (id: string) => `flashcards/${string}`;
85
- };
86
11
 
87
12
  interface PageActivityWithId extends PageActivity {
88
13
  id: string;
@@ -178,229 +103,32 @@ declare enum ActivityPageType {
178
103
  READ = "READ",
179
104
  ANSWER = "ANSWER"
180
105
  }
181
- declare const RESPOND_PAGE_ACTIVITY_TYPES: ActivityPageType[];
182
- declare const MULTIPLE_CHOICE_PAGE_ACTIVITY_TYPES: ActivityPageType[];
183
- declare const REPEAT_PAGE_ACTIVITY_TYPES: ActivityPageType[];
184
- declare const RESPOND_WRITE_PAGE_ACTIVITY_TYPES: ActivityPageType[];
185
- declare const RESPOND_AUDIO_PAGE_ACTIVITY_TYPES: ActivityPageType[];
186
-
187
- declare const cardsQueryKeys: {
188
- all: string[];
189
- one: (params: {
190
- cardId: string;
191
- }) => string[];
192
- };
193
- declare function useCards({ cardIds, enabled, asObject, }: {
194
- cardIds: string[];
195
- enabled: boolean;
196
- asObject?: boolean;
197
- }): {
198
- cards: PageActivityWithId[];
199
- cardsObject: Record<string, PageActivityWithId> | null;
200
- cardsQueries: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
201
- };
202
- declare function useCreateCard(): {
203
- mutationCreateCard: _tanstack_react_query.UseMutationResult<{
204
- id: string;
205
- } & Partial<PageActivity>, Error, {
206
- data: Partial<PageActivity>;
207
- }, unknown>;
208
- };
209
- declare function useCreateCards(): {
210
- mutationCreateCards: _tanstack_react_query.UseMutationResult<{
211
- id: string;
212
- owners: string[];
213
- checked?: boolean;
214
- completed?: boolean;
215
- media_area_id?: string | null;
216
- media_area_layout?: "left" | "right" | null;
217
- score?: number;
218
- verificationStatus?: VerificationCardStatus;
219
- native_text?: string;
220
- repeat?: number;
221
- language?: string | null;
222
- image?: {
223
- path?: string | null;
224
- url?: string;
225
- };
226
- audio?: {
227
- path?: string | null;
228
- url?: string;
229
- } | null;
230
- notes?: string;
231
- difficulty?: string;
232
- default_language?: string;
233
- target_text?: string;
234
- type: ActivityPageType;
235
- grading_criteria?: string;
236
- scoring_type?: string;
237
- grading_method?: "simple" | "rubric" | "manual" | "standards_based";
238
- feedback_types?: string[];
239
- rubricId?: string;
240
- prompt?: string;
241
- title?: string;
242
- passing_score?: number;
243
- maxCharacters?: number;
244
- answer?: string[];
245
- choices?: {
246
- value: string;
247
- option: string;
248
- }[];
249
- MCQType?: string;
250
- multipleAttemptsAllowed?: boolean;
251
- allowRetries?: boolean;
252
- question?: string;
253
- respondTime?: number;
254
- hidePrompt?: boolean;
255
- videoUrl?: string;
256
- link?: string;
257
- text?: string;
258
- isListenAloud?: boolean;
259
- embedCode?: string;
260
- attempt?: number;
261
- correct?: number;
262
- autoGrade?: boolean;
263
- points?: number;
264
- shuffle?: boolean;
265
- translation?: string;
266
- includeAIContext?: boolean;
267
- media_area_context_ref?: string | null;
268
- standardId?: string;
269
- target_proficiency_level?: string;
270
- allowTTS?: boolean;
271
- feedback_language?: string | null;
272
- correct_answer?: string | null;
273
- limit_attempts?: boolean;
274
- max_attempts?: number;
275
- rich_text?: string;
276
- }[], Error, {
277
- cards: PageActivity[];
278
- }, unknown>;
279
- };
280
- declare function getCardFromCache({ cardId, queryClient, }: {
281
- cardId: string;
282
- queryClient: QueryClient;
283
- }): PageActivityWithId | undefined;
284
- declare function updateCardInCache({ cardId, card, queryClient, }: {
285
- cardId: string;
286
- card: PageActivityWithId | null;
287
- queryClient: QueryClient;
288
- }): void;
289
- declare function useGetCard({ cardId, enabled }: {
290
- cardId: string;
291
- enabled?: boolean;
292
- }): _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>;
293
106
 
294
- declare const createCardRepo: () => {
295
- createCard: (args_0: {
296
- data: Partial<PageActivity>;
297
- }) => Promise<{
298
- id: string;
299
- } & Partial<PageActivity>>;
300
- createCards: (args_0: {
301
- cards: PageActivity[];
302
- }) => Promise<{
303
- id: string;
304
- owners: string[];
305
- checked?: boolean;
306
- completed?: boolean;
307
- media_area_id?: string | null;
308
- media_area_layout?: "left" | "right" | null;
309
- score?: number;
310
- verificationStatus?: VerificationCardStatus;
311
- native_text?: string;
312
- repeat?: number;
313
- language?: string | null;
314
- image?: {
315
- path?: string | null;
316
- url?: string;
317
- };
318
- audio?: {
319
- path?: string | null;
320
- url?: string;
321
- } | null;
322
- notes?: string;
323
- difficulty?: string;
324
- default_language?: string;
325
- target_text?: string;
326
- type: ActivityPageType;
327
- grading_criteria?: string;
328
- scoring_type?: string;
329
- grading_method?: "simple" | "rubric" | "manual" | "standards_based";
330
- feedback_types?: string[];
331
- rubricId?: string;
332
- prompt?: string;
333
- title?: string;
334
- passing_score?: number;
335
- maxCharacters?: number;
336
- answer?: string[];
337
- choices?: {
338
- value: string;
339
- option: string;
340
- }[];
341
- MCQType?: string;
342
- multipleAttemptsAllowed?: boolean;
343
- allowRetries?: boolean;
344
- question?: string;
345
- respondTime?: number;
346
- hidePrompt?: boolean;
347
- videoUrl?: string;
348
- link?: string;
349
- text?: string;
350
- isListenAloud?: boolean;
351
- embedCode?: string;
352
- attempt?: number;
353
- correct?: number;
354
- autoGrade?: boolean;
355
- points?: number;
356
- shuffle?: boolean;
357
- translation?: string;
358
- includeAIContext?: boolean;
359
- media_area_context_ref?: string | null;
360
- standardId?: string;
361
- target_proficiency_level?: string;
362
- allowTTS?: boolean;
363
- feedback_language?: string | null;
364
- correct_answer?: string | null;
365
- limit_attempts?: boolean;
366
- max_attempts?: number;
367
- rich_text?: string;
368
- }[]>;
369
- getCard: (params: {
370
- cardId: string;
371
- }) => Promise<PageActivityWithId | null>;
372
- };
373
-
374
- declare function checkIsRepeatPage(cardType: ActivityPageType | undefined): boolean;
375
- declare function checkIsMCPage(cardType: ActivityPageType | undefined): boolean;
376
- declare function checkIsRespondPage(cardType: ActivityPageType | undefined): boolean;
377
- declare function checkIsRespondWrittenPage(cardType: ActivityPageType | undefined): boolean;
378
- declare function checkIsRespondAudioPage(cardType: ActivityPageType | undefined): boolean;
379
- declare const checkIsMediaPage: (cardType: ActivityPageType | undefined) => boolean;
380
- declare const checkIsShortAnswerPage: (cardType: ActivityPageType | undefined) => boolean;
381
- declare const checkTypePageActivity: (cardType: ActivityPageType | undefined) => {
382
- isRespondAudio: boolean;
383
- isRespondWritten: boolean;
384
- isRespond: boolean;
385
- isMC: boolean;
386
- isRepeat: boolean;
387
- isMediaPage: boolean;
388
- isShortAnswer: boolean;
389
- };
390
-
391
- declare function getPagePrompt(card: PageActivityWithId | undefined): {
392
- has: boolean;
393
- text: string;
394
- rich_text: string;
395
- isTextEqualToRichText: boolean;
396
- };
397
-
398
- declare const getTotalCompletedCards: (pageScores: Score["cards"] | undefined) => number;
399
-
400
- declare const getLabelPage: (pageType: ActivityPageType | undefined) => {
401
- short: string;
402
- long: string;
403
- };
107
+ type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
108
+ interface FirestoreHelpers {
109
+ getDoc: typeof getDoc;
110
+ getDocs: typeof getDocs;
111
+ addDoc: typeof addDoc;
112
+ setDoc: typeof setDoc;
113
+ updateDoc: typeof updateDoc;
114
+ deleteDoc: typeof deleteDoc;
115
+ runTransaction: typeof runTransaction;
116
+ writeBatch: typeof writeBatch;
117
+ doc: typeof doc;
118
+ collection: typeof collection;
119
+ query: typeof query;
120
+ serverTimestamp: typeof serverTimestamp;
121
+ orderBy: typeof orderBy;
122
+ limit: typeof limit;
123
+ startAt: typeof startAt;
124
+ startAfter: typeof startAfter;
125
+ endAt: typeof endAt;
126
+ endBefore: typeof endBefore;
127
+ where: typeof where;
128
+ increment: typeof increment;
129
+ }
130
+ type CustomTimestamp = Timestamp | Timestamp$1;
131
+ type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
404
132
 
405
133
  interface Assignment {
406
134
  name: string;
@@ -452,123 +180,6 @@ interface AssignmentWithId extends Assignment {
452
180
  isAvailable: boolean;
453
181
  scores?: unknown;
454
182
  }
455
- interface Score {
456
- userId: string;
457
- owners: string[];
458
- progress: number;
459
- score: number;
460
- cards?: {
461
- [cardId: string]: PageScore;
462
- };
463
- courseId?: string;
464
- firstLoad?: boolean;
465
- googleClassroomUserId?: string;
466
- skippedCards?: number;
467
- lastPlayed?: CustomTimestamp;
468
- startDate?: CustomTimestamp;
469
- submissionDate?: CustomTimestamp;
470
- status?: 'SUBMITTED' | 'PENDING_REVIEW' | 'IN_PROGRESS' | 'FINALIZED';
471
- submitted?: boolean;
472
- successfulCards?: number;
473
- total_voiceSuccess?: number;
474
- total_voice_attempts?: number;
475
- total_words_spoken?: number;
476
- history?: PageScore[];
477
- attempts?: number;
478
- assignmentId?: string;
479
- setId?: string;
480
- }
481
- interface ScoreWithId extends Score {
482
- id: string;
483
- }
484
- interface PageScore {
485
- voiceSuccess?: number;
486
- voiceAttempts?: number;
487
- voiceFail?: number;
488
- completed?: boolean;
489
- attempts?: number;
490
- correct?: number;
491
- success?: boolean;
492
- aiSuccess?: boolean;
493
- grading_method?: 'simple' | 'rubric' | 'manual' | 'standards_based' | null;
494
- grammar_insights?: {
495
- type?: string;
496
- justification?: string;
497
- error?: boolean;
498
- correction?: string;
499
- }[];
500
- promptSuccess?: boolean;
501
- score?: number;
502
- simple_grading?: {
503
- justification?: string;
504
- success?: boolean;
505
- };
506
- suggested_response?: string;
507
- summary?: string;
508
- transcript?: string | null;
509
- errors?: any;
510
- improvedResponse?: string;
511
- audio?: string | null;
512
- actfl?: {
513
- justification: string;
514
- level: string;
515
- };
516
- wida?: {
517
- justification: string;
518
- level: string;
519
- };
520
- earned_points?: number;
521
- fileName?: string | null;
522
- max_points?: number;
523
- passing_score?: number;
524
- rubric?: {
525
- description: string;
526
- justification: string;
527
- maxPoints: number;
528
- score: number;
529
- score_title: string;
530
- title: string;
531
- }[] | null;
532
- scoring_type?: string;
533
- history?: PageScore[];
534
- media_area_opened?: boolean;
535
- noFeedbackAvailable?: boolean;
536
- proficiency_level?: {
537
- standardId: string;
538
- level: string;
539
- justification: string;
540
- key_indicators?: string[];
541
- };
542
- status?: string | null;
543
- transcriptError?: boolean;
544
- feedbackError?: boolean;
545
- totalTrys?: {
546
- markedCorrect?: boolean;
547
- selectedOption?: string | string[];
548
- attemptedAt?: CustomTimestamp;
549
- messageAttemptId?: string;
550
- }[];
551
- tryAgain?: boolean;
552
- updatedAt?: CustomTimestamp;
553
- messageAttemptId?: string;
554
- unmetCriteria?: {
555
- criterion: string;
556
- suggestion: string;
557
- explanation: string;
558
- }[];
559
- meetsCriteria?: boolean;
560
- actionableSteps?: string[];
561
- rubric_results?: {
562
- title: string;
563
- score: number;
564
- score_title: string;
565
- justification: string;
566
- maxPoints: number;
567
- description: string;
568
- }[];
569
- target_proficiency_level?: string;
570
- hint?: string[];
571
- }
572
183
 
573
184
  declare enum AssignmentAnalyticsType {
574
185
  Macro = "macro",
@@ -579,380 +190,6 @@ declare enum AssignmentAnalyticsType {
579
190
  All = "all"
580
191
  }
581
192
 
582
- declare const createAssignmentRepo: () => {
583
- getAssignment: (params: {
584
- assignmentId: string;
585
- currentUserId: string;
586
- analyticType?: AssignmentAnalyticsType;
587
- studentId?: string;
588
- }) => Promise<AssignmentWithId | {
589
- scores: any;
590
- id: string;
591
- isAvailable: boolean;
592
- name: string;
593
- description: string;
594
- scheduledTime?: string | null;
595
- dueTime?: {
596
- hours: number;
597
- minutes: number;
598
- nanos: number;
599
- };
600
- speakableio: boolean;
601
- owners: string[];
602
- image: {
603
- path: string | null;
604
- url: string;
605
- };
606
- dueDate: {
607
- day: number;
608
- month: number;
609
- year: number;
610
- };
611
- teacherName: string;
612
- courseWorkId: string | null;
613
- dueDateTimestamp: CustomTimestamp;
614
- scheduledTimeTimestamp: number;
615
- active: boolean;
616
- voice: string | null;
617
- setId: string;
618
- dateMade: {
619
- seconds: number;
620
- nanoseconds: number;
621
- };
622
- maxPoints: number;
623
- courseId: string;
624
- isAssessment: boolean;
625
- ltiDeeplink?: string;
626
- content?: string[];
627
- weights?: Record<string, number>;
628
- language?: string;
629
- types?: { [key in ActivityPageType]?: number; };
630
- aiEnabled?: boolean;
631
- chat_experience?: boolean;
632
- } | null>;
633
- attachScoresAssignment: (args_0: {
634
- assignments: AssignmentWithId[];
635
- analyticType: AssignmentAnalyticsType;
636
- studentId?: string;
637
- currentUserId: string;
638
- }) => Promise<{
639
- scores: any;
640
- id: string;
641
- isAvailable: boolean;
642
- name: string;
643
- description: string;
644
- scheduledTime?: string | null;
645
- dueTime?: {
646
- hours: number;
647
- minutes: number;
648
- nanos: number;
649
- };
650
- speakableio: boolean;
651
- owners: string[];
652
- image: {
653
- path: string | null;
654
- url: string;
655
- };
656
- dueDate: {
657
- day: number;
658
- month: number;
659
- year: number;
660
- };
661
- teacherName: string;
662
- courseWorkId: string | null;
663
- dueDateTimestamp: CustomTimestamp;
664
- scheduledTimeTimestamp: number;
665
- active: boolean;
666
- voice: string | null;
667
- setId: string;
668
- dateMade: {
669
- seconds: number;
670
- nanoseconds: number;
671
- };
672
- maxPoints: number;
673
- courseId: string;
674
- isAssessment: boolean;
675
- ltiDeeplink?: string;
676
- content?: string[];
677
- weights?: Record<string, number>;
678
- language?: string;
679
- types?: { [key in ActivityPageType]?: number; };
680
- aiEnabled?: boolean;
681
- chat_experience?: boolean;
682
- }[]>;
683
- getAssignmentScores: (args_0: {
684
- assignmentId: string;
685
- currentUserId: string;
686
- analyticType?: AssignmentAnalyticsType;
687
- studentId?: string;
688
- }) => Promise<{
689
- scores: unknown;
690
- id: string;
691
- } | undefined>;
692
- getAllAssignments: () => Promise<(AssignmentWithId & {
693
- id: string;
694
- })[]>;
695
- };
696
-
697
- declare const assignmentQueryKeys: {
698
- all: readonly ["assignments"];
699
- byId: (id: string) => readonly ["assignments", string];
700
- list: () => readonly ["assignments", "list"];
701
- };
702
- declare function useAssignment({ assignmentId, enabled, analyticType, userId, }: {
703
- assignmentId: string;
704
- enabled?: boolean;
705
- analyticType?: AssignmentAnalyticsType;
706
- userId: string;
707
- }): _tanstack_react_query.UseQueryResult<AssignmentWithId | {
708
- scores: any;
709
- id: string;
710
- isAvailable: boolean;
711
- name: string;
712
- description: string;
713
- scheduledTime?: string | null;
714
- dueTime?: {
715
- hours: number;
716
- minutes: number;
717
- nanos: number;
718
- };
719
- speakableio: boolean;
720
- owners: string[];
721
- image: {
722
- path: string | null;
723
- url: string;
724
- };
725
- dueDate: {
726
- day: number;
727
- month: number;
728
- year: number;
729
- };
730
- teacherName: string;
731
- courseWorkId: string | null;
732
- dueDateTimestamp: CustomTimestamp;
733
- scheduledTimeTimestamp: number;
734
- active: boolean;
735
- voice: string | null;
736
- setId: string;
737
- dateMade: {
738
- seconds: number;
739
- nanoseconds: number;
740
- };
741
- maxPoints: number;
742
- courseId: string;
743
- isAssessment: boolean;
744
- ltiDeeplink?: string;
745
- content?: string[];
746
- weights?: Record<string, number>;
747
- language?: string;
748
- types?: { [key in ActivityPageType]?: number; };
749
- aiEnabled?: boolean;
750
- chat_experience?: boolean;
751
- } | null, Error>;
752
-
753
- declare const scoreQueryKeys: {
754
- all: readonly ["scores"];
755
- byId: (id: string) => readonly ["scores", string];
756
- list: () => readonly ["scores", "list"];
757
- };
758
- declare function useScore({ isAssignment, activityId, userId, courseId, enabled, googleClassroomUserId, }: {
759
- userId: string;
760
- isAssignment: boolean;
761
- activityId: string;
762
- courseId?: string;
763
- enabled?: boolean;
764
- googleClassroomUserId?: string;
765
- }): _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
766
- declare function useUpdateScore(): {
767
- mutationUpdateScore: _tanstack_react_query.UseMutationResult<Promise<void>, Error, {
768
- userId: string;
769
- data: Partial<Score>;
770
- isAssignment: boolean;
771
- activityId: string;
772
- }, {
773
- previousData: Partial<Score> | undefined;
774
- }>;
775
- };
776
- declare function useUpdateCardScore({ isAssignment, activityId, userId, cardIds, weights, }: {
777
- isAssignment: boolean;
778
- userId: string;
779
- activityId: string;
780
- cardIds: string[];
781
- weights: Record<string, number>;
782
- }): {
783
- mutationUpdateCardScore: _tanstack_react_query.UseMutationResult<{
784
- cardId: string;
785
- scoresUpdated: Score;
786
- }, Error, {
787
- cardId: string;
788
- cardScore: PageScore;
789
- }, void>;
790
- };
791
- declare function useClearScore(): {
792
- mutationClearScore: _tanstack_react_query.UseMutationResult<{
793
- update: Partial<Score>;
794
- activityId: string;
795
- }, Error, {
796
- isAssignment: boolean;
797
- cardId: string;
798
- cardScores: PageScore;
799
- userId: string;
800
- activityId: string;
801
- }, unknown>;
802
- };
803
- declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName, }: {
804
- onAssignmentSubmitted: (assignmentId: string) => void;
805
- studentName: string;
806
- }): {
807
- submitAssignmentScore: _tanstack_react_query.UseMutateAsyncFunction<{
808
- success: boolean;
809
- message: string;
810
- error?: undefined;
811
- } | {
812
- success: boolean;
813
- error: unknown;
814
- message?: undefined;
815
- }, Error, {
816
- assignment: {
817
- id: string;
818
- name: string;
819
- owners: string[];
820
- courseId: string;
821
- courseWorkId: string;
822
- isAssessment: boolean;
823
- maxPoints: number;
824
- };
825
- userId: string;
826
- cardIds: string[];
827
- weights: Record<string, number>;
828
- scores: Score;
829
- status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
830
- }, unknown>;
831
- isLoading: boolean;
832
- };
833
- declare function useSubmitPracticeScore(): {
834
- submitPracticeScore: _tanstack_react_query.UseMutateAsyncFunction<{
835
- success: boolean;
836
- message: string;
837
- error?: undefined;
838
- } | {
839
- success: boolean;
840
- error: unknown;
841
- message?: undefined;
842
- }, Error, {
843
- setId: string;
844
- userId: string;
845
- scores: Score;
846
- }, unknown>;
847
- isLoading: boolean;
848
- };
849
-
850
- interface SetWithId extends Set {
851
- id: string;
852
- }
853
- interface Set {
854
- id: string;
855
- language: string;
856
- ownerName: string;
857
- weights: Record<string, number>;
858
- repeat?: number;
859
- voice?: string;
860
- averagePhraseLength?: number;
861
- passing_score?: number;
862
- organizations?: string[];
863
- description: string;
864
- image: {
865
- url: string;
866
- path: null | string;
867
- };
868
- additionalLanguages?: string[];
869
- owners: string[];
870
- name: string;
871
- content: string[];
872
- types: {
873
- [key in ActivityPageType]?: number;
874
- };
875
- defaultLanguage: string;
876
- createdAt: FieldValue;
877
- public: boolean;
878
- defaultRubricId?: string;
879
- difficulty?: string;
880
- end_screen?: {
881
- variant: 0 | 1 | 2;
882
- title: string;
883
- description: string;
884
- };
885
- mcAllowRetries?: boolean;
886
- welcome_screen?: {
887
- variant: 'colored' | 'blank';
888
- };
889
- poorFunctionalityWarning?: boolean;
890
- status?: 'draft' | 'published';
891
- subjects?: any[];
892
- respondAllowRetries?: boolean;
893
- respondAllowTTS?: boolean;
894
- feedbackLanguage?: string;
895
- respondMaxCharacters?: number;
896
- respondMaxTime?: number;
897
- }
898
-
899
- declare const setsQueryKeys: {
900
- all: string[];
901
- one: (params: {
902
- setId: string;
903
- }) => string[];
904
- };
905
- declare const useSet: ({ setId, enabled }: {
906
- setId: string;
907
- enabled?: boolean;
908
- }) => _tanstack_react_query.UseQueryResult<SetWithId | null, Error>;
909
- declare function getSetFromCache({ setId, queryClient, }: {
910
- setId: string | undefined;
911
- queryClient: QueryClient;
912
- }): SetWithId | null | undefined;
913
- declare function updateSetInCache({ set, queryClient, }: {
914
- set: SetWithId;
915
- queryClient: QueryClient;
916
- }): void;
917
-
918
- declare const SETS_COLLECTION = "sets";
919
- type RefsSetsFirestore = `${typeof SETS_COLLECTION}/${string}`;
920
- declare const refsSetsFirestore: {
921
- allSets: string;
922
- set: (id: string) => `sets/${string}`;
923
- };
924
-
925
- declare const createSetRepo: () => {
926
- getSet: (args_0: {
927
- setId: string;
928
- }) => Promise<SetWithId | null>;
929
- };
930
-
931
- declare const SPEAKABLE_NOTIFICATIONS: {
932
- readonly NEW_ASSIGNMENT: "new_assignment";
933
- readonly ASSESSMENT_SUBMITTED: "assessment_submitted";
934
- readonly ASSESSMENT_SCORED: "assessment_scored";
935
- readonly NEW_COMMENT: "NEW_COMMENT";
936
- };
937
- type SpeakableNotificationType = (typeof SPEAKABLE_NOTIFICATIONS)[keyof typeof SPEAKABLE_NOTIFICATIONS];
938
- declare const SpeakableNotificationTypes: {
939
- NEW_ASSIGNMENT: string;
940
- FEEDBACK_FROM_TEACHER: string;
941
- MESSAGE_FROM_STUDENT: string;
942
- PHRASE_MARKED_CORRECT: string;
943
- STUDENT_PROGRESS: string;
944
- PLAYLIST_FOLLOWERS: string;
945
- PLAYLIST_PLAYS: string;
946
- ASSESSMENT_SUBMITTED: string;
947
- ASSESSMENT_SCORED: string;
948
- NEW_COMMENT: string;
949
- };
950
-
951
- declare const useCreateNotification: () => {
952
- createNotification: (type: SpeakableNotificationType, data: any) => Promise<any>;
953
- };
954
-
955
- type FsClient = ReturnType<typeof createFsClientBase>;
956
193
  type FsClientParams = Omit<Parameters<typeof createFsClientBase>[0], 'helpers'>;
957
194
  declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
958
195
  db: FirebaseInstance;
@@ -1155,1486 +392,6 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1155
392
  };
1156
393
  };
1157
394
 
1158
- interface UserProfile {
1159
- googleClassroomUserId: string;
1160
- image: {
1161
- url: string;
1162
- path: string;
1163
- };
1164
- displayName: string;
1165
- isTeacher?: boolean;
1166
- isStudent?: boolean;
1167
- roles?: string[];
1168
- }
1169
- interface UserAuth {
1170
- uid: string;
1171
- email: string;
1172
- displayName: string | null;
1173
- }
1174
- interface Lti {
1175
- data: {
1176
- services: {
1177
- serviceKey: string;
1178
- };
1179
- };
1180
- }
1181
- interface User {
1182
- profile: UserProfile;
1183
- auth: UserAuth;
1184
- lti: Lti;
1185
- roles: string[];
1186
- }
1187
-
1188
- declare const SpeakablePlanTypes: {
1189
- readonly basic: "basic";
1190
- readonly teacher_pro: "teacher_pro";
1191
- readonly school_starter: "school_starter";
1192
- readonly organization: "organization";
1193
- readonly starter: "starter";
1194
- readonly growth: "growth";
1195
- readonly professional: "professional";
1196
- };
1197
-
1198
- interface Permissions {
1199
- loaded: boolean;
1200
- loading: boolean;
1201
- permissions: string[];
1202
- plan: keyof typeof SpeakablePlanTypes;
1203
- subscriptionId: string;
1204
- isInstitutionPlan: boolean;
1205
- type: string;
1206
- contact: string;
1207
- hasStudentPortfolios?: boolean;
1208
- refreshDate: string;
1209
- isStripePlan: boolean;
1210
- freeOrgTrialExpired?: boolean;
1211
- }
1212
-
1213
- interface FsContext {
1214
- speakableApi: Awaited<FsClient>;
1215
- queryClient: QueryClient;
1216
- user: User;
1217
- permissions: Permissions;
1218
- }
1219
- declare const FsCtx: React.Context<FsContext | null>;
1220
- declare function SpeakableProvider({ user, children, queryClient, permissions, fsClient, }: {
1221
- children: React.ReactNode;
1222
- fsClient: FsClient;
1223
- permissions: Permissions;
1224
- queryClient: QueryClient;
1225
- user: User;
1226
- }): react_jsx_runtime.JSX.Element | null;
1227
- declare function useSpeakableApi(): FsContext;
1228
-
1229
- declare const getRespondCardTool: ({ language, standard, }: {
1230
- language: string;
1231
- standard: string;
1232
- }) => {
1233
- tool_choice: {
1234
- type: string;
1235
- function: {
1236
- name: string;
1237
- };
1238
- };
1239
- tools: {
1240
- type: string;
1241
- function: {
1242
- name: string;
1243
- description: string;
1244
- parameters: {
1245
- type: string;
1246
- required: string[];
1247
- properties: {
1248
- success: {
1249
- type: string;
1250
- description: string;
1251
- };
1252
- errors: {
1253
- type: string;
1254
- items: {
1255
- type: string;
1256
- required: string[];
1257
- properties: {
1258
- error: {
1259
- type: string;
1260
- description: string;
1261
- };
1262
- correction: {
1263
- type: string;
1264
- description: string;
1265
- };
1266
- justification: {
1267
- type: string;
1268
- description: string;
1269
- };
1270
- grammar_error_type: {
1271
- type: string;
1272
- enum: string[];
1273
- description: string;
1274
- };
1275
- };
1276
- };
1277
- description: string;
1278
- };
1279
- compliments: {
1280
- type: string;
1281
- items: {
1282
- type: string;
1283
- };
1284
- description: string;
1285
- };
1286
- improvedResponse: {
1287
- type: string;
1288
- description: string;
1289
- };
1290
- score: {
1291
- type: string;
1292
- description: string;
1293
- };
1294
- score_justification: {
1295
- type: string;
1296
- description: string;
1297
- };
1298
- };
1299
- };
1300
- };
1301
- }[];
1302
- };
1303
-
1304
- declare function debounce<T extends (...args: any[]) => Promise<any>>(func: T, waitFor: number): (...args: Parameters<T>) => Promise<ReturnType<T>>;
1305
-
1306
- declare const purify: (word: string) => string;
1307
- declare const cleanString: (words: string) => string | string[];
1308
- declare const getWordHash: (word: string, language: string) => string;
1309
- declare function getPhraseLength(phrase: string, input?: string): number;
1310
-
1311
- declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData, }: {
1312
- id: string;
1313
- isAssignment: boolean;
1314
- onAssignmentSubmitted: (assignmentId: string) => void;
1315
- ltiData?: {
1316
- lineItemId?: string;
1317
- lti_id?: string;
1318
- serviceKey?: string;
1319
- };
1320
- }): {
1321
- set: {
1322
- data: SetWithId | null | undefined;
1323
- query: _tanstack_react_query.UseQueryResult<SetWithId | null, Error>;
1324
- };
1325
- cards: {
1326
- data: Record<string, PageActivityWithId> | null;
1327
- query: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
1328
- cardsArray: PageActivityWithId[];
1329
- };
1330
- assignment: {
1331
- data: AssignmentWithId | {
1332
- scores: any;
1333
- id: string;
1334
- isAvailable: boolean;
1335
- name: string;
1336
- description: string;
1337
- scheduledTime?: string | null;
1338
- dueTime?: {
1339
- hours: number;
1340
- minutes: number;
1341
- nanos: number;
1342
- };
1343
- speakableio: boolean;
1344
- owners: string[];
1345
- image: {
1346
- path: string | null;
1347
- url: string;
1348
- };
1349
- dueDate: {
1350
- day: number;
1351
- month: number;
1352
- year: number;
1353
- };
1354
- teacherName: string;
1355
- courseWorkId: string | null;
1356
- dueDateTimestamp: CustomTimestamp;
1357
- scheduledTimeTimestamp: number;
1358
- active: boolean;
1359
- voice: string | null;
1360
- setId: string;
1361
- dateMade: {
1362
- seconds: number;
1363
- nanoseconds: number;
1364
- };
1365
- maxPoints: number;
1366
- courseId: string;
1367
- isAssessment: boolean;
1368
- ltiDeeplink?: string;
1369
- content?: string[];
1370
- weights?: Record<string, number>;
1371
- language?: string;
1372
- types?: { [key in ActivityPageType]?: number; };
1373
- aiEnabled?: boolean;
1374
- chat_experience?: boolean;
1375
- } | null | undefined;
1376
- query: _tanstack_react_query.UseQueryResult<AssignmentWithId | {
1377
- scores: any;
1378
- id: string;
1379
- isAvailable: boolean;
1380
- name: string;
1381
- description: string;
1382
- scheduledTime?: string | null;
1383
- dueTime?: {
1384
- hours: number;
1385
- minutes: number;
1386
- nanos: number;
1387
- };
1388
- speakableio: boolean;
1389
- owners: string[];
1390
- image: {
1391
- path: string | null;
1392
- url: string;
1393
- };
1394
- dueDate: {
1395
- day: number;
1396
- month: number;
1397
- year: number;
1398
- };
1399
- teacherName: string;
1400
- courseWorkId: string | null;
1401
- dueDateTimestamp: CustomTimestamp;
1402
- scheduledTimeTimestamp: number;
1403
- active: boolean;
1404
- voice: string | null;
1405
- setId: string;
1406
- dateMade: {
1407
- seconds: number;
1408
- nanoseconds: number;
1409
- };
1410
- maxPoints: number;
1411
- courseId: string;
1412
- isAssessment: boolean;
1413
- ltiDeeplink?: string;
1414
- content?: string[];
1415
- weights?: Record<string, number>;
1416
- language?: string;
1417
- types?: { [key in ActivityPageType]?: number; };
1418
- aiEnabled?: boolean;
1419
- chat_experience?: boolean;
1420
- } | null, Error>;
1421
- };
1422
- scores: {
1423
- data: ScoreWithId | undefined;
1424
- query: _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
1425
- actions: {
1426
- update: (data: Partial<Score>) => void;
1427
- clear: ({ cardId, wasCompleted, }: {
1428
- cardId: string;
1429
- wasCompleted?: boolean;
1430
- }) => void;
1431
- submit: () => Promise<{
1432
- success: boolean;
1433
- message: string;
1434
- error?: undefined;
1435
- } | {
1436
- success: boolean;
1437
- error: unknown;
1438
- message?: undefined;
1439
- }>;
1440
- updateCard: (cardId: string, cardScore: PageScore) => void;
1441
- logGradingStandardEntry: ({ cardId, gradingStandard, type, }: {
1442
- cardId: string;
1443
- gradingStandard: {
1444
- level: string;
1445
- justification: string;
1446
- };
1447
- type: "actfl" | "wida" | "custom";
1448
- }) => void;
1449
- };
1450
- };
1451
- };
1452
-
1453
- interface CreditContract {
1454
- allocationSource: string;
1455
- createdAt: string;
1456
- creditsAllocatedThisPeriod: number;
1457
- effectivePlanId: string;
1458
- email: string;
1459
- isUnlimited: boolean;
1460
- lastUpdatedAt: string;
1461
- ownerType: string;
1462
- periodStart: string;
1463
- periodEnd: string;
1464
- planTermEndTimestamp: string | null;
1465
- sourceDetails: Record<string, unknown>;
1466
- creditsAvailable?: number;
1467
- topOffCreditsAvailable?: number;
1468
- }
1469
- declare const creditQueryKeys: {
1470
- userCredits: (uid: string) => readonly ["userCredits", string];
1471
- };
1472
- declare const useUserCredits: () => {
1473
- data: {
1474
- id: string;
1475
- userId: string;
1476
- email: string;
1477
- effectivePlanId: string;
1478
- status: string;
1479
- isUnlimited: boolean;
1480
- creditsAvailable: number;
1481
- creditsAllocatedThisPeriod: number;
1482
- topOffCreditsAvailable: number;
1483
- topOffCreditsTotal: number;
1484
- allocationSource: string;
1485
- sourceDetails: {};
1486
- periodStart: null;
1487
- periodEnd: null;
1488
- planTermEndTimestamp: null;
1489
- ownerType: string;
1490
- createdAt: string;
1491
- lastUpdatedAt: string;
1492
- } | {
1493
- totalCreditsAvailable: number;
1494
- allocationSource: string;
1495
- createdAt: string;
1496
- creditsAllocatedThisPeriod: number;
1497
- effectivePlanId: string;
1498
- email: string;
1499
- isUnlimited: boolean;
1500
- lastUpdatedAt: string;
1501
- ownerType: string;
1502
- periodStart: string;
1503
- periodEnd: string;
1504
- planTermEndTimestamp: string | null;
1505
- sourceDetails: Record<string, unknown>;
1506
- creditsAvailable?: number;
1507
- topOffCreditsAvailable?: number;
1508
- id: string;
1509
- userId?: undefined;
1510
- status?: undefined;
1511
- topOffCreditsTotal?: undefined;
1512
- };
1513
- error: Error;
1514
- isError: true;
1515
- isPending: false;
1516
- isLoading: false;
1517
- isLoadingError: false;
1518
- isRefetchError: true;
1519
- isSuccess: false;
1520
- isPlaceholderData: false;
1521
- status: "error";
1522
- dataUpdatedAt: number;
1523
- errorUpdatedAt: number;
1524
- failureCount: number;
1525
- failureReason: Error | null;
1526
- errorUpdateCount: number;
1527
- isFetched: boolean;
1528
- isFetchedAfterMount: boolean;
1529
- isFetching: boolean;
1530
- isInitialLoading: boolean;
1531
- isPaused: boolean;
1532
- isRefetching: boolean;
1533
- isStale: boolean;
1534
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1535
- id: string;
1536
- userId: string;
1537
- email: string;
1538
- effectivePlanId: string;
1539
- status: string;
1540
- isUnlimited: boolean;
1541
- creditsAvailable: number;
1542
- creditsAllocatedThisPeriod: number;
1543
- topOffCreditsAvailable: number;
1544
- topOffCreditsTotal: number;
1545
- allocationSource: string;
1546
- sourceDetails: {};
1547
- periodStart: null;
1548
- periodEnd: null;
1549
- planTermEndTimestamp: null;
1550
- ownerType: string;
1551
- createdAt: string;
1552
- lastUpdatedAt: string;
1553
- } | {
1554
- totalCreditsAvailable: number;
1555
- allocationSource: string;
1556
- createdAt: string;
1557
- creditsAllocatedThisPeriod: number;
1558
- effectivePlanId: string;
1559
- email: string;
1560
- isUnlimited: boolean;
1561
- lastUpdatedAt: string;
1562
- ownerType: string;
1563
- periodStart: string;
1564
- periodEnd: string;
1565
- planTermEndTimestamp: string | null;
1566
- sourceDetails: Record<string, unknown>;
1567
- creditsAvailable?: number;
1568
- topOffCreditsAvailable?: number;
1569
- id: string;
1570
- userId?: undefined;
1571
- status?: undefined;
1572
- topOffCreditsTotal?: undefined;
1573
- }, Error>>;
1574
- fetchStatus: _tanstack_react_query.FetchStatus;
1575
- promise: Promise<{
1576
- id: string;
1577
- userId: string;
1578
- email: string;
1579
- effectivePlanId: string;
1580
- status: string;
1581
- isUnlimited: boolean;
1582
- creditsAvailable: number;
1583
- creditsAllocatedThisPeriod: number;
1584
- topOffCreditsAvailable: number;
1585
- topOffCreditsTotal: number;
1586
- allocationSource: string;
1587
- sourceDetails: {};
1588
- periodStart: null;
1589
- periodEnd: null;
1590
- planTermEndTimestamp: null;
1591
- ownerType: string;
1592
- createdAt: string;
1593
- lastUpdatedAt: string;
1594
- } | {
1595
- totalCreditsAvailable: number;
1596
- allocationSource: string;
1597
- createdAt: string;
1598
- creditsAllocatedThisPeriod: number;
1599
- effectivePlanId: string;
1600
- email: string;
1601
- isUnlimited: boolean;
1602
- lastUpdatedAt: string;
1603
- ownerType: string;
1604
- periodStart: string;
1605
- periodEnd: string;
1606
- planTermEndTimestamp: string | null;
1607
- sourceDetails: Record<string, unknown>;
1608
- creditsAvailable?: number;
1609
- topOffCreditsAvailable?: number;
1610
- id: string;
1611
- userId?: undefined;
1612
- status?: undefined;
1613
- topOffCreditsTotal?: undefined;
1614
- }>;
1615
- } | {
1616
- data: {
1617
- id: string;
1618
- userId: string;
1619
- email: string;
1620
- effectivePlanId: string;
1621
- status: string;
1622
- isUnlimited: boolean;
1623
- creditsAvailable: number;
1624
- creditsAllocatedThisPeriod: number;
1625
- topOffCreditsAvailable: number;
1626
- topOffCreditsTotal: number;
1627
- allocationSource: string;
1628
- sourceDetails: {};
1629
- periodStart: null;
1630
- periodEnd: null;
1631
- planTermEndTimestamp: null;
1632
- ownerType: string;
1633
- createdAt: string;
1634
- lastUpdatedAt: string;
1635
- } | {
1636
- totalCreditsAvailable: number;
1637
- allocationSource: string;
1638
- createdAt: string;
1639
- creditsAllocatedThisPeriod: number;
1640
- effectivePlanId: string;
1641
- email: string;
1642
- isUnlimited: boolean;
1643
- lastUpdatedAt: string;
1644
- ownerType: string;
1645
- periodStart: string;
1646
- periodEnd: string;
1647
- planTermEndTimestamp: string | null;
1648
- sourceDetails: Record<string, unknown>;
1649
- creditsAvailable?: number;
1650
- topOffCreditsAvailable?: number;
1651
- id: string;
1652
- userId?: undefined;
1653
- status?: undefined;
1654
- topOffCreditsTotal?: undefined;
1655
- };
1656
- error: null;
1657
- isError: false;
1658
- isPending: false;
1659
- isLoading: false;
1660
- isLoadingError: false;
1661
- isRefetchError: false;
1662
- isSuccess: true;
1663
- isPlaceholderData: false;
1664
- status: "success";
1665
- dataUpdatedAt: number;
1666
- errorUpdatedAt: number;
1667
- failureCount: number;
1668
- failureReason: Error | null;
1669
- errorUpdateCount: number;
1670
- isFetched: boolean;
1671
- isFetchedAfterMount: boolean;
1672
- isFetching: boolean;
1673
- isInitialLoading: boolean;
1674
- isPaused: boolean;
1675
- isRefetching: boolean;
1676
- isStale: boolean;
1677
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1678
- id: string;
1679
- userId: string;
1680
- email: string;
1681
- effectivePlanId: string;
1682
- status: string;
1683
- isUnlimited: boolean;
1684
- creditsAvailable: number;
1685
- creditsAllocatedThisPeriod: number;
1686
- topOffCreditsAvailable: number;
1687
- topOffCreditsTotal: number;
1688
- allocationSource: string;
1689
- sourceDetails: {};
1690
- periodStart: null;
1691
- periodEnd: null;
1692
- planTermEndTimestamp: null;
1693
- ownerType: string;
1694
- createdAt: string;
1695
- lastUpdatedAt: string;
1696
- } | {
1697
- totalCreditsAvailable: number;
1698
- allocationSource: string;
1699
- createdAt: string;
1700
- creditsAllocatedThisPeriod: number;
1701
- effectivePlanId: string;
1702
- email: string;
1703
- isUnlimited: boolean;
1704
- lastUpdatedAt: string;
1705
- ownerType: string;
1706
- periodStart: string;
1707
- periodEnd: string;
1708
- planTermEndTimestamp: string | null;
1709
- sourceDetails: Record<string, unknown>;
1710
- creditsAvailable?: number;
1711
- topOffCreditsAvailable?: number;
1712
- id: string;
1713
- userId?: undefined;
1714
- status?: undefined;
1715
- topOffCreditsTotal?: undefined;
1716
- }, Error>>;
1717
- fetchStatus: _tanstack_react_query.FetchStatus;
1718
- promise: Promise<{
1719
- id: string;
1720
- userId: string;
1721
- email: string;
1722
- effectivePlanId: string;
1723
- status: string;
1724
- isUnlimited: boolean;
1725
- creditsAvailable: number;
1726
- creditsAllocatedThisPeriod: number;
1727
- topOffCreditsAvailable: number;
1728
- topOffCreditsTotal: number;
1729
- allocationSource: string;
1730
- sourceDetails: {};
1731
- periodStart: null;
1732
- periodEnd: null;
1733
- planTermEndTimestamp: null;
1734
- ownerType: string;
1735
- createdAt: string;
1736
- lastUpdatedAt: string;
1737
- } | {
1738
- totalCreditsAvailable: number;
1739
- allocationSource: string;
1740
- createdAt: string;
1741
- creditsAllocatedThisPeriod: number;
1742
- effectivePlanId: string;
1743
- email: string;
1744
- isUnlimited: boolean;
1745
- lastUpdatedAt: string;
1746
- ownerType: string;
1747
- periodStart: string;
1748
- periodEnd: string;
1749
- planTermEndTimestamp: string | null;
1750
- sourceDetails: Record<string, unknown>;
1751
- creditsAvailable?: number;
1752
- topOffCreditsAvailable?: number;
1753
- id: string;
1754
- userId?: undefined;
1755
- status?: undefined;
1756
- topOffCreditsTotal?: undefined;
1757
- }>;
1758
- } | {
1759
- data: undefined;
1760
- error: Error;
1761
- isError: true;
1762
- isPending: false;
1763
- isLoading: false;
1764
- isLoadingError: true;
1765
- isRefetchError: false;
1766
- isSuccess: false;
1767
- isPlaceholderData: false;
1768
- status: "error";
1769
- dataUpdatedAt: number;
1770
- errorUpdatedAt: number;
1771
- failureCount: number;
1772
- failureReason: Error | null;
1773
- errorUpdateCount: number;
1774
- isFetched: boolean;
1775
- isFetchedAfterMount: boolean;
1776
- isFetching: boolean;
1777
- isInitialLoading: boolean;
1778
- isPaused: boolean;
1779
- isRefetching: boolean;
1780
- isStale: boolean;
1781
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1782
- id: string;
1783
- userId: string;
1784
- email: string;
1785
- effectivePlanId: string;
1786
- status: string;
1787
- isUnlimited: boolean;
1788
- creditsAvailable: number;
1789
- creditsAllocatedThisPeriod: number;
1790
- topOffCreditsAvailable: number;
1791
- topOffCreditsTotal: number;
1792
- allocationSource: string;
1793
- sourceDetails: {};
1794
- periodStart: null;
1795
- periodEnd: null;
1796
- planTermEndTimestamp: null;
1797
- ownerType: string;
1798
- createdAt: string;
1799
- lastUpdatedAt: string;
1800
- } | {
1801
- totalCreditsAvailable: number;
1802
- allocationSource: string;
1803
- createdAt: string;
1804
- creditsAllocatedThisPeriod: number;
1805
- effectivePlanId: string;
1806
- email: string;
1807
- isUnlimited: boolean;
1808
- lastUpdatedAt: string;
1809
- ownerType: string;
1810
- periodStart: string;
1811
- periodEnd: string;
1812
- planTermEndTimestamp: string | null;
1813
- sourceDetails: Record<string, unknown>;
1814
- creditsAvailable?: number;
1815
- topOffCreditsAvailable?: number;
1816
- id: string;
1817
- userId?: undefined;
1818
- status?: undefined;
1819
- topOffCreditsTotal?: undefined;
1820
- }, Error>>;
1821
- fetchStatus: _tanstack_react_query.FetchStatus;
1822
- promise: Promise<{
1823
- id: string;
1824
- userId: string;
1825
- email: string;
1826
- effectivePlanId: string;
1827
- status: string;
1828
- isUnlimited: boolean;
1829
- creditsAvailable: number;
1830
- creditsAllocatedThisPeriod: number;
1831
- topOffCreditsAvailable: number;
1832
- topOffCreditsTotal: number;
1833
- allocationSource: string;
1834
- sourceDetails: {};
1835
- periodStart: null;
1836
- periodEnd: null;
1837
- planTermEndTimestamp: null;
1838
- ownerType: string;
1839
- createdAt: string;
1840
- lastUpdatedAt: string;
1841
- } | {
1842
- totalCreditsAvailable: number;
1843
- allocationSource: string;
1844
- createdAt: string;
1845
- creditsAllocatedThisPeriod: number;
1846
- effectivePlanId: string;
1847
- email: string;
1848
- isUnlimited: boolean;
1849
- lastUpdatedAt: string;
1850
- ownerType: string;
1851
- periodStart: string;
1852
- periodEnd: string;
1853
- planTermEndTimestamp: string | null;
1854
- sourceDetails: Record<string, unknown>;
1855
- creditsAvailable?: number;
1856
- topOffCreditsAvailable?: number;
1857
- id: string;
1858
- userId?: undefined;
1859
- status?: undefined;
1860
- topOffCreditsTotal?: undefined;
1861
- }>;
1862
- } | {
1863
- data: undefined;
1864
- error: null;
1865
- isError: false;
1866
- isPending: true;
1867
- isLoading: true;
1868
- isLoadingError: false;
1869
- isRefetchError: false;
1870
- isSuccess: false;
1871
- isPlaceholderData: false;
1872
- status: "pending";
1873
- dataUpdatedAt: number;
1874
- errorUpdatedAt: number;
1875
- failureCount: number;
1876
- failureReason: Error | null;
1877
- errorUpdateCount: number;
1878
- isFetched: boolean;
1879
- isFetchedAfterMount: boolean;
1880
- isFetching: boolean;
1881
- isInitialLoading: boolean;
1882
- isPaused: boolean;
1883
- isRefetching: boolean;
1884
- isStale: boolean;
1885
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1886
- id: string;
1887
- userId: string;
1888
- email: string;
1889
- effectivePlanId: string;
1890
- status: string;
1891
- isUnlimited: boolean;
1892
- creditsAvailable: number;
1893
- creditsAllocatedThisPeriod: number;
1894
- topOffCreditsAvailable: number;
1895
- topOffCreditsTotal: number;
1896
- allocationSource: string;
1897
- sourceDetails: {};
1898
- periodStart: null;
1899
- periodEnd: null;
1900
- planTermEndTimestamp: null;
1901
- ownerType: string;
1902
- createdAt: string;
1903
- lastUpdatedAt: string;
1904
- } | {
1905
- totalCreditsAvailable: number;
1906
- allocationSource: string;
1907
- createdAt: string;
1908
- creditsAllocatedThisPeriod: number;
1909
- effectivePlanId: string;
1910
- email: string;
1911
- isUnlimited: boolean;
1912
- lastUpdatedAt: string;
1913
- ownerType: string;
1914
- periodStart: string;
1915
- periodEnd: string;
1916
- planTermEndTimestamp: string | null;
1917
- sourceDetails: Record<string, unknown>;
1918
- creditsAvailable?: number;
1919
- topOffCreditsAvailable?: number;
1920
- id: string;
1921
- userId?: undefined;
1922
- status?: undefined;
1923
- topOffCreditsTotal?: undefined;
1924
- }, Error>>;
1925
- fetchStatus: _tanstack_react_query.FetchStatus;
1926
- promise: Promise<{
1927
- id: string;
1928
- userId: string;
1929
- email: string;
1930
- effectivePlanId: string;
1931
- status: string;
1932
- isUnlimited: boolean;
1933
- creditsAvailable: number;
1934
- creditsAllocatedThisPeriod: number;
1935
- topOffCreditsAvailable: number;
1936
- topOffCreditsTotal: number;
1937
- allocationSource: string;
1938
- sourceDetails: {};
1939
- periodStart: null;
1940
- periodEnd: null;
1941
- planTermEndTimestamp: null;
1942
- ownerType: string;
1943
- createdAt: string;
1944
- lastUpdatedAt: string;
1945
- } | {
1946
- totalCreditsAvailable: number;
1947
- allocationSource: string;
1948
- createdAt: string;
1949
- creditsAllocatedThisPeriod: number;
1950
- effectivePlanId: string;
1951
- email: string;
1952
- isUnlimited: boolean;
1953
- lastUpdatedAt: string;
1954
- ownerType: string;
1955
- periodStart: string;
1956
- periodEnd: string;
1957
- planTermEndTimestamp: string | null;
1958
- sourceDetails: Record<string, unknown>;
1959
- creditsAvailable?: number;
1960
- topOffCreditsAvailable?: number;
1961
- id: string;
1962
- userId?: undefined;
1963
- status?: undefined;
1964
- topOffCreditsTotal?: undefined;
1965
- }>;
1966
- } | {
1967
- data: undefined;
1968
- error: null;
1969
- isError: false;
1970
- isPending: true;
1971
- isLoadingError: false;
1972
- isRefetchError: false;
1973
- isSuccess: false;
1974
- isPlaceholderData: false;
1975
- status: "pending";
1976
- dataUpdatedAt: number;
1977
- errorUpdatedAt: number;
1978
- failureCount: number;
1979
- failureReason: Error | null;
1980
- errorUpdateCount: number;
1981
- isFetched: boolean;
1982
- isFetchedAfterMount: boolean;
1983
- isFetching: boolean;
1984
- isLoading: boolean;
1985
- isInitialLoading: boolean;
1986
- isPaused: boolean;
1987
- isRefetching: boolean;
1988
- isStale: boolean;
1989
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1990
- id: string;
1991
- userId: string;
1992
- email: string;
1993
- effectivePlanId: string;
1994
- status: string;
1995
- isUnlimited: boolean;
1996
- creditsAvailable: number;
1997
- creditsAllocatedThisPeriod: number;
1998
- topOffCreditsAvailable: number;
1999
- topOffCreditsTotal: number;
2000
- allocationSource: string;
2001
- sourceDetails: {};
2002
- periodStart: null;
2003
- periodEnd: null;
2004
- planTermEndTimestamp: null;
2005
- ownerType: string;
2006
- createdAt: string;
2007
- lastUpdatedAt: string;
2008
- } | {
2009
- totalCreditsAvailable: number;
2010
- allocationSource: string;
2011
- createdAt: string;
2012
- creditsAllocatedThisPeriod: number;
2013
- effectivePlanId: string;
2014
- email: string;
2015
- isUnlimited: boolean;
2016
- lastUpdatedAt: string;
2017
- ownerType: string;
2018
- periodStart: string;
2019
- periodEnd: string;
2020
- planTermEndTimestamp: string | null;
2021
- sourceDetails: Record<string, unknown>;
2022
- creditsAvailable?: number;
2023
- topOffCreditsAvailable?: number;
2024
- id: string;
2025
- userId?: undefined;
2026
- status?: undefined;
2027
- topOffCreditsTotal?: undefined;
2028
- }, Error>>;
2029
- fetchStatus: _tanstack_react_query.FetchStatus;
2030
- promise: Promise<{
2031
- id: string;
2032
- userId: string;
2033
- email: string;
2034
- effectivePlanId: string;
2035
- status: string;
2036
- isUnlimited: boolean;
2037
- creditsAvailable: number;
2038
- creditsAllocatedThisPeriod: number;
2039
- topOffCreditsAvailable: number;
2040
- topOffCreditsTotal: number;
2041
- allocationSource: string;
2042
- sourceDetails: {};
2043
- periodStart: null;
2044
- periodEnd: null;
2045
- planTermEndTimestamp: null;
2046
- ownerType: string;
2047
- createdAt: string;
2048
- lastUpdatedAt: string;
2049
- } | {
2050
- totalCreditsAvailable: number;
2051
- allocationSource: string;
2052
- createdAt: string;
2053
- creditsAllocatedThisPeriod: number;
2054
- effectivePlanId: string;
2055
- email: string;
2056
- isUnlimited: boolean;
2057
- lastUpdatedAt: string;
2058
- ownerType: string;
2059
- periodStart: string;
2060
- periodEnd: string;
2061
- planTermEndTimestamp: string | null;
2062
- sourceDetails: Record<string, unknown>;
2063
- creditsAvailable?: number;
2064
- topOffCreditsAvailable?: number;
2065
- id: string;
2066
- userId?: undefined;
2067
- status?: undefined;
2068
- topOffCreditsTotal?: undefined;
2069
- }>;
2070
- } | {
2071
- data: {
2072
- id: string;
2073
- userId: string;
2074
- email: string;
2075
- effectivePlanId: string;
2076
- status: string;
2077
- isUnlimited: boolean;
2078
- creditsAvailable: number;
2079
- creditsAllocatedThisPeriod: number;
2080
- topOffCreditsAvailable: number;
2081
- topOffCreditsTotal: number;
2082
- allocationSource: string;
2083
- sourceDetails: {};
2084
- periodStart: null;
2085
- periodEnd: null;
2086
- planTermEndTimestamp: null;
2087
- ownerType: string;
2088
- createdAt: string;
2089
- lastUpdatedAt: string;
2090
- } | {
2091
- totalCreditsAvailable: number;
2092
- allocationSource: string;
2093
- createdAt: string;
2094
- creditsAllocatedThisPeriod: number;
2095
- effectivePlanId: string;
2096
- email: string;
2097
- isUnlimited: boolean;
2098
- lastUpdatedAt: string;
2099
- ownerType: string;
2100
- periodStart: string;
2101
- periodEnd: string;
2102
- planTermEndTimestamp: string | null;
2103
- sourceDetails: Record<string, unknown>;
2104
- creditsAvailable?: number;
2105
- topOffCreditsAvailable?: number;
2106
- id: string;
2107
- userId?: undefined;
2108
- status?: undefined;
2109
- topOffCreditsTotal?: undefined;
2110
- };
2111
- isError: false;
2112
- error: null;
2113
- isPending: false;
2114
- isLoading: false;
2115
- isLoadingError: false;
2116
- isRefetchError: false;
2117
- isSuccess: true;
2118
- isPlaceholderData: true;
2119
- status: "success";
2120
- dataUpdatedAt: number;
2121
- errorUpdatedAt: number;
2122
- failureCount: number;
2123
- failureReason: Error | null;
2124
- errorUpdateCount: number;
2125
- isFetched: boolean;
2126
- isFetchedAfterMount: boolean;
2127
- isFetching: boolean;
2128
- isInitialLoading: boolean;
2129
- isPaused: boolean;
2130
- isRefetching: boolean;
2131
- isStale: boolean;
2132
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
2133
- id: string;
2134
- userId: string;
2135
- email: string;
2136
- effectivePlanId: string;
2137
- status: string;
2138
- isUnlimited: boolean;
2139
- creditsAvailable: number;
2140
- creditsAllocatedThisPeriod: number;
2141
- topOffCreditsAvailable: number;
2142
- topOffCreditsTotal: number;
2143
- allocationSource: string;
2144
- sourceDetails: {};
2145
- periodStart: null;
2146
- periodEnd: null;
2147
- planTermEndTimestamp: null;
2148
- ownerType: string;
2149
- createdAt: string;
2150
- lastUpdatedAt: string;
2151
- } | {
2152
- totalCreditsAvailable: number;
2153
- allocationSource: string;
2154
- createdAt: string;
2155
- creditsAllocatedThisPeriod: number;
2156
- effectivePlanId: string;
2157
- email: string;
2158
- isUnlimited: boolean;
2159
- lastUpdatedAt: string;
2160
- ownerType: string;
2161
- periodStart: string;
2162
- periodEnd: string;
2163
- planTermEndTimestamp: string | null;
2164
- sourceDetails: Record<string, unknown>;
2165
- creditsAvailable?: number;
2166
- topOffCreditsAvailable?: number;
2167
- id: string;
2168
- userId?: undefined;
2169
- status?: undefined;
2170
- topOffCreditsTotal?: undefined;
2171
- }, Error>>;
2172
- fetchStatus: _tanstack_react_query.FetchStatus;
2173
- promise: Promise<{
2174
- id: string;
2175
- userId: string;
2176
- email: string;
2177
- effectivePlanId: string;
2178
- status: string;
2179
- isUnlimited: boolean;
2180
- creditsAvailable: number;
2181
- creditsAllocatedThisPeriod: number;
2182
- topOffCreditsAvailable: number;
2183
- topOffCreditsTotal: number;
2184
- allocationSource: string;
2185
- sourceDetails: {};
2186
- periodStart: null;
2187
- periodEnd: null;
2188
- planTermEndTimestamp: null;
2189
- ownerType: string;
2190
- createdAt: string;
2191
- lastUpdatedAt: string;
2192
- } | {
2193
- totalCreditsAvailable: number;
2194
- allocationSource: string;
2195
- createdAt: string;
2196
- creditsAllocatedThisPeriod: number;
2197
- effectivePlanId: string;
2198
- email: string;
2199
- isUnlimited: boolean;
2200
- lastUpdatedAt: string;
2201
- ownerType: string;
2202
- periodStart: string;
2203
- periodEnd: string;
2204
- planTermEndTimestamp: string | null;
2205
- sourceDetails: Record<string, unknown>;
2206
- creditsAvailable?: number;
2207
- topOffCreditsAvailable?: number;
2208
- id: string;
2209
- userId?: undefined;
2210
- status?: undefined;
2211
- topOffCreditsTotal?: undefined;
2212
- }>;
2213
- };
2214
-
2215
- interface OrganizationAccess {
2216
- hasUnlimitedAccess: boolean;
2217
- subscriptionId: string | null;
2218
- organizationId: string | null;
2219
- organizationName: string | null;
2220
- subscriptionEndDate: Date | null;
2221
- accessType: 'organization' | 'individual' | 'institution_subscriptions';
2222
- }
2223
- interface InstitutionSubscription {
2224
- id: string;
2225
- institutionId: string;
2226
- name: string;
2227
- plan: string;
2228
- endDate: Date;
2229
- }
2230
- interface Organization {
2231
- id: string;
2232
- name: string;
2233
- members: string[];
2234
- masterSubscriptionStatus: string;
2235
- masterSubscriptionId: string;
2236
- masterSubscriptionEndDate: Date;
2237
- }
2238
- declare const useOrganizationAccess: () => {
2239
- data: OrganizationAccess;
2240
- error: Error;
2241
- isError: true;
2242
- isPending: false;
2243
- isLoading: false;
2244
- isLoadingError: false;
2245
- isRefetchError: true;
2246
- isSuccess: false;
2247
- isPlaceholderData: false;
2248
- status: "error";
2249
- dataUpdatedAt: number;
2250
- errorUpdatedAt: number;
2251
- failureCount: number;
2252
- failureReason: Error | null;
2253
- errorUpdateCount: number;
2254
- isFetched: boolean;
2255
- isFetchedAfterMount: boolean;
2256
- isFetching: boolean;
2257
- isInitialLoading: boolean;
2258
- isPaused: boolean;
2259
- isRefetching: boolean;
2260
- isStale: boolean;
2261
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
2262
- fetchStatus: _tanstack_react_query.FetchStatus;
2263
- promise: Promise<OrganizationAccess>;
2264
- } | {
2265
- data: OrganizationAccess;
2266
- error: null;
2267
- isError: false;
2268
- isPending: false;
2269
- isLoading: false;
2270
- isLoadingError: false;
2271
- isRefetchError: false;
2272
- isSuccess: true;
2273
- isPlaceholderData: false;
2274
- status: "success";
2275
- dataUpdatedAt: number;
2276
- errorUpdatedAt: number;
2277
- failureCount: number;
2278
- failureReason: Error | null;
2279
- errorUpdateCount: number;
2280
- isFetched: boolean;
2281
- isFetchedAfterMount: boolean;
2282
- isFetching: boolean;
2283
- isInitialLoading: boolean;
2284
- isPaused: boolean;
2285
- isRefetching: boolean;
2286
- isStale: boolean;
2287
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
2288
- fetchStatus: _tanstack_react_query.FetchStatus;
2289
- promise: Promise<OrganizationAccess>;
2290
- } | {
2291
- data: undefined;
2292
- error: Error;
2293
- isError: true;
2294
- isPending: false;
2295
- isLoading: false;
2296
- isLoadingError: true;
2297
- isRefetchError: false;
2298
- isSuccess: false;
2299
- isPlaceholderData: false;
2300
- status: "error";
2301
- dataUpdatedAt: number;
2302
- errorUpdatedAt: number;
2303
- failureCount: number;
2304
- failureReason: Error | null;
2305
- errorUpdateCount: number;
2306
- isFetched: boolean;
2307
- isFetchedAfterMount: boolean;
2308
- isFetching: boolean;
2309
- isInitialLoading: boolean;
2310
- isPaused: boolean;
2311
- isRefetching: boolean;
2312
- isStale: boolean;
2313
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
2314
- fetchStatus: _tanstack_react_query.FetchStatus;
2315
- promise: Promise<OrganizationAccess>;
2316
- } | {
2317
- data: undefined;
2318
- error: null;
2319
- isError: false;
2320
- isPending: true;
2321
- isLoading: true;
2322
- isLoadingError: false;
2323
- isRefetchError: false;
2324
- isSuccess: false;
2325
- isPlaceholderData: false;
2326
- status: "pending";
2327
- dataUpdatedAt: number;
2328
- errorUpdatedAt: number;
2329
- failureCount: number;
2330
- failureReason: Error | null;
2331
- errorUpdateCount: number;
2332
- isFetched: boolean;
2333
- isFetchedAfterMount: boolean;
2334
- isFetching: boolean;
2335
- isInitialLoading: boolean;
2336
- isPaused: boolean;
2337
- isRefetching: boolean;
2338
- isStale: boolean;
2339
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
2340
- fetchStatus: _tanstack_react_query.FetchStatus;
2341
- promise: Promise<OrganizationAccess>;
2342
- } | {
2343
- data: undefined;
2344
- error: null;
2345
- isError: false;
2346
- isPending: true;
2347
- isLoadingError: false;
2348
- isRefetchError: false;
2349
- isSuccess: false;
2350
- isPlaceholderData: false;
2351
- status: "pending";
2352
- dataUpdatedAt: number;
2353
- errorUpdatedAt: number;
2354
- failureCount: number;
2355
- failureReason: Error | null;
2356
- errorUpdateCount: number;
2357
- isFetched: boolean;
2358
- isFetchedAfterMount: boolean;
2359
- isFetching: boolean;
2360
- isLoading: boolean;
2361
- isInitialLoading: boolean;
2362
- isPaused: boolean;
2363
- isRefetching: boolean;
2364
- isStale: boolean;
2365
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
2366
- fetchStatus: _tanstack_react_query.FetchStatus;
2367
- promise: Promise<OrganizationAccess>;
2368
- } | {
2369
- data: OrganizationAccess;
2370
- isError: false;
2371
- error: null;
2372
- isPending: false;
2373
- isLoading: false;
2374
- isLoadingError: false;
2375
- isRefetchError: false;
2376
- isSuccess: true;
2377
- isPlaceholderData: true;
2378
- status: "success";
2379
- dataUpdatedAt: number;
2380
- errorUpdatedAt: number;
2381
- failureCount: number;
2382
- failureReason: Error | null;
2383
- errorUpdateCount: number;
2384
- isFetched: boolean;
2385
- isFetchedAfterMount: boolean;
2386
- isFetching: boolean;
2387
- isInitialLoading: boolean;
2388
- isPaused: boolean;
2389
- isRefetching: boolean;
2390
- isStale: boolean;
2391
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
2392
- fetchStatus: _tanstack_react_query.FetchStatus;
2393
- promise: Promise<OrganizationAccess>;
2394
- };
2395
-
2396
- declare const useUpdateStudentVocab: (page: PageActivityWithId | null) => {
2397
- studentVocabMarkVoiceSuccess: undefined;
2398
- studentVocabMarkVoiceFail: undefined;
2399
- } | {
2400
- studentVocabMarkVoiceSuccess: () => Promise<void>;
2401
- studentVocabMarkVoiceFail: () => Promise<void>;
2402
- };
2403
-
2404
- declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onCompletionSuccess, onCompletionError, aiEnabled, submitAudioResponse, uploadAudioAndGetTranscript, onGetAudioUrlAndTranscript, }: {
2405
- onTranscriptSuccess: (transcript: string) => void;
2406
- onTranscriptError: ({ type, message }: {
2407
- type: string;
2408
- message: string;
2409
- }) => void;
2410
- onCompletionSuccess: (completion: any) => void;
2411
- onCompletionError: ({ type, message }: {
2412
- type: string;
2413
- message: string;
2414
- }) => void;
2415
- aiEnabled: boolean;
2416
- submitAudioResponse: (audio: string) => Promise<{
2417
- url: string;
2418
- fileName: string;
2419
- }>;
2420
- uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<{
2421
- transcript: string;
2422
- audioUrl: string;
2423
- }>;
2424
- onGetAudioUrlAndTranscript?: (args: {
2425
- transcript?: string;
2426
- audioUrl?: string;
2427
- }) => void;
2428
- }) => {
2429
- submitAudioResponse: (audio: string) => Promise<{
2430
- url: string;
2431
- fileName: string;
2432
- }>;
2433
- uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<{
2434
- transcript: string;
2435
- audioUrl: string;
2436
- }>;
2437
- getTranscript: (audioUrl: string, language: string) => Promise<string>;
2438
- getFreeResponseCompletion: (messages: string[], isFreeResponse: boolean, feedbackLanguage: string, gradingStandard?: string) => Promise<any>;
2439
- getFeedback: ({ cardId, language, writtenResponse, audio, autoGrade, file, }: {
2440
- cardId: string;
2441
- language: string;
2442
- writtenResponse: string | null;
2443
- audio: string | null;
2444
- autoGrade: boolean;
2445
- file: string | null;
2446
- }) => Promise<{
2447
- noFeedbackAvailable: boolean;
2448
- success: boolean;
2449
- reason: string;
2450
- accessType: "ai_enabled" | "teacher_preview" | "student_with_teacher_plan" | "none";
2451
- } | {
2452
- noFeedbackAvailable: boolean;
2453
- success: boolean;
2454
- reason: string;
2455
- accessType: string;
2456
- aiSuccess: boolean;
2457
- }>;
2458
- };
2459
-
2460
- interface ActivityFeedbackAccess {
2461
- canAccessFeedback: boolean;
2462
- reason?: string;
2463
- isUnlimited: boolean;
2464
- accessType: 'ai_enabled' | 'teacher_preview' | 'student_with_teacher_plan' | 'none';
2465
- }
2466
- /**
2467
- * Hook to check feedback permissions for both students and teachers
2468
- *
2469
- * Permission Logic:
2470
- * 1. aiEnabled: true → Allow feedback access always (highest priority)
2471
- * 2. Teachers on /activity route → Always allowed (ADMIN role)
2472
- * 3. Students on /activity route → Need teacher with active plan (team/org)
2473
- *
2474
- * @param params - Parameters for permission checking
2475
- * @returns Feedback permissions information
2476
- */
2477
- declare const useActivityFeedbackAccess: ({ aiEnabled, isActivityRoute, }: {
2478
- aiEnabled?: boolean;
2479
- isActivityRoute?: boolean;
2480
- }) => {
2481
- data: ActivityFeedbackAccess;
2482
- error: Error;
2483
- isError: true;
2484
- isPending: false;
2485
- isLoading: false;
2486
- isLoadingError: false;
2487
- isRefetchError: true;
2488
- isSuccess: false;
2489
- isPlaceholderData: false;
2490
- status: "error";
2491
- dataUpdatedAt: number;
2492
- errorUpdatedAt: number;
2493
- failureCount: number;
2494
- failureReason: Error | null;
2495
- errorUpdateCount: number;
2496
- isFetched: boolean;
2497
- isFetchedAfterMount: boolean;
2498
- isFetching: boolean;
2499
- isInitialLoading: boolean;
2500
- isPaused: boolean;
2501
- isRefetching: boolean;
2502
- isStale: boolean;
2503
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
2504
- fetchStatus: _tanstack_react_query.FetchStatus;
2505
- promise: Promise<ActivityFeedbackAccess>;
2506
- } | {
2507
- data: ActivityFeedbackAccess;
2508
- error: null;
2509
- isError: false;
2510
- isPending: false;
2511
- isLoading: false;
2512
- isLoadingError: false;
2513
- isRefetchError: false;
2514
- isSuccess: true;
2515
- isPlaceholderData: false;
2516
- status: "success";
2517
- dataUpdatedAt: number;
2518
- errorUpdatedAt: number;
2519
- failureCount: number;
2520
- failureReason: Error | null;
2521
- errorUpdateCount: number;
2522
- isFetched: boolean;
2523
- isFetchedAfterMount: boolean;
2524
- isFetching: boolean;
2525
- isInitialLoading: boolean;
2526
- isPaused: boolean;
2527
- isRefetching: boolean;
2528
- isStale: boolean;
2529
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
2530
- fetchStatus: _tanstack_react_query.FetchStatus;
2531
- promise: Promise<ActivityFeedbackAccess>;
2532
- } | {
2533
- data: undefined;
2534
- error: Error;
2535
- isError: true;
2536
- isPending: false;
2537
- isLoading: false;
2538
- isLoadingError: true;
2539
- isRefetchError: false;
2540
- isSuccess: false;
2541
- isPlaceholderData: false;
2542
- status: "error";
2543
- dataUpdatedAt: number;
2544
- errorUpdatedAt: number;
2545
- failureCount: number;
2546
- failureReason: Error | null;
2547
- errorUpdateCount: number;
2548
- isFetched: boolean;
2549
- isFetchedAfterMount: boolean;
2550
- isFetching: boolean;
2551
- isInitialLoading: boolean;
2552
- isPaused: boolean;
2553
- isRefetching: boolean;
2554
- isStale: boolean;
2555
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
2556
- fetchStatus: _tanstack_react_query.FetchStatus;
2557
- promise: Promise<ActivityFeedbackAccess>;
2558
- } | {
2559
- data: undefined;
2560
- error: null;
2561
- isError: false;
2562
- isPending: true;
2563
- isLoading: true;
2564
- isLoadingError: false;
2565
- isRefetchError: false;
2566
- isSuccess: false;
2567
- isPlaceholderData: false;
2568
- status: "pending";
2569
- dataUpdatedAt: number;
2570
- errorUpdatedAt: number;
2571
- failureCount: number;
2572
- failureReason: Error | null;
2573
- errorUpdateCount: number;
2574
- isFetched: boolean;
2575
- isFetchedAfterMount: boolean;
2576
- isFetching: boolean;
2577
- isInitialLoading: boolean;
2578
- isPaused: boolean;
2579
- isRefetching: boolean;
2580
- isStale: boolean;
2581
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
2582
- fetchStatus: _tanstack_react_query.FetchStatus;
2583
- promise: Promise<ActivityFeedbackAccess>;
2584
- } | {
2585
- data: undefined;
2586
- error: null;
2587
- isError: false;
2588
- isPending: true;
2589
- isLoadingError: false;
2590
- isRefetchError: false;
2591
- isSuccess: false;
2592
- isPlaceholderData: false;
2593
- status: "pending";
2594
- dataUpdatedAt: number;
2595
- errorUpdatedAt: number;
2596
- failureCount: number;
2597
- failureReason: Error | null;
2598
- errorUpdateCount: number;
2599
- isFetched: boolean;
2600
- isFetchedAfterMount: boolean;
2601
- isFetching: boolean;
2602
- isLoading: boolean;
2603
- isInitialLoading: boolean;
2604
- isPaused: boolean;
2605
- isRefetching: boolean;
2606
- isStale: boolean;
2607
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
2608
- fetchStatus: _tanstack_react_query.FetchStatus;
2609
- promise: Promise<ActivityFeedbackAccess>;
2610
- } | {
2611
- data: ActivityFeedbackAccess;
2612
- isError: false;
2613
- error: null;
2614
- isPending: false;
2615
- isLoading: false;
2616
- isLoadingError: false;
2617
- isRefetchError: false;
2618
- isSuccess: true;
2619
- isPlaceholderData: true;
2620
- status: "success";
2621
- dataUpdatedAt: number;
2622
- errorUpdatedAt: number;
2623
- failureCount: number;
2624
- failureReason: Error | null;
2625
- errorUpdateCount: number;
2626
- isFetched: boolean;
2627
- isFetchedAfterMount: boolean;
2628
- isFetching: boolean;
2629
- isInitialLoading: boolean;
2630
- isPaused: boolean;
2631
- isRefetching: boolean;
2632
- isStale: boolean;
2633
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
2634
- fetchStatus: _tanstack_react_query.FetchStatus;
2635
- promise: Promise<ActivityFeedbackAccess>;
2636
- };
2637
-
2638
395
  declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientParams) => {
2639
396
  assignmentRepo: {
2640
397
  getAssignment: (params: {
@@ -2831,4 +588,4 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
2831
588
  };
2832
589
  };
2833
590
 
2834
- export { ActivityPageType, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CreditContract, FeedbackTypesCard, FsCtx, type InstitutionSubscription, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_PAGE_ACTIVITY_TYPES, type Organization, type OrganizationAccess, type PageActivity, type PageActivityWithId, type PageScore, REPEAT_PAGE_ACTIVITY_TYPES, RESPOND_AUDIO_PAGE_ACTIVITY_TYPES, RESPOND_PAGE_ACTIVITY_TYPES, RESPOND_WRITE_PAGE_ACTIVITY_TYPES, type RefsCardsFiresotre, type RefsSetsFirestore, SPEAKABLE_NOTIFICATIONS, STUDENT_LEVELS_OPTIONS, type Score, type ScoreWithId, type Set, type SetWithId, type SpeakableNotificationType, SpeakableNotificationTypes, SpeakableProvider, VerificationCardStatus, assignmentQueryKeys, cardsQueryKeys, checkIsMCPage, checkIsMediaPage, checkIsRepeatPage, checkIsRespondAudioPage, checkIsRespondPage, checkIsRespondWrittenPage, checkIsShortAnswerPage, checkTypePageActivity, cleanString, createAssignmentRepo, createCardRepo, createFsClientNative as createFsClient, createSetRepo, creditQueryKeys, debounce, getCardFromCache, getLabelPage, getPagePrompt, getPhraseLength, getRespondCardTool, getSetFromCache, getTotalCompletedCards, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useOrganizationAccess, useScore, useSet, useSpeakableApi, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUpdateStudentVocab, useUserCredits };
591
+ export { createFsClientNative as createFsClient };