@speakableio/core 0.1.105 → 1.0.0

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