@speakableio/core 0.1.106 → 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.
- package/dist/analytics-Bj2i88Zk.d.ts +89 -0
- package/dist/analytics.d.mts +88 -0
- package/dist/analytics.js +329 -25
- package/dist/analytics.js.map +1 -1
- package/dist/{assignment.model-DLMWAp0Y.d.ts → assignment.model-BRS4h8gX.d.ts} +1 -1
- package/dist/assignment.model-Bc61gBHl.d.ts +302 -0
- package/dist/assignment.model-Bm9gE2YK.d.ts +301 -0
- package/dist/const.d.ts +3 -73
- package/dist/const.js +355 -45
- package/dist/const.js.map +1 -1
- package/dist/everything.d.ts +1348 -0
- package/dist/everything.js +3509 -0
- package/dist/everything.js.map +1 -0
- package/dist/hooks.d.ts +621 -4
- package/dist/hooks.js +1745 -61
- package/dist/hooks.js.map +1 -1
- package/dist/index.native.d.mts +2836 -0
- package/dist/index.native.d.ts +2272 -27
- package/dist/index.native.js +2995 -166
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +3322 -0
- package/dist/index.native.mjs.map +1 -0
- package/dist/index.web-DNYJV_41.d.ts +469 -0
- package/dist/index.web.d.mts +2836 -0
- package/dist/index.web.d.ts +68 -2
- package/dist/index.web.js +3244 -12
- package/dist/index.web.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +43 -8
- package/dist/models.js.map +1 -1
- package/dist/{notification.constants-Da4-_0kX.d.ts → notification.constants-B72fb734.d.ts} +1 -1
- package/dist/repos.d.ts +1 -1
- package/dist/repos.js +440 -13
- package/dist/repos.js.map +1 -1
- package/dist/speakable-plans-BjWWEWrQ.d.ts +72 -0
- package/dist/speakable-plans-DR1cQ6IK.d.ts +92 -0
- package/dist/speakable-plans-Dq9nRefI.d.ts +72 -0
- package/dist/utils.d.ts +84 -2
- package/dist/utils.js +481 -15
- package/dist/utils.js.map +1 -1
- package/dist/web.constants-qmx4rGyO.d.ts +26 -0
- package/package.json +11 -62
- package/dist/chunk-233VJDUF.js +0 -149
- package/dist/chunk-233VJDUF.js.map +0 -1
- package/dist/chunk-2CRI5MJP.js +0 -225
- package/dist/chunk-2CRI5MJP.js.map +0 -1
- package/dist/chunk-AWVUNWML.js +0 -141
- package/dist/chunk-AWVUNWML.js.map +0 -1
- package/dist/chunk-CJ5JXKII.js +0 -129
- package/dist/chunk-CJ5JXKII.js.map +0 -1
- package/dist/chunk-EEBMPASA.js +0 -21
- package/dist/chunk-EEBMPASA.js.map +0 -1
- package/dist/chunk-H5XNOXRC.js +0 -11
- package/dist/chunk-H5XNOXRC.js.map +0 -1
- package/dist/chunk-LZG3MTSH.js +0 -53
- package/dist/chunk-LZG3MTSH.js.map +0 -1
- package/dist/chunk-OLSTHM2U.js +0 -154
- package/dist/chunk-OLSTHM2U.js.map +0 -1
- package/dist/chunk-TQGDTKTE.js +0 -13
- package/dist/chunk-TQGDTKTE.js.map +0 -1
- package/dist/chunk-YKUMIPSO.js +0 -212
- package/dist/chunk-YKUMIPSO.js.map +0 -1
- package/dist/chunk-YMJRCINF.js +0 -68
- package/dist/chunk-YMJRCINF.js.map +0 -1
- package/dist/chunk-YO34TZYN.js +0 -28
- package/dist/chunk-YO34TZYN.js.map +0 -1
package/dist/hooks.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { A as AssignmentWithId,
|
|
3
|
+
import { A as AssignmentWithId, C as CustomTimestamp, a as ActivityPageType, e as ScoreWithId, S as Score, f as PageScore, b as PageActivityWithId, P as PageActivity } from './assignment.model-Bm9gE2YK.js';
|
|
4
4
|
import { A as AssignmentAnalyticsType } from './assignment.constants-BIKM6fYi.js';
|
|
5
|
-
import { V as VerificationCardStatus } from './card.constants-DhKFipX3.js';
|
|
6
|
-
import { S as SpeakableNotificationType } from './notification.constants-Da4-_0kX.js';
|
|
7
5
|
import { SetWithId } from './models.js';
|
|
6
|
+
import { V as VerificationCardStatus } from './card.constants-DhKFipX3.js';
|
|
7
|
+
import { a as SpeakableNotificationType } from './notification.constants-B72fb734.js';
|
|
8
|
+
import { S as SpeakablePlanTypes } from './speakable-plans-BjWWEWrQ.js';
|
|
8
9
|
import '@react-native-firebase/firestore';
|
|
9
10
|
import 'firebase/firestore';
|
|
10
11
|
|
|
@@ -161,6 +162,421 @@ declare function useSubmitPracticeScore(): {
|
|
|
161
162
|
isLoading: boolean;
|
|
162
163
|
};
|
|
163
164
|
|
|
165
|
+
declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData, }: {
|
|
166
|
+
id: string;
|
|
167
|
+
isAssignment: boolean;
|
|
168
|
+
onAssignmentSubmitted: (assignmentId: string) => void;
|
|
169
|
+
ltiData?: {
|
|
170
|
+
lineItemId?: string;
|
|
171
|
+
lti_id?: string;
|
|
172
|
+
serviceKey?: string;
|
|
173
|
+
};
|
|
174
|
+
}): {
|
|
175
|
+
set: {
|
|
176
|
+
data: SetWithId | null | undefined;
|
|
177
|
+
query: _tanstack_react_query.UseQueryResult<SetWithId | null, Error>;
|
|
178
|
+
};
|
|
179
|
+
cards: {
|
|
180
|
+
data: Record<string, PageActivityWithId> | null;
|
|
181
|
+
query: _tanstack_react_query.UseQueryResult<PageActivityWithId | null, Error>[];
|
|
182
|
+
cardsArray: PageActivityWithId[];
|
|
183
|
+
};
|
|
184
|
+
assignment: {
|
|
185
|
+
data: AssignmentWithId | {
|
|
186
|
+
scores: any;
|
|
187
|
+
id: string;
|
|
188
|
+
isAvailable: boolean;
|
|
189
|
+
name: string;
|
|
190
|
+
description: string;
|
|
191
|
+
scheduledTime?: string | null;
|
|
192
|
+
dueTime?: {
|
|
193
|
+
hours: number;
|
|
194
|
+
minutes: number;
|
|
195
|
+
nanos: number;
|
|
196
|
+
};
|
|
197
|
+
speakableio: boolean;
|
|
198
|
+
owners: string[];
|
|
199
|
+
image: {
|
|
200
|
+
path: string | null;
|
|
201
|
+
url: string;
|
|
202
|
+
};
|
|
203
|
+
dueDate: {
|
|
204
|
+
day: number;
|
|
205
|
+
month: number;
|
|
206
|
+
year: number;
|
|
207
|
+
};
|
|
208
|
+
teacherName: string;
|
|
209
|
+
courseWorkId: string | null;
|
|
210
|
+
dueDateTimestamp: CustomTimestamp;
|
|
211
|
+
scheduledTimeTimestamp: number;
|
|
212
|
+
active: boolean;
|
|
213
|
+
voice: string | null;
|
|
214
|
+
setId: string;
|
|
215
|
+
dateMade: {
|
|
216
|
+
seconds: number;
|
|
217
|
+
nanoseconds: number;
|
|
218
|
+
};
|
|
219
|
+
maxPoints: number;
|
|
220
|
+
courseId: string;
|
|
221
|
+
isAssessment: boolean;
|
|
222
|
+
ltiDeeplink?: string;
|
|
223
|
+
content?: string[];
|
|
224
|
+
weights?: Record<string, number>;
|
|
225
|
+
language?: string;
|
|
226
|
+
types?: { [key in ActivityPageType]?: number; };
|
|
227
|
+
aiEnabled?: boolean;
|
|
228
|
+
chat_experience?: boolean;
|
|
229
|
+
} | null | undefined;
|
|
230
|
+
query: _tanstack_react_query.UseQueryResult<AssignmentWithId | {
|
|
231
|
+
scores: any;
|
|
232
|
+
id: string;
|
|
233
|
+
isAvailable: boolean;
|
|
234
|
+
name: string;
|
|
235
|
+
description: string;
|
|
236
|
+
scheduledTime?: string | null;
|
|
237
|
+
dueTime?: {
|
|
238
|
+
hours: number;
|
|
239
|
+
minutes: number;
|
|
240
|
+
nanos: number;
|
|
241
|
+
};
|
|
242
|
+
speakableio: boolean;
|
|
243
|
+
owners: string[];
|
|
244
|
+
image: {
|
|
245
|
+
path: string | null;
|
|
246
|
+
url: string;
|
|
247
|
+
};
|
|
248
|
+
dueDate: {
|
|
249
|
+
day: number;
|
|
250
|
+
month: number;
|
|
251
|
+
year: number;
|
|
252
|
+
};
|
|
253
|
+
teacherName: string;
|
|
254
|
+
courseWorkId: string | null;
|
|
255
|
+
dueDateTimestamp: CustomTimestamp;
|
|
256
|
+
scheduledTimeTimestamp: number;
|
|
257
|
+
active: boolean;
|
|
258
|
+
voice: string | null;
|
|
259
|
+
setId: string;
|
|
260
|
+
dateMade: {
|
|
261
|
+
seconds: number;
|
|
262
|
+
nanoseconds: number;
|
|
263
|
+
};
|
|
264
|
+
maxPoints: number;
|
|
265
|
+
courseId: string;
|
|
266
|
+
isAssessment: boolean;
|
|
267
|
+
ltiDeeplink?: string;
|
|
268
|
+
content?: string[];
|
|
269
|
+
weights?: Record<string, number>;
|
|
270
|
+
language?: string;
|
|
271
|
+
types?: { [key in ActivityPageType]?: number; };
|
|
272
|
+
aiEnabled?: boolean;
|
|
273
|
+
chat_experience?: boolean;
|
|
274
|
+
} | null, Error>;
|
|
275
|
+
};
|
|
276
|
+
scores: {
|
|
277
|
+
data: ScoreWithId | undefined;
|
|
278
|
+
query: _tanstack_react_query.UseQueryResult<ScoreWithId, Error>;
|
|
279
|
+
actions: {
|
|
280
|
+
update: (data: Partial<Score>) => void;
|
|
281
|
+
clear: ({ cardId, wasCompleted, }: {
|
|
282
|
+
cardId: string;
|
|
283
|
+
wasCompleted?: boolean;
|
|
284
|
+
}) => void;
|
|
285
|
+
submit: () => Promise<{
|
|
286
|
+
success: boolean;
|
|
287
|
+
message: string;
|
|
288
|
+
error?: undefined;
|
|
289
|
+
} | {
|
|
290
|
+
success: boolean;
|
|
291
|
+
error: unknown;
|
|
292
|
+
message?: undefined;
|
|
293
|
+
}>;
|
|
294
|
+
updateCard: (cardId: string, cardScore: PageScore) => void;
|
|
295
|
+
logGradingStandardEntry: ({ cardId, gradingStandard, type, }: {
|
|
296
|
+
cardId: string;
|
|
297
|
+
gradingStandard: {
|
|
298
|
+
level: string;
|
|
299
|
+
justification: string;
|
|
300
|
+
};
|
|
301
|
+
type: "actfl" | "wida" | "custom";
|
|
302
|
+
}) => void;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
interface StudentTeacherPlanResult {
|
|
308
|
+
studentId: string;
|
|
309
|
+
teachers: {
|
|
310
|
+
teacherId: string;
|
|
311
|
+
teacherName: string;
|
|
312
|
+
teacherEmail: string;
|
|
313
|
+
plan: string;
|
|
314
|
+
hasActiveTeamPlan: boolean;
|
|
315
|
+
hasActiveOrgPlan: boolean;
|
|
316
|
+
hasUnlimitedAccess: boolean;
|
|
317
|
+
}[];
|
|
318
|
+
hasTeacherWithTeamPlan: boolean;
|
|
319
|
+
hasTeacherWithOrgPlan: boolean;
|
|
320
|
+
hasTeacherWithUnlimitedAccess: boolean;
|
|
321
|
+
canAccessFeedback: boolean;
|
|
322
|
+
reason?: string;
|
|
323
|
+
}
|
|
324
|
+
interface ActivityFeedbackAccess {
|
|
325
|
+
canAccessFeedback: boolean;
|
|
326
|
+
reason?: string;
|
|
327
|
+
isUnlimited: boolean;
|
|
328
|
+
accessType: 'ai_enabled' | 'teacher_preview' | 'student_with_teacher_plan' | 'none';
|
|
329
|
+
}
|
|
330
|
+
declare const activityFeedbackAccessQueryKeys: {
|
|
331
|
+
activityFeedbackAccess: (args: {
|
|
332
|
+
aiEnabled: boolean;
|
|
333
|
+
isActivityRoute: boolean;
|
|
334
|
+
}) => readonly ["activityFeedbackAccess", ...boolean[]];
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Hook to check feedback permissions for both students and teachers
|
|
338
|
+
*
|
|
339
|
+
* Permission Logic:
|
|
340
|
+
* 1. aiEnabled: true → Allow feedback access always (highest priority)
|
|
341
|
+
* 2. Teachers on /activity route → Always allowed (ADMIN role)
|
|
342
|
+
* 3. Students on /activity route → Need teacher with active plan (team/org)
|
|
343
|
+
*
|
|
344
|
+
* @param params - Parameters for permission checking
|
|
345
|
+
* @returns Feedback permissions information
|
|
346
|
+
*/
|
|
347
|
+
declare const useActivityFeedbackAccess: ({ aiEnabled, isActivityRoute, }: {
|
|
348
|
+
aiEnabled?: boolean;
|
|
349
|
+
isActivityRoute?: boolean;
|
|
350
|
+
}) => {
|
|
351
|
+
data: ActivityFeedbackAccess;
|
|
352
|
+
error: Error;
|
|
353
|
+
isError: true;
|
|
354
|
+
isPending: false;
|
|
355
|
+
isLoading: false;
|
|
356
|
+
isLoadingError: false;
|
|
357
|
+
isRefetchError: true;
|
|
358
|
+
isSuccess: false;
|
|
359
|
+
isPlaceholderData: false;
|
|
360
|
+
status: "error";
|
|
361
|
+
dataUpdatedAt: number;
|
|
362
|
+
errorUpdatedAt: number;
|
|
363
|
+
failureCount: number;
|
|
364
|
+
failureReason: Error | null;
|
|
365
|
+
errorUpdateCount: number;
|
|
366
|
+
isFetched: boolean;
|
|
367
|
+
isFetchedAfterMount: boolean;
|
|
368
|
+
isFetching: boolean;
|
|
369
|
+
isInitialLoading: boolean;
|
|
370
|
+
isPaused: boolean;
|
|
371
|
+
isRefetching: boolean;
|
|
372
|
+
isStale: boolean;
|
|
373
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
|
|
374
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
375
|
+
promise: Promise<ActivityFeedbackAccess>;
|
|
376
|
+
} | {
|
|
377
|
+
data: ActivityFeedbackAccess;
|
|
378
|
+
error: null;
|
|
379
|
+
isError: false;
|
|
380
|
+
isPending: false;
|
|
381
|
+
isLoading: false;
|
|
382
|
+
isLoadingError: false;
|
|
383
|
+
isRefetchError: false;
|
|
384
|
+
isSuccess: true;
|
|
385
|
+
isPlaceholderData: false;
|
|
386
|
+
status: "success";
|
|
387
|
+
dataUpdatedAt: number;
|
|
388
|
+
errorUpdatedAt: number;
|
|
389
|
+
failureCount: number;
|
|
390
|
+
failureReason: Error | null;
|
|
391
|
+
errorUpdateCount: number;
|
|
392
|
+
isFetched: boolean;
|
|
393
|
+
isFetchedAfterMount: boolean;
|
|
394
|
+
isFetching: boolean;
|
|
395
|
+
isInitialLoading: boolean;
|
|
396
|
+
isPaused: boolean;
|
|
397
|
+
isRefetching: boolean;
|
|
398
|
+
isStale: boolean;
|
|
399
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
|
|
400
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
401
|
+
promise: Promise<ActivityFeedbackAccess>;
|
|
402
|
+
} | {
|
|
403
|
+
data: undefined;
|
|
404
|
+
error: Error;
|
|
405
|
+
isError: true;
|
|
406
|
+
isPending: false;
|
|
407
|
+
isLoading: false;
|
|
408
|
+
isLoadingError: true;
|
|
409
|
+
isRefetchError: false;
|
|
410
|
+
isSuccess: false;
|
|
411
|
+
isPlaceholderData: false;
|
|
412
|
+
status: "error";
|
|
413
|
+
dataUpdatedAt: number;
|
|
414
|
+
errorUpdatedAt: number;
|
|
415
|
+
failureCount: number;
|
|
416
|
+
failureReason: Error | null;
|
|
417
|
+
errorUpdateCount: number;
|
|
418
|
+
isFetched: boolean;
|
|
419
|
+
isFetchedAfterMount: boolean;
|
|
420
|
+
isFetching: boolean;
|
|
421
|
+
isInitialLoading: boolean;
|
|
422
|
+
isPaused: boolean;
|
|
423
|
+
isRefetching: boolean;
|
|
424
|
+
isStale: boolean;
|
|
425
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
|
|
426
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
427
|
+
promise: Promise<ActivityFeedbackAccess>;
|
|
428
|
+
} | {
|
|
429
|
+
data: undefined;
|
|
430
|
+
error: null;
|
|
431
|
+
isError: false;
|
|
432
|
+
isPending: true;
|
|
433
|
+
isLoading: true;
|
|
434
|
+
isLoadingError: false;
|
|
435
|
+
isRefetchError: false;
|
|
436
|
+
isSuccess: false;
|
|
437
|
+
isPlaceholderData: false;
|
|
438
|
+
status: "pending";
|
|
439
|
+
dataUpdatedAt: number;
|
|
440
|
+
errorUpdatedAt: number;
|
|
441
|
+
failureCount: number;
|
|
442
|
+
failureReason: Error | null;
|
|
443
|
+
errorUpdateCount: number;
|
|
444
|
+
isFetched: boolean;
|
|
445
|
+
isFetchedAfterMount: boolean;
|
|
446
|
+
isFetching: boolean;
|
|
447
|
+
isInitialLoading: boolean;
|
|
448
|
+
isPaused: boolean;
|
|
449
|
+
isRefetching: boolean;
|
|
450
|
+
isStale: boolean;
|
|
451
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
|
|
452
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
453
|
+
promise: Promise<ActivityFeedbackAccess>;
|
|
454
|
+
} | {
|
|
455
|
+
data: undefined;
|
|
456
|
+
error: null;
|
|
457
|
+
isError: false;
|
|
458
|
+
isPending: true;
|
|
459
|
+
isLoadingError: false;
|
|
460
|
+
isRefetchError: false;
|
|
461
|
+
isSuccess: false;
|
|
462
|
+
isPlaceholderData: false;
|
|
463
|
+
status: "pending";
|
|
464
|
+
dataUpdatedAt: number;
|
|
465
|
+
errorUpdatedAt: number;
|
|
466
|
+
failureCount: number;
|
|
467
|
+
failureReason: Error | null;
|
|
468
|
+
errorUpdateCount: number;
|
|
469
|
+
isFetched: boolean;
|
|
470
|
+
isFetchedAfterMount: boolean;
|
|
471
|
+
isFetching: boolean;
|
|
472
|
+
isLoading: boolean;
|
|
473
|
+
isInitialLoading: boolean;
|
|
474
|
+
isPaused: boolean;
|
|
475
|
+
isRefetching: boolean;
|
|
476
|
+
isStale: boolean;
|
|
477
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
|
|
478
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
479
|
+
promise: Promise<ActivityFeedbackAccess>;
|
|
480
|
+
} | {
|
|
481
|
+
data: ActivityFeedbackAccess;
|
|
482
|
+
isError: false;
|
|
483
|
+
error: null;
|
|
484
|
+
isPending: false;
|
|
485
|
+
isLoading: false;
|
|
486
|
+
isLoadingError: false;
|
|
487
|
+
isRefetchError: false;
|
|
488
|
+
isSuccess: true;
|
|
489
|
+
isPlaceholderData: true;
|
|
490
|
+
status: "success";
|
|
491
|
+
dataUpdatedAt: number;
|
|
492
|
+
errorUpdatedAt: number;
|
|
493
|
+
failureCount: number;
|
|
494
|
+
failureReason: Error | null;
|
|
495
|
+
errorUpdateCount: number;
|
|
496
|
+
isFetched: boolean;
|
|
497
|
+
isFetchedAfterMount: boolean;
|
|
498
|
+
isFetching: boolean;
|
|
499
|
+
isInitialLoading: boolean;
|
|
500
|
+
isPaused: boolean;
|
|
501
|
+
isRefetching: boolean;
|
|
502
|
+
isStale: boolean;
|
|
503
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ActivityFeedbackAccess, Error>>;
|
|
504
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
505
|
+
promise: Promise<ActivityFeedbackAccess>;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onCompletionSuccess, onCompletionError, aiEnabled, submitAudioResponse, uploadAudioAndGetTranscript, onGetAudioUrlAndTranscript, }: {
|
|
509
|
+
onTranscriptSuccess: (transcript: string) => void;
|
|
510
|
+
onTranscriptError: ({ type, message }: {
|
|
511
|
+
type: string;
|
|
512
|
+
message: string;
|
|
513
|
+
}) => void;
|
|
514
|
+
onCompletionSuccess: (completion: any) => void;
|
|
515
|
+
onCompletionError: ({ type, message }: {
|
|
516
|
+
type: string;
|
|
517
|
+
message: string;
|
|
518
|
+
}) => void;
|
|
519
|
+
aiEnabled: boolean;
|
|
520
|
+
submitAudioResponse: (audio: string) => Promise<{
|
|
521
|
+
url: string;
|
|
522
|
+
fileName: string;
|
|
523
|
+
}>;
|
|
524
|
+
uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<{
|
|
525
|
+
transcript: string;
|
|
526
|
+
audioUrl: string;
|
|
527
|
+
}>;
|
|
528
|
+
onGetAudioUrlAndTranscript?: (args: {
|
|
529
|
+
transcript?: string;
|
|
530
|
+
audioUrl?: string;
|
|
531
|
+
}) => void;
|
|
532
|
+
}) => {
|
|
533
|
+
submitAudioResponse: (audio: string) => Promise<{
|
|
534
|
+
url: string;
|
|
535
|
+
fileName: string;
|
|
536
|
+
}>;
|
|
537
|
+
uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<{
|
|
538
|
+
transcript: string;
|
|
539
|
+
audioUrl: string;
|
|
540
|
+
}>;
|
|
541
|
+
getTranscript: (audioUrl: string, language: string) => Promise<string>;
|
|
542
|
+
getFreeResponseCompletion: (messages: string[], isFreeResponse: boolean, feedbackLanguage: string, gradingStandard?: string) => Promise<any>;
|
|
543
|
+
getFeedback: ({ cardId, language, writtenResponse, audio, autoGrade, file, }: {
|
|
544
|
+
cardId: string;
|
|
545
|
+
language: string;
|
|
546
|
+
writtenResponse: string | null;
|
|
547
|
+
audio: string | null;
|
|
548
|
+
autoGrade: boolean;
|
|
549
|
+
file: string | null;
|
|
550
|
+
}) => Promise<{
|
|
551
|
+
noFeedbackAvailable: boolean;
|
|
552
|
+
success: boolean;
|
|
553
|
+
reason: string;
|
|
554
|
+
accessType: "ai_enabled" | "teacher_preview" | "student_with_teacher_plan" | "none";
|
|
555
|
+
} | {
|
|
556
|
+
noFeedbackAvailable: boolean;
|
|
557
|
+
success: boolean;
|
|
558
|
+
reason: string;
|
|
559
|
+
accessType: string;
|
|
560
|
+
aiSuccess: boolean;
|
|
561
|
+
}>;
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
declare const useGoogleClassroom: () => {
|
|
565
|
+
submitAssignmentToGoogleClassroom: ({ assignment, scores, googleUserId, }: {
|
|
566
|
+
assignment: {
|
|
567
|
+
id: string;
|
|
568
|
+
name: string;
|
|
569
|
+
owners: string[];
|
|
570
|
+
courseId: string;
|
|
571
|
+
courseWorkId: string;
|
|
572
|
+
isAssessment: boolean;
|
|
573
|
+
maxPoints: number;
|
|
574
|
+
};
|
|
575
|
+
scores: Score;
|
|
576
|
+
googleUserId?: string | null;
|
|
577
|
+
}) => Promise<any>;
|
|
578
|
+
};
|
|
579
|
+
|
|
164
580
|
declare const cardsQueryKeys: {
|
|
165
581
|
all: string[];
|
|
166
582
|
one: (params: {
|
|
@@ -291,4 +707,205 @@ declare function updateSetInCache({ set, queryClient, }: {
|
|
|
291
707
|
queryClient: QueryClient;
|
|
292
708
|
}): void;
|
|
293
709
|
|
|
294
|
-
|
|
710
|
+
declare function useUserPlan(): {
|
|
711
|
+
userPlan: "basic" | "teacher_pro" | "school_starter" | "organization" | "starter" | "growth" | "professional";
|
|
712
|
+
loaded: boolean;
|
|
713
|
+
isFreePlan: boolean;
|
|
714
|
+
isTeacherProPlan: boolean;
|
|
715
|
+
isOrganizationPlan: boolean;
|
|
716
|
+
isSchoolStarter: boolean;
|
|
717
|
+
checkIsFreePlan: (plan: keyof typeof SpeakablePlanTypes) => plan is "basic";
|
|
718
|
+
checkIsTeacherProPlan: (plan: keyof typeof SpeakablePlanTypes) => plan is "teacher_pro" | "starter";
|
|
719
|
+
checkIsOrganizationPlan: (plan: keyof typeof SpeakablePlanTypes) => plan is "organization" | "growth" | "professional";
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
interface OrganizationAccess {
|
|
723
|
+
hasUnlimitedAccess: boolean;
|
|
724
|
+
subscriptionId: string | null;
|
|
725
|
+
organizationId: string | null;
|
|
726
|
+
organizationName: string | null;
|
|
727
|
+
subscriptionEndDate: Date | null;
|
|
728
|
+
accessType: 'organization' | 'individual' | 'institution_subscriptions';
|
|
729
|
+
}
|
|
730
|
+
interface InstitutionSubscription {
|
|
731
|
+
id: string;
|
|
732
|
+
institutionId: string;
|
|
733
|
+
name: string;
|
|
734
|
+
plan: string;
|
|
735
|
+
endDate: Date;
|
|
736
|
+
}
|
|
737
|
+
interface Organization {
|
|
738
|
+
id: string;
|
|
739
|
+
name: string;
|
|
740
|
+
members: string[];
|
|
741
|
+
masterSubscriptionStatus: string;
|
|
742
|
+
masterSubscriptionId: string;
|
|
743
|
+
masterSubscriptionEndDate: Date;
|
|
744
|
+
}
|
|
745
|
+
declare const useOrganizationAccess: () => {
|
|
746
|
+
data: OrganizationAccess;
|
|
747
|
+
error: Error;
|
|
748
|
+
isError: true;
|
|
749
|
+
isPending: false;
|
|
750
|
+
isLoading: false;
|
|
751
|
+
isLoadingError: false;
|
|
752
|
+
isRefetchError: true;
|
|
753
|
+
isSuccess: false;
|
|
754
|
+
isPlaceholderData: false;
|
|
755
|
+
status: "error";
|
|
756
|
+
dataUpdatedAt: number;
|
|
757
|
+
errorUpdatedAt: number;
|
|
758
|
+
failureCount: number;
|
|
759
|
+
failureReason: Error | null;
|
|
760
|
+
errorUpdateCount: number;
|
|
761
|
+
isFetched: boolean;
|
|
762
|
+
isFetchedAfterMount: boolean;
|
|
763
|
+
isFetching: boolean;
|
|
764
|
+
isInitialLoading: boolean;
|
|
765
|
+
isPaused: boolean;
|
|
766
|
+
isRefetching: boolean;
|
|
767
|
+
isStale: boolean;
|
|
768
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
|
|
769
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
770
|
+
promise: Promise<OrganizationAccess>;
|
|
771
|
+
} | {
|
|
772
|
+
data: OrganizationAccess;
|
|
773
|
+
error: null;
|
|
774
|
+
isError: false;
|
|
775
|
+
isPending: false;
|
|
776
|
+
isLoading: false;
|
|
777
|
+
isLoadingError: false;
|
|
778
|
+
isRefetchError: false;
|
|
779
|
+
isSuccess: true;
|
|
780
|
+
isPlaceholderData: false;
|
|
781
|
+
status: "success";
|
|
782
|
+
dataUpdatedAt: number;
|
|
783
|
+
errorUpdatedAt: number;
|
|
784
|
+
failureCount: number;
|
|
785
|
+
failureReason: Error | null;
|
|
786
|
+
errorUpdateCount: number;
|
|
787
|
+
isFetched: boolean;
|
|
788
|
+
isFetchedAfterMount: boolean;
|
|
789
|
+
isFetching: boolean;
|
|
790
|
+
isInitialLoading: boolean;
|
|
791
|
+
isPaused: boolean;
|
|
792
|
+
isRefetching: boolean;
|
|
793
|
+
isStale: boolean;
|
|
794
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
|
|
795
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
796
|
+
promise: Promise<OrganizationAccess>;
|
|
797
|
+
} | {
|
|
798
|
+
data: undefined;
|
|
799
|
+
error: Error;
|
|
800
|
+
isError: true;
|
|
801
|
+
isPending: false;
|
|
802
|
+
isLoading: false;
|
|
803
|
+
isLoadingError: true;
|
|
804
|
+
isRefetchError: false;
|
|
805
|
+
isSuccess: false;
|
|
806
|
+
isPlaceholderData: false;
|
|
807
|
+
status: "error";
|
|
808
|
+
dataUpdatedAt: number;
|
|
809
|
+
errorUpdatedAt: number;
|
|
810
|
+
failureCount: number;
|
|
811
|
+
failureReason: Error | null;
|
|
812
|
+
errorUpdateCount: number;
|
|
813
|
+
isFetched: boolean;
|
|
814
|
+
isFetchedAfterMount: boolean;
|
|
815
|
+
isFetching: boolean;
|
|
816
|
+
isInitialLoading: boolean;
|
|
817
|
+
isPaused: boolean;
|
|
818
|
+
isRefetching: boolean;
|
|
819
|
+
isStale: boolean;
|
|
820
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
|
|
821
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
822
|
+
promise: Promise<OrganizationAccess>;
|
|
823
|
+
} | {
|
|
824
|
+
data: undefined;
|
|
825
|
+
error: null;
|
|
826
|
+
isError: false;
|
|
827
|
+
isPending: true;
|
|
828
|
+
isLoading: true;
|
|
829
|
+
isLoadingError: false;
|
|
830
|
+
isRefetchError: false;
|
|
831
|
+
isSuccess: false;
|
|
832
|
+
isPlaceholderData: false;
|
|
833
|
+
status: "pending";
|
|
834
|
+
dataUpdatedAt: number;
|
|
835
|
+
errorUpdatedAt: number;
|
|
836
|
+
failureCount: number;
|
|
837
|
+
failureReason: Error | null;
|
|
838
|
+
errorUpdateCount: number;
|
|
839
|
+
isFetched: boolean;
|
|
840
|
+
isFetchedAfterMount: boolean;
|
|
841
|
+
isFetching: boolean;
|
|
842
|
+
isInitialLoading: boolean;
|
|
843
|
+
isPaused: boolean;
|
|
844
|
+
isRefetching: boolean;
|
|
845
|
+
isStale: boolean;
|
|
846
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
|
|
847
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
848
|
+
promise: Promise<OrganizationAccess>;
|
|
849
|
+
} | {
|
|
850
|
+
data: undefined;
|
|
851
|
+
error: null;
|
|
852
|
+
isError: false;
|
|
853
|
+
isPending: true;
|
|
854
|
+
isLoadingError: false;
|
|
855
|
+
isRefetchError: false;
|
|
856
|
+
isSuccess: false;
|
|
857
|
+
isPlaceholderData: false;
|
|
858
|
+
status: "pending";
|
|
859
|
+
dataUpdatedAt: number;
|
|
860
|
+
errorUpdatedAt: number;
|
|
861
|
+
failureCount: number;
|
|
862
|
+
failureReason: Error | null;
|
|
863
|
+
errorUpdateCount: number;
|
|
864
|
+
isFetched: boolean;
|
|
865
|
+
isFetchedAfterMount: boolean;
|
|
866
|
+
isFetching: boolean;
|
|
867
|
+
isLoading: boolean;
|
|
868
|
+
isInitialLoading: boolean;
|
|
869
|
+
isPaused: boolean;
|
|
870
|
+
isRefetching: boolean;
|
|
871
|
+
isStale: boolean;
|
|
872
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
|
|
873
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
874
|
+
promise: Promise<OrganizationAccess>;
|
|
875
|
+
} | {
|
|
876
|
+
data: OrganizationAccess;
|
|
877
|
+
isError: false;
|
|
878
|
+
error: null;
|
|
879
|
+
isPending: false;
|
|
880
|
+
isLoading: false;
|
|
881
|
+
isLoadingError: false;
|
|
882
|
+
isRefetchError: false;
|
|
883
|
+
isSuccess: true;
|
|
884
|
+
isPlaceholderData: true;
|
|
885
|
+
status: "success";
|
|
886
|
+
dataUpdatedAt: number;
|
|
887
|
+
errorUpdatedAt: number;
|
|
888
|
+
failureCount: number;
|
|
889
|
+
failureReason: Error | null;
|
|
890
|
+
errorUpdateCount: number;
|
|
891
|
+
isFetched: boolean;
|
|
892
|
+
isFetchedAfterMount: boolean;
|
|
893
|
+
isFetching: boolean;
|
|
894
|
+
isInitialLoading: boolean;
|
|
895
|
+
isPaused: boolean;
|
|
896
|
+
isRefetching: boolean;
|
|
897
|
+
isStale: boolean;
|
|
898
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<OrganizationAccess, Error>>;
|
|
899
|
+
fetchStatus: _tanstack_react_query.FetchStatus;
|
|
900
|
+
promise: Promise<OrganizationAccess>;
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
declare const useUpdateStudentVocab: (page: PageActivityWithId | null) => {
|
|
904
|
+
studentVocabMarkVoiceSuccess: undefined;
|
|
905
|
+
studentVocabMarkVoiceFail: undefined;
|
|
906
|
+
} | {
|
|
907
|
+
studentVocabMarkVoiceSuccess: () => Promise<void>;
|
|
908
|
+
studentVocabMarkVoiceFail: () => Promise<void>;
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
export { type ActivityFeedbackAccess, type InstitutionSubscription, type Organization, type OrganizationAccess, type StudentTeacherPlanResult, activityFeedbackAccessQueryKeys, assignmentQueryKeys, cardsQueryKeys, getCardFromCache, getSetFromCache, scoreQueryKeys, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useClearScore, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useGoogleClassroom, useOrganizationAccess, useScore, useSet, useSubmitAssignmentScore, useSubmitPracticeScore, useUpdateCardScore, useUpdateScore, useUpdateStudentVocab, useUserPlan };
|