@speakableio/core 0.1.57 → 0.1.58
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.native.d.mts +4 -1
- package/dist/index.native.mjs +19 -11
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +4 -1
- package/dist/index.web.js +19 -11
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.native.d.mts
CHANGED
|
@@ -582,6 +582,9 @@ declare function updateCardInCache({ cardId, card, queryClient, }: {
|
|
|
582
582
|
card: CardActivityWithId | null;
|
|
583
583
|
queryClient: QueryClient;
|
|
584
584
|
}): void;
|
|
585
|
+
declare function useGetCard({ cardId }: {
|
|
586
|
+
cardId: string;
|
|
587
|
+
}): _tanstack_react_query.UseQueryResult<CardActivityWithId | null, Error>;
|
|
585
588
|
|
|
586
589
|
declare const createCardRepo: () => {
|
|
587
590
|
createCard: (args_0: {
|
|
@@ -2595,4 +2598,4 @@ declare const createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
|
|
|
2595
2598
|
};
|
|
2596
2599
|
};
|
|
2597
2600
|
|
|
2598
|
-
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, type CreditContract, FeedbackTypesCard, FsCtx, type InstitutionSubscription, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, type Organization, type OrganizationAccess, 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, cleanString, createAssignmentRepo, createCardRepo, createFsClientNative as createFsClient, createSetRepo, creditQueryKeys, debounce, getCardFromCache, getRespondCardTool, getSetFromCache, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useCreateCard, useCreateCards, useCreateNotification, useOrganizationAccess, useSet, useSpeakableApi, useUserCredits };
|
|
2601
|
+
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, type CreditContract, FeedbackTypesCard, FsCtx, type InstitutionSubscription, LENIENCY_OPTIONS, LeniencyCard, MULTIPLE_CHOICE_CARD_ACTIVITY_TYPES, type Organization, type OrganizationAccess, 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, cleanString, createAssignmentRepo, createCardRepo, createFsClientNative as createFsClient, createSetRepo, creditQueryKeys, debounce, getCardFromCache, getRespondCardTool, getSetFromCache, getWordHash, purify, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useActivityFeedbackAccess, useAssignment, useBaseOpenAI, useCards, useCreateCard, useCreateCards, useCreateNotification, useGetCard, useOrganizationAccess, useSet, useSpeakableApi, useUserCredits };
|
package/dist/index.native.mjs
CHANGED
|
@@ -364,7 +364,7 @@ function useAssignment({
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
// src/domains/cards/card.hooks.ts
|
|
367
|
-
import { useMutation, useQueries } from "@tanstack/react-query";
|
|
367
|
+
import { useMutation, useQueries, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
368
368
|
import { useMemo } from "react";
|
|
369
369
|
|
|
370
370
|
// src/domains/cards/card.constants.ts
|
|
@@ -689,6 +689,13 @@ function updateCardInCache({
|
|
|
689
689
|
}) {
|
|
690
690
|
queryClient.setQueryData(cardsQueryKeys.one({ cardId }), card);
|
|
691
691
|
}
|
|
692
|
+
function useGetCard({ cardId }) {
|
|
693
|
+
const query2 = useQuery2({
|
|
694
|
+
queryKey: cardsQueryKeys.one({ cardId }),
|
|
695
|
+
queryFn: () => getCard({ cardId })
|
|
696
|
+
});
|
|
697
|
+
return query2;
|
|
698
|
+
}
|
|
692
699
|
|
|
693
700
|
// src/domains/cards/card.repo.ts
|
|
694
701
|
var createCardRepo = () => {
|
|
@@ -700,7 +707,7 @@ var createCardRepo = () => {
|
|
|
700
707
|
};
|
|
701
708
|
|
|
702
709
|
// src/domains/sets/set.hooks.ts
|
|
703
|
-
import { useQuery as
|
|
710
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
704
711
|
|
|
705
712
|
// src/domains/sets/set.constants.ts
|
|
706
713
|
var SETS_COLLECTION = "sets";
|
|
@@ -722,7 +729,7 @@ var setsQueryKeys = {
|
|
|
722
729
|
one: (params) => [...setsQueryKeys.all, params.setId]
|
|
723
730
|
};
|
|
724
731
|
var useSet = ({ setId, enabled }) => {
|
|
725
|
-
return
|
|
732
|
+
return useQuery3({
|
|
726
733
|
queryKey: setsQueryKeys.one({ setId }),
|
|
727
734
|
queryFn: () => getSet({ setId }),
|
|
728
735
|
enabled: setId !== void 0 && setId !== "" && enabled
|
|
@@ -1209,7 +1216,7 @@ function debounce(func, waitFor) {
|
|
|
1209
1216
|
}
|
|
1210
1217
|
|
|
1211
1218
|
// src/domains/assignment/hooks/score-hooks.ts
|
|
1212
|
-
import { useMutation as useMutation2, useQuery as
|
|
1219
|
+
import { useMutation as useMutation2, useQuery as useQuery4 } from "@tanstack/react-query";
|
|
1213
1220
|
|
|
1214
1221
|
// src/lib/tanstack/handle-optimistic-update-query.ts
|
|
1215
1222
|
var handleOptimisticUpdate = async ({
|
|
@@ -1861,7 +1868,7 @@ function useScore({
|
|
|
1861
1868
|
enabled = true,
|
|
1862
1869
|
googleClassroomUserId
|
|
1863
1870
|
}) {
|
|
1864
|
-
return
|
|
1871
|
+
return useQuery4({
|
|
1865
1872
|
queryFn: () => getScore({
|
|
1866
1873
|
userId,
|
|
1867
1874
|
courseId,
|
|
@@ -2444,7 +2451,7 @@ var submitLTIScore = async ({
|
|
|
2444
2451
|
};
|
|
2445
2452
|
|
|
2446
2453
|
// src/hooks/useCredits.ts
|
|
2447
|
-
import { useQuery as
|
|
2454
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
2448
2455
|
var creditQueryKeys = {
|
|
2449
2456
|
userCredits: (uid) => ["userCredits", uid]
|
|
2450
2457
|
};
|
|
@@ -2452,7 +2459,7 @@ var useUserCredits = () => {
|
|
|
2452
2459
|
const { user } = useSpeakableApi();
|
|
2453
2460
|
const email = user.auth.email;
|
|
2454
2461
|
const uid = user.auth.uid;
|
|
2455
|
-
const query2 =
|
|
2462
|
+
const query2 = useQuery5({
|
|
2456
2463
|
queryKey: creditQueryKeys.userCredits(uid),
|
|
2457
2464
|
queryFn: () => fetchUserCredits({ uid, email }),
|
|
2458
2465
|
enabled: !!uid,
|
|
@@ -2502,11 +2509,11 @@ var fetchUserCredits = async ({ uid, email }) => {
|
|
|
2502
2509
|
};
|
|
2503
2510
|
|
|
2504
2511
|
// src/hooks/useOrganizationAccess.ts
|
|
2505
|
-
import { useQuery as
|
|
2512
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
2506
2513
|
var useOrganizationAccess = () => {
|
|
2507
2514
|
const { user } = useSpeakableApi();
|
|
2508
2515
|
const email = user.auth.email;
|
|
2509
|
-
const query2 =
|
|
2516
|
+
const query2 = useQuery6({
|
|
2510
2517
|
queryKey: ["organizationAccess", email],
|
|
2511
2518
|
queryFn: async () => {
|
|
2512
2519
|
if (!email) {
|
|
@@ -2594,7 +2601,7 @@ var getOrganizationAccess = async (email) => {
|
|
|
2594
2601
|
};
|
|
2595
2602
|
|
|
2596
2603
|
// src/hooks/useActivityFeedbackAccess.ts
|
|
2597
|
-
import { useQuery as
|
|
2604
|
+
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
2598
2605
|
var activityFeedbackAccessQueryKeys = {
|
|
2599
2606
|
activityFeedbackAccess: (args) => ["activityFeedbackAccess", ...Object.values(args)]
|
|
2600
2607
|
};
|
|
@@ -2608,7 +2615,7 @@ var useActivityFeedbackAccess = ({
|
|
|
2608
2615
|
const isTeacher = (_a = user.profile) == null ? void 0 : _a.isTeacher;
|
|
2609
2616
|
const isStudent = (_b = user.profile) == null ? void 0 : _b.isStudent;
|
|
2610
2617
|
const userRoles = ((_c = user.profile) == null ? void 0 : _c.roles) || [];
|
|
2611
|
-
const query2 =
|
|
2618
|
+
const query2 = useQuery7({
|
|
2612
2619
|
queryKey: activityFeedbackAccessQueryKeys.activityFeedbackAccess({
|
|
2613
2620
|
aiEnabled,
|
|
2614
2621
|
isActivityRoute
|
|
@@ -3031,6 +3038,7 @@ export {
|
|
|
3031
3038
|
useCreateCard,
|
|
3032
3039
|
useCreateCards,
|
|
3033
3040
|
useCreateNotification,
|
|
3041
|
+
useGetCard,
|
|
3034
3042
|
useOrganizationAccess,
|
|
3035
3043
|
useSet,
|
|
3036
3044
|
useSpeakableApi,
|