@speakableio/core 0.1.3 → 0.1.5
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.mts +6 -101
- package/dist/index.d.ts +6 -101
- package/dist/index.js +8 -10
- package/dist/index.mjs +6 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,14 +4,14 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
5
|
import { FirebaseFunctionsTypes } from '@react-native-firebase/functions';
|
|
6
6
|
import { Functions } from 'firebase/functions';
|
|
7
|
-
import { Firestore, Timestamp as Timestamp$
|
|
8
|
-
import { FirebaseFirestoreTypes, Timestamp
|
|
7
|
+
import { Firestore, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
|
|
8
|
+
import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
|
|
9
9
|
import * as _firebase_functions from '@firebase/functions';
|
|
10
10
|
|
|
11
11
|
type FirebaseInstance = (FirebaseFirestoreTypes.Module | Firestore) & {
|
|
12
12
|
functions: FirebaseFunctions;
|
|
13
13
|
};
|
|
14
|
-
type CustomTimestamp = Timestamp
|
|
14
|
+
type CustomTimestamp = Timestamp | Timestamp$1;
|
|
15
15
|
type FirebaseFunctions = Functions | FirebaseFunctionsTypes.Module;
|
|
16
16
|
|
|
17
17
|
interface Assignment {
|
|
@@ -918,99 +918,17 @@ declare function createFsClient({ db, platform, functions, }: {
|
|
|
918
918
|
};
|
|
919
919
|
}>;
|
|
920
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
921
|
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
922
|
image: {
|
|
969
923
|
url: string;
|
|
970
924
|
path: string;
|
|
971
925
|
};
|
|
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
926
|
displayName: string;
|
|
997
|
-
owners: string[];
|
|
998
|
-
additionalNativeLanguages: string[];
|
|
999
|
-
dateMade: Timestamp;
|
|
1000
|
-
schoolName: string;
|
|
1001
|
-
loaded: boolean;
|
|
1002
|
-
loading: boolean;
|
|
1003
|
-
isTeacher: boolean;
|
|
1004
927
|
}
|
|
1005
928
|
interface UserAuth {
|
|
1006
929
|
uid: string;
|
|
1007
930
|
email: string;
|
|
1008
931
|
displayName: string | null;
|
|
1009
|
-
custom_claims: FirebaseCustomClaims;
|
|
1010
|
-
createdAt: string;
|
|
1011
|
-
lastLogin: string;
|
|
1012
|
-
loaded: boolean;
|
|
1013
|
-
loading: boolean;
|
|
1014
932
|
}
|
|
1015
933
|
interface Lti {
|
|
1016
934
|
data: {
|
|
@@ -1023,12 +941,7 @@ interface User {
|
|
|
1023
941
|
profile: UserProfile;
|
|
1024
942
|
auth: UserAuth;
|
|
1025
943
|
lti: Lti;
|
|
1026
|
-
authLoaded: boolean;
|
|
1027
|
-
profileLoaded: boolean;
|
|
1028
944
|
roles: string[];
|
|
1029
|
-
loadingRoles: boolean;
|
|
1030
|
-
drawerOpen: boolean;
|
|
1031
|
-
mobileOpen: boolean;
|
|
1032
945
|
}
|
|
1033
946
|
|
|
1034
947
|
declare const SpeakablePlanTypes: {
|
|
@@ -1061,25 +974,17 @@ interface FsContext {
|
|
|
1061
974
|
queryClient: QueryClient;
|
|
1062
975
|
user: User;
|
|
1063
976
|
permissions: Permissions;
|
|
1064
|
-
|
|
1065
|
-
localStorage: {
|
|
1066
|
-
setItem: (key: string, value: string) => void;
|
|
1067
|
-
getItem: (key: string) => string | null;
|
|
1068
|
-
};
|
|
977
|
+
functions: FirebaseFunctions;
|
|
1069
978
|
}
|
|
1070
979
|
declare const FsCtx: React.Context<FsContext | null>;
|
|
1071
|
-
declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions,
|
|
980
|
+
declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, functions, }: {
|
|
1072
981
|
db: FirebaseInstance;
|
|
1073
|
-
|
|
982
|
+
functions: FirebaseFunctions;
|
|
1074
983
|
platform: 'web' | 'native';
|
|
1075
984
|
children: React.ReactNode;
|
|
1076
985
|
queryClient: QueryClient;
|
|
1077
986
|
user: User;
|
|
1078
987
|
permissions: Permissions;
|
|
1079
|
-
localStorage: {
|
|
1080
|
-
setItem: (key: string, value: string) => void;
|
|
1081
|
-
getItem: (key: string) => string | null;
|
|
1082
|
-
};
|
|
1083
988
|
}): react_jsx_runtime.JSX.Element | null;
|
|
1084
989
|
declare function useSpeakableApi(): FsContext;
|
|
1085
990
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
4
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
5
|
import { FirebaseFunctionsTypes } from '@react-native-firebase/functions';
|
|
6
6
|
import { Functions } from 'firebase/functions';
|
|
7
|
-
import { Firestore, Timestamp as Timestamp$
|
|
8
|
-
import { FirebaseFirestoreTypes, Timestamp
|
|
7
|
+
import { Firestore, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
|
|
8
|
+
import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
|
|
9
9
|
import * as _firebase_functions from '@firebase/functions';
|
|
10
10
|
|
|
11
11
|
type FirebaseInstance = (FirebaseFirestoreTypes.Module | Firestore) & {
|
|
12
12
|
functions: FirebaseFunctions;
|
|
13
13
|
};
|
|
14
|
-
type CustomTimestamp = Timestamp
|
|
14
|
+
type CustomTimestamp = Timestamp | Timestamp$1;
|
|
15
15
|
type FirebaseFunctions = Functions | FirebaseFunctionsTypes.Module;
|
|
16
16
|
|
|
17
17
|
interface Assignment {
|
|
@@ -918,99 +918,17 @@ declare function createFsClient({ db, platform, functions, }: {
|
|
|
918
918
|
};
|
|
919
919
|
}>;
|
|
920
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
921
|
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
922
|
image: {
|
|
969
923
|
url: string;
|
|
970
924
|
path: string;
|
|
971
925
|
};
|
|
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
926
|
displayName: string;
|
|
997
|
-
owners: string[];
|
|
998
|
-
additionalNativeLanguages: string[];
|
|
999
|
-
dateMade: Timestamp;
|
|
1000
|
-
schoolName: string;
|
|
1001
|
-
loaded: boolean;
|
|
1002
|
-
loading: boolean;
|
|
1003
|
-
isTeacher: boolean;
|
|
1004
927
|
}
|
|
1005
928
|
interface UserAuth {
|
|
1006
929
|
uid: string;
|
|
1007
930
|
email: string;
|
|
1008
931
|
displayName: string | null;
|
|
1009
|
-
custom_claims: FirebaseCustomClaims;
|
|
1010
|
-
createdAt: string;
|
|
1011
|
-
lastLogin: string;
|
|
1012
|
-
loaded: boolean;
|
|
1013
|
-
loading: boolean;
|
|
1014
932
|
}
|
|
1015
933
|
interface Lti {
|
|
1016
934
|
data: {
|
|
@@ -1023,12 +941,7 @@ interface User {
|
|
|
1023
941
|
profile: UserProfile;
|
|
1024
942
|
auth: UserAuth;
|
|
1025
943
|
lti: Lti;
|
|
1026
|
-
authLoaded: boolean;
|
|
1027
|
-
profileLoaded: boolean;
|
|
1028
944
|
roles: string[];
|
|
1029
|
-
loadingRoles: boolean;
|
|
1030
|
-
drawerOpen: boolean;
|
|
1031
|
-
mobileOpen: boolean;
|
|
1032
945
|
}
|
|
1033
946
|
|
|
1034
947
|
declare const SpeakablePlanTypes: {
|
|
@@ -1061,25 +974,17 @@ interface FsContext {
|
|
|
1061
974
|
queryClient: QueryClient;
|
|
1062
975
|
user: User;
|
|
1063
976
|
permissions: Permissions;
|
|
1064
|
-
|
|
1065
|
-
localStorage: {
|
|
1066
|
-
setItem: (key: string, value: string) => void;
|
|
1067
|
-
getItem: (key: string) => string | null;
|
|
1068
|
-
};
|
|
977
|
+
functions: FirebaseFunctions;
|
|
1069
978
|
}
|
|
1070
979
|
declare const FsCtx: React.Context<FsContext | null>;
|
|
1071
|
-
declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions,
|
|
980
|
+
declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, functions, }: {
|
|
1072
981
|
db: FirebaseInstance;
|
|
1073
|
-
|
|
982
|
+
functions: FirebaseFunctions;
|
|
1074
983
|
platform: 'web' | 'native';
|
|
1075
984
|
children: React.ReactNode;
|
|
1076
985
|
queryClient: QueryClient;
|
|
1077
986
|
user: User;
|
|
1078
987
|
permissions: Permissions;
|
|
1079
|
-
localStorage: {
|
|
1080
|
-
setItem: (key: string, value: string) => void;
|
|
1081
|
-
getItem: (key: string) => string | null;
|
|
1082
|
-
};
|
|
1083
988
|
}): react_jsx_runtime.JSX.Element | null;
|
|
1084
989
|
declare function useSpeakableApi(): FsContext;
|
|
1085
990
|
|
package/dist/index.js
CHANGED
|
@@ -896,12 +896,12 @@ var useCreateNotification = () => {
|
|
|
896
896
|
const handleCreateNotifications = async (type, data) => {
|
|
897
897
|
const result = await createNotification({
|
|
898
898
|
type,
|
|
899
|
-
userId:
|
|
900
|
-
profile: _nullishCoalesce(_optionalChain([user, 'optionalAccess',
|
|
899
|
+
userId: user.auth.uid,
|
|
900
|
+
profile: _nullishCoalesce(_optionalChain([user, 'optionalAccess', _12 => _12.profile]), () => ( {})),
|
|
901
901
|
data
|
|
902
902
|
});
|
|
903
903
|
queryClient.invalidateQueries({
|
|
904
|
-
queryKey: notificationQueryKeys.byId(_nullishCoalesce(_optionalChain([user, 'optionalAccess',
|
|
904
|
+
queryKey: notificationQueryKeys.byId(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _13 => _13.auth, 'access', _14 => _14.uid]), () => ( "")))
|
|
905
905
|
});
|
|
906
906
|
return result;
|
|
907
907
|
};
|
|
@@ -943,19 +943,18 @@ function SpeakableProvider({
|
|
|
943
943
|
queryClient,
|
|
944
944
|
user,
|
|
945
945
|
permissions,
|
|
946
|
-
|
|
947
|
-
localStorage
|
|
946
|
+
functions
|
|
948
947
|
}) {
|
|
949
948
|
const [speakableApi, setSpeakableApi] = _react.useState.call(void 0, null);
|
|
950
949
|
_react.useEffect.call(void 0, () => {
|
|
951
950
|
createFsClient({
|
|
952
951
|
db,
|
|
953
|
-
|
|
954
|
-
|
|
952
|
+
functions,
|
|
953
|
+
platform
|
|
955
954
|
}).then((repos) => {
|
|
956
955
|
setSpeakableApi(repos);
|
|
957
956
|
});
|
|
958
|
-
}, [db,
|
|
957
|
+
}, [db, functions, platform]);
|
|
959
958
|
if (!speakableApi) return null;
|
|
960
959
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
961
960
|
FsCtx.Provider,
|
|
@@ -965,8 +964,7 @@ function SpeakableProvider({
|
|
|
965
964
|
queryClient,
|
|
966
965
|
user,
|
|
967
966
|
permissions,
|
|
968
|
-
|
|
969
|
-
localStorage
|
|
967
|
+
functions
|
|
970
968
|
},
|
|
971
969
|
children
|
|
972
970
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -896,7 +896,7 @@ var useCreateNotification = () => {
|
|
|
896
896
|
const handleCreateNotifications = async (type, data) => {
|
|
897
897
|
const result = await createNotification({
|
|
898
898
|
type,
|
|
899
|
-
userId: user
|
|
899
|
+
userId: user.auth.uid,
|
|
900
900
|
profile: user?.profile ?? {},
|
|
901
901
|
data
|
|
902
902
|
});
|
|
@@ -943,19 +943,18 @@ function SpeakableProvider({
|
|
|
943
943
|
queryClient,
|
|
944
944
|
user,
|
|
945
945
|
permissions,
|
|
946
|
-
|
|
947
|
-
localStorage
|
|
946
|
+
functions
|
|
948
947
|
}) {
|
|
949
948
|
const [speakableApi, setSpeakableApi] = useState(null);
|
|
950
949
|
useEffect(() => {
|
|
951
950
|
createFsClient({
|
|
952
951
|
db,
|
|
953
|
-
|
|
954
|
-
|
|
952
|
+
functions,
|
|
953
|
+
platform
|
|
955
954
|
}).then((repos) => {
|
|
956
955
|
setSpeakableApi(repos);
|
|
957
956
|
});
|
|
958
|
-
}, [db,
|
|
957
|
+
}, [db, functions, platform]);
|
|
959
958
|
if (!speakableApi) return null;
|
|
960
959
|
return /* @__PURE__ */ jsx(
|
|
961
960
|
FsCtx.Provider,
|
|
@@ -965,8 +964,7 @@ function SpeakableProvider({
|
|
|
965
964
|
queryClient,
|
|
966
965
|
user,
|
|
967
966
|
permissions,
|
|
968
|
-
|
|
969
|
-
localStorage
|
|
967
|
+
functions
|
|
970
968
|
},
|
|
971
969
|
children
|
|
972
970
|
}
|