@speakableio/core 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2,11 +2,20 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
- import { Firestore } from 'firebase/firestore';
6
- import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore';
5
+ import { FirebaseFunctionsTypes } from '@react-native-firebase/functions';
6
+ import { Functions } from 'firebase/functions';
7
+ import { Firestore, Timestamp as Timestamp$2, FieldValue } from 'firebase/firestore';
8
+ import { FirebaseFirestoreTypes, Timestamp as Timestamp$1 } from '@react-native-firebase/firestore';
9
+ import * as _firebase_functions from '@firebase/functions';
10
+
11
+ type FirebaseInstance = (FirebaseFirestoreTypes.Module | Firestore) & {
12
+ functions: FirebaseFunctions;
13
+ };
14
+ type CustomTimestamp = Timestamp$1 | Timestamp$2;
15
+ type FirebaseFunctions = Functions | FirebaseFunctionsTypes.Module;
7
16
 
8
17
  interface Assignment {
9
- title: string;
18
+ name: string;
10
19
  description: string;
11
20
  scheduledTime?: string | null;
12
21
  dueTime?: {
@@ -27,10 +36,7 @@ interface Assignment {
27
36
  };
28
37
  teacherName: string;
29
38
  courseWorkId: string | null;
30
- dueDateTimestamp: {
31
- seconds: number;
32
- nanoseconds: number;
33
- };
39
+ dueDateTimestamp: CustomTimestamp;
34
40
  scheduledTimeTimestamp: number;
35
41
  active: boolean;
36
42
  voice: string | null;
@@ -43,12 +49,102 @@ interface Assignment {
43
49
  courseId: string;
44
50
  isAssessment: boolean;
45
51
  isAvailable: boolean;
52
+ ltiDeeplink?: string;
46
53
  }
47
54
  interface AssignmentWithId extends Assignment {
48
55
  id: string;
49
56
  isAvailable: boolean;
50
57
  scores?: unknown;
51
58
  }
59
+ interface Score {
60
+ userId: string;
61
+ owners: string[];
62
+ progress: number;
63
+ score: number;
64
+ cards?: {
65
+ [cardId: string]: CardScore;
66
+ };
67
+ courseId?: string;
68
+ firstLoad?: boolean;
69
+ googleClassroomUserId?: string;
70
+ skippedCards?: number;
71
+ lastPlayed?: CustomTimestamp;
72
+ startDate?: CustomTimestamp;
73
+ submissionDate?: CustomTimestamp;
74
+ status?: 'SUBMITTED' | 'PENDING_REVIEW' | 'IN_PROGRESS' | 'FINALIZED';
75
+ submitted?: boolean;
76
+ successfulCards?: number;
77
+ total_voiceSuccess?: number;
78
+ total_voice_attempts?: number;
79
+ total_words_spoken?: number;
80
+ history?: CardScore[];
81
+ attempts?: number;
82
+ assignmentId?: string;
83
+ setId?: string;
84
+ }
85
+ interface ScoreWithId extends Score {
86
+ id: string;
87
+ }
88
+ interface CardScore {
89
+ voiceSuccess?: number;
90
+ voiceAttempts?: number;
91
+ voiceFail?: number;
92
+ completed?: boolean;
93
+ attempts?: number;
94
+ correct?: number;
95
+ success?: boolean;
96
+ aiSuccess?: boolean;
97
+ grading_method?: 'simple' | 'rubric' | 'manual' | 'standards_based';
98
+ grammar_insights?: {
99
+ type?: string;
100
+ justification?: string;
101
+ error?: boolean;
102
+ correction?: string;
103
+ }[];
104
+ promptSuccess?: boolean;
105
+ score?: number;
106
+ simple_grading?: {
107
+ justification?: string;
108
+ success?: boolean;
109
+ };
110
+ suggested_response?: string;
111
+ summary?: string;
112
+ transcript?: string;
113
+ errors?: any;
114
+ improvedResponse?: string;
115
+ audio?: string;
116
+ actfl?: {
117
+ justification: string;
118
+ level: string;
119
+ };
120
+ wida?: {
121
+ justification: string;
122
+ level: string;
123
+ };
124
+ earned_points?: number;
125
+ fileName?: string;
126
+ max_points?: number;
127
+ passing_score?: number;
128
+ rubric?: {
129
+ description: string;
130
+ justification: string;
131
+ maxPoints: number;
132
+ score: number;
133
+ score_title: string;
134
+ title: string;
135
+ }[];
136
+ scoring_type?: string;
137
+ history?: CardScore[];
138
+ media_area_opened?: boolean;
139
+ noFeedbackAvailable?: boolean;
140
+ proficiency_level?: {
141
+ standardId: string;
142
+ level: string;
143
+ justification: string;
144
+ key_indicators?: string[];
145
+ };
146
+ status?: string;
147
+ }
52
148
 
53
149
  declare const enum AssignmentAnalyticsType {
54
150
  Macro = "macro",
@@ -59,25 +155,17 @@ declare const enum AssignmentAnalyticsType {
59
155
  All = "all"
60
156
  }
61
157
 
62
- interface GetAttachScoresParams {
63
- assignments: AssignmentWithId[];
64
- analyticType: AssignmentAnalyticsType;
65
- studentId?: string;
66
- currentUserId: string;
67
- }
68
- interface GetAssignmentScoresParams {
69
- assignmentId: string;
70
- currentUserId: string;
71
- analyticType?: AssignmentAnalyticsType;
72
- studentId?: string;
73
- }
74
-
75
158
  declare const createAssignmentRepo: () => {
76
- getAssignment: (params: GetAssignmentScoresParams) => Promise<AssignmentWithId | {
159
+ getAssignment: (params: {
160
+ assignmentId: string;
161
+ currentUserId: string;
162
+ analyticType?: AssignmentAnalyticsType;
163
+ studentId?: string;
164
+ }) => Promise<AssignmentWithId | {
77
165
  scores: any;
78
166
  id: string;
79
167
  isAvailable: boolean;
80
- title: string;
168
+ name: string;
81
169
  description: string;
82
170
  scheduledTime?: string | null;
83
171
  dueTime?: {
@@ -98,10 +186,7 @@ declare const createAssignmentRepo: () => {
98
186
  };
99
187
  teacherName: string;
100
188
  courseWorkId: string | null;
101
- dueDateTimestamp: {
102
- seconds: number;
103
- nanoseconds: number;
104
- };
189
+ dueDateTimestamp: CustomTimestamp;
105
190
  scheduledTimeTimestamp: number;
106
191
  active: boolean;
107
192
  voice: string | null;
@@ -113,12 +198,18 @@ declare const createAssignmentRepo: () => {
113
198
  maxPoints: number;
114
199
  courseId: string;
115
200
  isAssessment: boolean;
201
+ ltiDeeplink?: string;
116
202
  } | null>;
117
- attachScoresAssignment: (args_0: GetAttachScoresParams) => Promise<{
203
+ attachScoresAssignment: (args_0: {
204
+ assignments: AssignmentWithId[];
205
+ analyticType: AssignmentAnalyticsType;
206
+ studentId?: string;
207
+ currentUserId: string;
208
+ }) => Promise<{
118
209
  scores: any;
119
210
  id: string;
120
211
  isAvailable: boolean;
121
- title: string;
212
+ name: string;
122
213
  description: string;
123
214
  scheduledTime?: string | null;
124
215
  dueTime?: {
@@ -139,10 +230,7 @@ declare const createAssignmentRepo: () => {
139
230
  };
140
231
  teacherName: string;
141
232
  courseWorkId: string | null;
142
- dueDateTimestamp: {
143
- seconds: number;
144
- nanoseconds: number;
145
- };
233
+ dueDateTimestamp: CustomTimestamp;
146
234
  scheduledTimeTimestamp: number;
147
235
  active: boolean;
148
236
  voice: string | null;
@@ -154,8 +242,14 @@ declare const createAssignmentRepo: () => {
154
242
  maxPoints: number;
155
243
  courseId: string;
156
244
  isAssessment: boolean;
245
+ ltiDeeplink?: string;
157
246
  }[]>;
158
- getAssignmentScores: (args_0: GetAssignmentScoresParams) => Promise<{
247
+ getAssignmentScores: (args_0: {
248
+ assignmentId: string;
249
+ currentUserId: string;
250
+ analyticType?: AssignmentAnalyticsType;
251
+ studentId?: string;
252
+ }) => Promise<{
159
253
  scores: unknown;
160
254
  id: string;
161
255
  } | undefined>;
@@ -176,7 +270,7 @@ declare function useAssignment({ assignmentId, enabled, analyticType, userId, }:
176
270
  scores: any;
177
271
  id: string;
178
272
  isAvailable: boolean;
179
- title: string;
273
+ name: string;
180
274
  description: string;
181
275
  scheduledTime?: string | null;
182
276
  dueTime?: {
@@ -197,10 +291,7 @@ declare function useAssignment({ assignmentId, enabled, analyticType, userId, }:
197
291
  };
198
292
  teacherName: string;
199
293
  courseWorkId: string | null;
200
- dueDateTimestamp: {
201
- seconds: number;
202
- nanoseconds: number;
203
- };
294
+ dueDateTimestamp: CustomTimestamp;
204
295
  scheduledTimeTimestamp: number;
205
296
  active: boolean;
206
297
  voice: string | null;
@@ -212,18 +303,456 @@ declare function useAssignment({ assignmentId, enabled, analyticType, userId, }:
212
303
  maxPoints: number;
213
304
  courseId: string;
214
305
  isAssessment: boolean;
306
+ ltiDeeplink?: string;
215
307
  } | null, Error>;
216
308
 
217
- type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
309
+ declare const enum FeedbackTypesCard {
310
+ SuggestedResponse = "suggested_response",
311
+ Wida = "wida",
312
+ GrammarInsights = "grammar_insights",
313
+ Actfl = "actfl",
314
+ ProficiencyLevel = "proficiency_level"
315
+ }
316
+ declare const enum LeniencyCard {
317
+ CONFIDENCE = "confidence",
318
+ EASY = "easy",
319
+ NORMAL = "normal",
320
+ HARD = "hard"
321
+ }
322
+ declare const LENIENCY_OPTIONS: {
323
+ label: string;
324
+ value: LeniencyCard;
325
+ }[];
326
+ declare const STUDENT_LEVELS_OPTIONS: {
327
+ label: string;
328
+ description: string;
329
+ value: string;
330
+ }[];
331
+ declare const BASE_RESPOND_FIELD_VALUES: {
332
+ title: string;
333
+ allowRetries: boolean;
334
+ respondTime: number;
335
+ maxCharacters: number;
336
+ };
337
+ declare const BASE_REPEAT_FIELD_VALUES: {
338
+ repeat: number;
339
+ };
340
+ declare const BASE_MULTIPLE_CHOICE_FIELD_VALUES: {
341
+ MCQType: string;
342
+ answer: string[];
343
+ choices: {
344
+ option: string;
345
+ value: string;
346
+ }[];
347
+ };
348
+ declare const enum VerificationCardStatus {
349
+ VERIFIED = "VERIFIED",
350
+ WARNING = "WARNING",
351
+ NOT_RECOMMENDED = "NOT_RECOMMENDED",
352
+ NOT_WORKING = "NOT_WORKING",
353
+ NOT_CHECKED = "NOT_CHECKED"
354
+ }
355
+ declare const CARDS_COLLECTION = "flashcards";
356
+ type RefsCardsFiresotre = `${typeof CARDS_COLLECTION}/${string}`;
357
+ declare const refsCardsFiresotre: {
358
+ allCards: string;
359
+ card: (id: string) => `flashcards/${string}`;
360
+ };
361
+
362
+ interface CardActivityWithId extends CardActivity {
363
+ id: string;
364
+ }
365
+ interface CardActivity {
366
+ owners: string[];
367
+ checked?: boolean;
368
+ completed?: boolean;
369
+ media_area_id?: string | null;
370
+ media_area_layout?: 'left' | 'right' | null;
371
+ score?: number;
372
+ verificationStatus?: VerificationCardStatus;
373
+ native_text?: string;
374
+ repeat?: number;
375
+ language?: string | null;
376
+ image?: {
377
+ path?: string | null;
378
+ url?: string;
379
+ };
380
+ audio?: {
381
+ path?: string | null;
382
+ url?: string;
383
+ } | null;
384
+ notes?: string;
385
+ difficulty?: string;
386
+ default_language?: string;
387
+ target_text?: string;
388
+ type: CardActivityType;
389
+ grading_criteria?: string;
390
+ scoring_type?: string;
391
+ grading_method?: 'simple' | 'rubric' | 'manual' | 'standards_based';
392
+ feedback_types?: string[];
393
+ rubricId?: string;
394
+ prompt?: string;
395
+ title?: string;
396
+ passing_score?: number;
397
+ maxCharacters?: number;
398
+ answer?: string[];
399
+ choices?: {
400
+ value: string;
401
+ option: string;
402
+ }[];
403
+ MCQType?: string;
404
+ multipleAttemptsAllowed?: boolean;
405
+ allowRetries?: boolean;
406
+ question?: string;
407
+ respondTime?: number;
408
+ hidePrompt?: boolean;
409
+ videoUrl?: string;
410
+ link?: string;
411
+ text?: string;
412
+ isListenAloud?: boolean;
413
+ embedCode?: string;
414
+ attempt?: number;
415
+ correct?: number;
416
+ autoGrade?: boolean;
417
+ points?: number;
418
+ shuffle?: boolean;
419
+ translation?: string;
420
+ includeAIContext?: boolean;
421
+ media_area_context_ref?: string | null;
422
+ standardId?: string;
423
+ target_proficiency_level?: string;
424
+ allowTTS?: boolean;
425
+ }
426
+ declare const enum CardActivityType {
427
+ READ_REPEAT = "READ_REPEAT",
428
+ VIDEO = "VIDEO",
429
+ TEXT = "TEXT",
430
+ READ_RESPOND = "READ_RESPOND",
431
+ FREE_RESPONSE = "FREE_RESPONSE",
432
+ REPEAT = "REPEAT",
433
+ RESPOND = "RESPOND",
434
+ RESPOND_WRITE = "RESPOND_WRITE",
435
+ TEXT_TO_SPEECH = "TEXT_TO_SPEECH",
436
+ MULTIPLE_CHOICE = "MULTIPLE_CHOICE",
437
+ PODCAST = "PODCAST",
438
+ MEDIA_PAGE = "MEDIA_PAGE",
439
+ WRITE = "WRITE",
440
+ SHORT_ANSWER = "SHORT_ANSWER",
441
+ SHORT_STORY = "SHORT_STORY",
442
+ SPEAK = "SPEAK",
443
+ CONVERSATION = "CONVERSATION",
444
+ CONVERSATION_WRITE = "CONVERSATION_WRITE",
445
+ DIALOGUE = "DIALOGUE",
446
+ INSTRUCTION = "INSTRUCTION",
447
+ LISTEN = "LISTEN",
448
+ READ = "READ",
449
+ ANSWER = "ANSWER"
450
+ }
451
+ declare const RESPOND_CARD_ACTIVITY_TYPES: CardActivityType[];
452
+ declare const MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES: CardActivityType[];
453
+ declare const REPEAT_CARD_ACTIVITY_TYPES: CardActivityType[];
454
+ declare const RESPOND_WRITE_CARD_ACTIVITY_TYPES: CardActivityType[];
455
+ declare const RESPOND_AUDIO_CARD_ACTIVITY_TYPES: CardActivityType[];
456
+ declare const ALLOWED_CARD_ACTIVITY_TYPES_FOR_SUMMARY: CardActivityType[];
457
+
458
+ declare const cardsQueryKeys: {
459
+ all: string[];
460
+ one: (params: {
461
+ cardId: string;
462
+ }) => string[];
463
+ };
464
+ declare function useCards({ cardIds, enabled, asObject, }: {
465
+ cardIds: string[];
466
+ enabled: boolean;
467
+ asObject?: boolean;
468
+ }): {
469
+ cards: CardActivityWithId[];
470
+ cardsObject: Record<string, CardActivityWithId> | null;
471
+ cardsQueries: _tanstack_react_query.UseQueryResult<CardActivityWithId | null, Error>[];
472
+ };
473
+ declare function useCreateCard(): {
474
+ mutationCreateCard: _tanstack_react_query.UseMutationResult<{
475
+ id: string;
476
+ } & Partial<CardActivity>, Error, {
477
+ data: Partial<CardActivity>;
478
+ }, unknown>;
479
+ };
480
+ declare function useCreateCards(): {
481
+ mutationCreateCards: _tanstack_react_query.UseMutationResult<{
482
+ id: string;
483
+ owners: string[];
484
+ checked?: boolean;
485
+ completed?: boolean;
486
+ media_area_id?: string | null;
487
+ media_area_layout?: "left" | "right" | null;
488
+ score?: number;
489
+ verificationStatus?: VerificationCardStatus;
490
+ native_text?: string;
491
+ repeat?: number;
492
+ language?: string | null;
493
+ image?: {
494
+ path?: string | null;
495
+ url?: string;
496
+ };
497
+ audio?: {
498
+ path?: string | null;
499
+ url?: string;
500
+ } | null;
501
+ notes?: string;
502
+ difficulty?: string;
503
+ default_language?: string;
504
+ target_text?: string;
505
+ type: CardActivityType;
506
+ grading_criteria?: string;
507
+ scoring_type?: string;
508
+ grading_method?: "simple" | "rubric" | "manual" | "standards_based";
509
+ feedback_types?: string[];
510
+ rubricId?: string;
511
+ prompt?: string;
512
+ title?: string;
513
+ passing_score?: number;
514
+ maxCharacters?: number;
515
+ answer?: string[];
516
+ choices?: {
517
+ value: string;
518
+ option: string;
519
+ }[];
520
+ MCQType?: string;
521
+ multipleAttemptsAllowed?: boolean;
522
+ allowRetries?: boolean;
523
+ question?: string;
524
+ respondTime?: number;
525
+ hidePrompt?: boolean;
526
+ videoUrl?: string;
527
+ link?: string;
528
+ text?: string;
529
+ isListenAloud?: boolean;
530
+ embedCode?: string;
531
+ attempt?: number;
532
+ correct?: number;
533
+ autoGrade?: boolean;
534
+ points?: number;
535
+ shuffle?: boolean;
536
+ translation?: string;
537
+ includeAIContext?: boolean;
538
+ media_area_context_ref?: string | null;
539
+ standardId?: string;
540
+ target_proficiency_level?: string;
541
+ allowTTS?: boolean;
542
+ }[], Error, {
543
+ cards: CardActivity[];
544
+ }, unknown>;
545
+ };
546
+ declare function getCardFromCache({ cardId, queryClient, }: {
547
+ cardId: string;
548
+ queryClient: QueryClient;
549
+ }): CardActivityWithId | undefined;
550
+ declare function updateCardInCache({ cardId, card, queryClient, }: {
551
+ cardId: string;
552
+ card: CardActivityWithId | null;
553
+ queryClient: QueryClient;
554
+ }): void;
555
+
556
+ declare const createCardRepo: () => {
557
+ createCard: (args_0: {
558
+ data: Partial<CardActivity>;
559
+ }) => Promise<{
560
+ id: string;
561
+ } & Partial<CardActivity>>;
562
+ createCards: (args_0: {
563
+ cards: CardActivity[];
564
+ }) => Promise<{
565
+ id: string;
566
+ owners: string[];
567
+ checked?: boolean;
568
+ completed?: boolean;
569
+ media_area_id?: string | null;
570
+ media_area_layout?: "left" | "right" | null;
571
+ score?: number;
572
+ verificationStatus?: VerificationCardStatus;
573
+ native_text?: string;
574
+ repeat?: number;
575
+ language?: string | null;
576
+ image?: {
577
+ path?: string | null;
578
+ url?: string;
579
+ };
580
+ audio?: {
581
+ path?: string | null;
582
+ url?: string;
583
+ } | null;
584
+ notes?: string;
585
+ difficulty?: string;
586
+ default_language?: string;
587
+ target_text?: string;
588
+ type: CardActivityType;
589
+ grading_criteria?: string;
590
+ scoring_type?: string;
591
+ grading_method?: "simple" | "rubric" | "manual" | "standards_based";
592
+ feedback_types?: string[];
593
+ rubricId?: string;
594
+ prompt?: string;
595
+ title?: string;
596
+ passing_score?: number;
597
+ maxCharacters?: number;
598
+ answer?: string[];
599
+ choices?: {
600
+ value: string;
601
+ option: string;
602
+ }[];
603
+ MCQType?: string;
604
+ multipleAttemptsAllowed?: boolean;
605
+ allowRetries?: boolean;
606
+ question?: string;
607
+ respondTime?: number;
608
+ hidePrompt?: boolean;
609
+ videoUrl?: string;
610
+ link?: string;
611
+ text?: string;
612
+ isListenAloud?: boolean;
613
+ embedCode?: string;
614
+ attempt?: number;
615
+ correct?: number;
616
+ autoGrade?: boolean;
617
+ points?: number;
618
+ shuffle?: boolean;
619
+ translation?: string;
620
+ includeAIContext?: boolean;
621
+ media_area_context_ref?: string | null;
622
+ standardId?: string;
623
+ target_proficiency_level?: string;
624
+ allowTTS?: boolean;
625
+ }[]>;
626
+ getCard: (params: {
627
+ cardId: string;
628
+ }) => Promise<CardActivityWithId | null>;
629
+ };
630
+
631
+ interface SetWithId extends Set {
632
+ id: string;
633
+ }
634
+ interface Set {
635
+ id: string;
636
+ language: string;
637
+ ownerName: string;
638
+ weights: Record<string, number>;
639
+ repeat?: number;
640
+ voice?: string;
641
+ averagePhraseLength?: number;
642
+ passing_score?: number;
643
+ organizations?: string[];
644
+ description: string;
645
+ image: {
646
+ url: string;
647
+ path: null | string;
648
+ };
649
+ additionalLanguages?: string[];
650
+ owners: string[];
651
+ name: string;
652
+ content: string[];
653
+ types: {
654
+ [key in CardActivityType]?: number;
655
+ };
656
+ defaultLanguage: string;
657
+ createdAt: FieldValue;
658
+ public: boolean;
659
+ defaultRubricId?: string;
660
+ difficulty?: string;
661
+ end_screen?: {
662
+ variant: 0 | 1 | 2;
663
+ title: string;
664
+ description: string;
665
+ };
666
+ mcAllowRetries?: boolean;
667
+ welcome_screen?: {
668
+ variant: 'colored' | 'blank';
669
+ };
670
+ poorFunctionalityWarning?: boolean;
671
+ status?: 'draft' | 'published';
672
+ subjects?: any[];
673
+ respondAllowRetries?: boolean;
674
+ respondAllowTTS?: boolean;
675
+ feedbackLanguage?: string;
676
+ respondMaxCharacters?: number;
677
+ respondMaxTime?: number;
678
+ }
679
+
680
+ declare const setsQueryKeys: {
681
+ all: string[];
682
+ one: (params: {
683
+ setId: string;
684
+ }) => string[];
685
+ };
686
+ declare const useSet: ({ setId, enabled }: {
687
+ setId: string;
688
+ enabled?: boolean;
689
+ }) => _tanstack_react_query.UseQueryResult<SetWithId | null, Error>;
690
+ declare function getSetFromCache({ setId, queryClient, }: {
691
+ setId: string | undefined;
692
+ queryClient: QueryClient;
693
+ }): SetWithId | null | undefined;
694
+ declare function updateSetInCache({ set, queryClient, }: {
695
+ set: SetWithId;
696
+ queryClient: QueryClient;
697
+ }): void;
698
+
699
+ declare const SETS_COLLECTION = "sets";
700
+ type RefsSetsFirestore = `${typeof SETS_COLLECTION}/${string}`;
701
+ declare const refsSetsFirestore: {
702
+ allSets: string;
703
+ set: (id: string) => `sets/${string}`;
704
+ };
705
+
706
+ declare const createSetRepo: () => {
707
+ getSet: (args_0: {
708
+ setId: string;
709
+ }) => Promise<SetWithId | null>;
710
+ };
711
+
712
+ declare const SPEAKABLE_NOTIFICATIONS: {
713
+ readonly NEW_ASSIGNMENT: "new_assignment";
714
+ readonly ASSESSMENT_SUBMITTED: "assessment_submitted";
715
+ readonly ASSESSMENT_SCORED: "assessment_scored";
716
+ readonly NEW_COMMENT: "NEW_COMMENT";
717
+ };
718
+ type SpeakableNotificationType = (typeof SPEAKABLE_NOTIFICATIONS)[keyof typeof SPEAKABLE_NOTIFICATIONS];
719
+ declare const SpeakableNotificationTypes: {
720
+ NEW_ASSIGNMENT: string;
721
+ FEEDBACK_FROM_TEACHER: string;
722
+ MESSAGE_FROM_STUDENT: string;
723
+ PHRASE_MARKED_CORRECT: string;
724
+ STUDENT_PROGRESS: string;
725
+ PLAYLIST_FOLLOWERS: string;
726
+ PLAYLIST_PLAYS: string;
727
+ ASSESSMENT_SUBMITTED: string;
728
+ ASSESSMENT_SCORED: string;
729
+ NEW_COMMENT: string;
730
+ };
731
+
732
+ declare const useCreateNotification: () => {
733
+ createNotification: (type: SpeakableNotificationType, data: any) => Promise<_firebase_functions.HttpsCallableResult<unknown> | {
734
+ success: boolean;
735
+ message: string;
736
+ } | null | undefined>;
737
+ };
218
738
 
219
739
  type FsClient = ReturnType<typeof createFsClient>;
220
- declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'): Promise<{
740
+ declare function createFsClient({ db, platform, functions, }: {
741
+ db: FirebaseInstance;
742
+ platform: 'web' | 'native';
743
+ functions: FirebaseFunctions;
744
+ }): Promise<{
221
745
  assignmentRepo: {
222
- getAssignment: (params: GetAssignmentScoresParams) => Promise<AssignmentWithId | {
746
+ getAssignment: (params: {
747
+ assignmentId: string;
748
+ currentUserId: string;
749
+ analyticType?: AssignmentAnalyticsType;
750
+ studentId?: string;
751
+ }) => Promise<AssignmentWithId | {
223
752
  scores: any;
224
753
  id: string;
225
754
  isAvailable: boolean;
226
- title: string;
755
+ name: string;
227
756
  description: string;
228
757
  scheduledTime?: string | null;
229
758
  dueTime?: {
@@ -244,10 +773,7 @@ declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'
244
773
  };
245
774
  teacherName: string;
246
775
  courseWorkId: string | null;
247
- dueDateTimestamp: {
248
- seconds: number;
249
- nanoseconds: number;
250
- };
776
+ dueDateTimestamp: CustomTimestamp;
251
777
  scheduledTimeTimestamp: number;
252
778
  active: boolean;
253
779
  voice: string | null;
@@ -259,12 +785,18 @@ declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'
259
785
  maxPoints: number;
260
786
  courseId: string;
261
787
  isAssessment: boolean;
788
+ ltiDeeplink?: string;
262
789
  } | null>;
263
- attachScoresAssignment: (args_0: GetAttachScoresParams) => Promise<{
790
+ attachScoresAssignment: (args_0: {
791
+ assignments: AssignmentWithId[];
792
+ analyticType: AssignmentAnalyticsType;
793
+ studentId?: string;
794
+ currentUserId: string;
795
+ }) => Promise<{
264
796
  scores: any;
265
797
  id: string;
266
798
  isAvailable: boolean;
267
- title: string;
799
+ name: string;
268
800
  description: string;
269
801
  scheduledTime?: string | null;
270
802
  dueTime?: {
@@ -285,10 +817,7 @@ declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'
285
817
  };
286
818
  teacherName: string;
287
819
  courseWorkId: string | null;
288
- dueDateTimestamp: {
289
- seconds: number;
290
- nanoseconds: number;
291
- };
820
+ dueDateTimestamp: CustomTimestamp;
292
821
  scheduledTimeTimestamp: number;
293
822
  active: boolean;
294
823
  voice: string | null;
@@ -300,26 +829,258 @@ declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'
300
829
  maxPoints: number;
301
830
  courseId: string;
302
831
  isAssessment: boolean;
832
+ ltiDeeplink?: string;
303
833
  }[]>;
304
- getAssignmentScores: (args_0: GetAssignmentScoresParams) => Promise<{
834
+ getAssignmentScores: (args_0: {
835
+ assignmentId: string;
836
+ currentUserId: string;
837
+ analyticType?: AssignmentAnalyticsType;
838
+ studentId?: string;
839
+ }) => Promise<{
305
840
  scores: unknown;
306
841
  id: string;
307
842
  } | undefined>;
308
843
  getAllAssignments: () => Promise<AssignmentWithId[]>;
309
844
  };
845
+ cardRepo: {
846
+ createCard: (args_0: {
847
+ data: Partial<CardActivity>;
848
+ }) => Promise<{
849
+ id: string;
850
+ } & Partial<CardActivity>>;
851
+ createCards: (args_0: {
852
+ cards: CardActivity[];
853
+ }) => Promise<{
854
+ id: string;
855
+ owners: string[];
856
+ checked?: boolean;
857
+ completed?: boolean;
858
+ media_area_id?: string | null;
859
+ media_area_layout?: "left" | "right" | null;
860
+ score?: number;
861
+ verificationStatus?: VerificationCardStatus;
862
+ native_text?: string;
863
+ repeat?: number;
864
+ language?: string | null;
865
+ image?: {
866
+ path?: string | null;
867
+ url?: string;
868
+ };
869
+ audio?: {
870
+ path?: string | null;
871
+ url?: string;
872
+ } | null;
873
+ notes?: string;
874
+ difficulty?: string;
875
+ default_language?: string;
876
+ target_text?: string;
877
+ type: CardActivityType;
878
+ grading_criteria?: string;
879
+ scoring_type?: string;
880
+ grading_method?: "simple" | "rubric" | "manual" | "standards_based";
881
+ feedback_types?: string[];
882
+ rubricId?: string;
883
+ prompt?: string;
884
+ title?: string;
885
+ passing_score?: number;
886
+ maxCharacters?: number;
887
+ answer?: string[];
888
+ choices?: {
889
+ value: string;
890
+ option: string;
891
+ }[];
892
+ MCQType?: string;
893
+ multipleAttemptsAllowed?: boolean;
894
+ allowRetries?: boolean;
895
+ question?: string;
896
+ respondTime?: number;
897
+ hidePrompt?: boolean;
898
+ videoUrl?: string;
899
+ link?: string;
900
+ text?: string;
901
+ isListenAloud?: boolean;
902
+ embedCode?: string;
903
+ attempt?: number;
904
+ correct?: number;
905
+ autoGrade?: boolean;
906
+ points?: number;
907
+ shuffle?: boolean;
908
+ translation?: string;
909
+ includeAIContext?: boolean;
910
+ media_area_context_ref?: string | null;
911
+ standardId?: string;
912
+ target_proficiency_level?: string;
913
+ allowTTS?: boolean;
914
+ }[]>;
915
+ getCard: (params: {
916
+ cardId: string;
917
+ }) => Promise<CardActivityWithId | null>;
918
+ };
310
919
  }>;
311
920
 
921
+ interface Timestamp {
922
+ seconds: number;
923
+ nanoseconds: number;
924
+ }
925
+ interface FirebaseCustomClaims {
926
+ iss: string;
927
+ aud: string;
928
+ auth_time: number;
929
+ user_id: string;
930
+ sub: string;
931
+ iat: number;
932
+ exp: number;
933
+ email: string;
934
+ email_verified: boolean;
935
+ lti_service_key: string;
936
+ firebase: {
937
+ identities: string[];
938
+ sign_in_provider: string;
939
+ };
940
+ }
941
+ interface UserProfile {
942
+ recentAssignments: string[];
943
+ onboardingComplete: boolean;
944
+ isGoogleUser: boolean;
945
+ connectedGoogleClassroom: boolean;
946
+ nativeLanguage: string;
947
+ subjects: string[];
948
+ healthScore: number;
949
+ gradeLevel: string;
950
+ language: string;
951
+ roles: string[];
952
+ districtID: string;
953
+ messageCount: number;
954
+ totalActiveTime: number;
955
+ healthScoreComponents: {
956
+ lastAccess: number;
957
+ assignmentsLast30Days: number;
958
+ totalAssignments: number;
959
+ daysActive: number;
960
+ };
961
+ onboardingSteps: string[];
962
+ totalAssignmentsActivated: number;
963
+ emailOptOut: boolean;
964
+ healthScoreLastUpdated: Timestamp;
965
+ adminStatus: string;
966
+ googleClassroomUserId: string;
967
+ recentRubrics: string[];
968
+ image: {
969
+ url: string;
970
+ path: string;
971
+ };
972
+ onboardingState: string;
973
+ emailVerified: boolean;
974
+ totalStudentAssignmentsSubmitted: number;
975
+ speakableio: boolean;
976
+ schoolId: string;
977
+ defaultGradingSettings: {
978
+ rubricId: string;
979
+ scoring_type: 'pass_fail';
980
+ passing_score: number;
981
+ feedback_types: ('wida' | 'grammar_insights' | 'actfl' | 'suggested_response')[];
982
+ grading_criteria: string;
983
+ autoGrade: boolean;
984
+ grading_method: 'rubric';
985
+ };
986
+ studentDeviceType: string;
987
+ email: string;
988
+ districtName: string;
989
+ webSessions: number;
990
+ lastAccess: Timestamp;
991
+ savedSets: string[];
992
+ reviewed_student_submission: boolean;
993
+ resetTime: string;
994
+ assistantId: string;
995
+ additionalLanguages: string[];
996
+ displayName: string;
997
+ owners: string[];
998
+ additionalNativeLanguages: string[];
999
+ dateMade: Timestamp;
1000
+ schoolName: string;
1001
+ loaded: boolean;
1002
+ loading: boolean;
1003
+ isTeacher: boolean;
1004
+ }
1005
+ interface UserAuth {
1006
+ uid: string;
1007
+ email: string;
1008
+ displayName: string | null;
1009
+ custom_claims: FirebaseCustomClaims;
1010
+ createdAt: string;
1011
+ lastLogin: string;
1012
+ loaded: boolean;
1013
+ loading: boolean;
1014
+ }
1015
+ interface Lti {
1016
+ data: {
1017
+ services: {
1018
+ serviceKey: string;
1019
+ };
1020
+ };
1021
+ }
1022
+ interface User {
1023
+ profile: UserProfile;
1024
+ auth: UserAuth;
1025
+ lti: Lti;
1026
+ authLoaded: boolean;
1027
+ profileLoaded: boolean;
1028
+ roles: string[];
1029
+ loadingRoles: boolean;
1030
+ drawerOpen: boolean;
1031
+ mobileOpen: boolean;
1032
+ }
1033
+
1034
+ declare const SpeakablePlanTypes: {
1035
+ readonly basic: "basic";
1036
+ readonly teacher_pro: "teacher_pro";
1037
+ readonly school_starter: "school_starter";
1038
+ readonly organization: "organization";
1039
+ readonly starter: "starter";
1040
+ readonly growth: "growth";
1041
+ readonly professional: "professional";
1042
+ };
1043
+
1044
+ interface Permissions {
1045
+ loaded: boolean;
1046
+ loading: boolean;
1047
+ permissions: string[];
1048
+ plan: keyof typeof SpeakablePlanTypes;
1049
+ subscriptionId: string;
1050
+ isInstitutionPlan: boolean;
1051
+ type: string;
1052
+ contact: string;
1053
+ hasStudentPortfolios?: boolean;
1054
+ refreshDate: string;
1055
+ isStripePlan: boolean;
1056
+ freeOrgTrialExpired?: boolean;
1057
+ }
1058
+
312
1059
  interface FsContext {
313
1060
  speakableApi: Awaited<FsClient>;
314
1061
  queryClient: QueryClient;
1062
+ user: User;
1063
+ permissions: Permissions;
1064
+ firebaseFunctions: FirebaseFunctions;
1065
+ localStorage: {
1066
+ setItem: (key: string, value: string) => void;
1067
+ getItem: (key: string) => string | null;
1068
+ };
315
1069
  }
316
1070
  declare const FsCtx: React.Context<FsContext | null>;
317
- declare function SpeakableProvider({ db, platform, children, queryClient, }: {
1071
+ declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, firebaseFunctions, localStorage, }: {
318
1072
  db: FirebaseInstance;
1073
+ firebaseFunctions: FirebaseFunctions;
319
1074
  platform: 'web' | 'native';
320
1075
  children: React.ReactNode;
321
1076
  queryClient: QueryClient;
1077
+ user: User;
1078
+ permissions: Permissions;
1079
+ localStorage: {
1080
+ setItem: (key: string, value: string) => void;
1081
+ getItem: (key: string) => string | null;
1082
+ };
322
1083
  }): react_jsx_runtime.JSX.Element | null;
323
1084
  declare function useSpeakableApi(): FsContext;
324
1085
 
325
- export { type Assignment, type AssignmentWithId, type FsClient, FsCtx, SpeakableProvider, assignmentQueryKeys, createAssignmentRepo, createFsClient, useAssignment, useSpeakableApi };
1086
+ export { ALLOWED_CARD_ACTIVITY_TYPES_FOR_SUMMARY, type Assignment, type AssignmentWithId, BASE_MULTIPLE_CHOICE_FIELD_VALUES, BASE_REPEAT_FIELD_VALUES, BASE_RESPOND_FIELD_VALUES, type CardActivity, CardActivityType, type CardActivityWithId, type CardScore, FeedbackTypesCard, type FsClient, FsCtx, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, REPEAT_CARD_ACTIVITY_TYPES, RESPOND_AUDIO_CARD_ACTIVITY_TYPES, RESPOND_CARD_ACTIVITY_TYPES, RESPOND_WRITE_CARD_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, createAssignmentRepo, createCardRepo, createFsClient, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };