@speakableio/core 0.1.21 → 0.1.22

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 CHANGED
@@ -2,10 +2,12 @@ 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 * as firebase_firestore from 'firebase/firestore';
5
6
  import { Firestore, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
6
7
  import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
7
8
 
8
9
  type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
10
+ type FirestoreHelpers = typeof firebase_firestore;
9
11
  type CustomTimestamp = Timestamp | Timestamp$1;
10
12
  type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
11
13
 
@@ -728,13 +730,13 @@ declare const useCreateNotification: () => {
728
730
  createNotification: (type: SpeakableNotificationType, data: any) => Promise<any>;
729
731
  };
730
732
 
731
- type FsClient = ReturnType<typeof createFsClient>;
732
- declare function createFsClient({ db, platform, httpsCallable, logEvent, }: {
733
+ type FsClient = ReturnType<typeof createFsClientBase>;
734
+ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
733
735
  db: FirebaseInstance;
734
- platform: 'web' | 'native';
736
+ helpers: FirestoreHelpers;
735
737
  httpsCallable: (name: string) => CallableFunction;
736
738
  logEvent: (name: string, data: any) => void;
737
- }): Promise<{
739
+ }): {
738
740
  assignmentRepo: {
739
741
  getAssignment: (params: {
740
742
  assignmentId: string;
@@ -909,7 +911,7 @@ declare function createFsClient({ db, platform, httpsCallable, logEvent, }: {
909
911
  cardId: string;
910
912
  }) => Promise<CardActivityWithId | null>;
911
913
  };
912
- }>;
914
+ };
913
915
 
914
916
  interface UserProfile {
915
917
  googleClassroomUserId: string;
@@ -970,15 +972,12 @@ interface FsContext {
970
972
  permissions: Permissions;
971
973
  }
972
974
  declare const FsCtx: React.Context<FsContext | null>;
973
- declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, httpsCallable, logEvent, }: {
975
+ declare function SpeakableProvider({ user, children, queryClient, permissions, fsClient, }: {
974
976
  children: React.ReactNode;
975
- user: User;
976
- db: FirebaseInstance;
977
- platform: 'web' | 'native';
978
- queryClient: QueryClient;
977
+ fsClient: FsClient;
979
978
  permissions: Permissions;
980
- httpsCallable: (name: string) => CallableFunction;
981
- logEvent: (name: string, data: any) => void;
979
+ queryClient: QueryClient;
980
+ user: User;
982
981
  }): react_jsx_runtime.JSX.Element | null;
983
982
  declare function useSpeakableApi(): FsContext;
984
983
 
@@ -1112,4 +1111,4 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1112
1111
  };
1113
1112
  };
1114
1113
 
1115
- 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, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };
1114
+ 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, createFsClientBase, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };
package/dist/index.d.ts CHANGED
@@ -2,10 +2,12 @@ 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 * as firebase_firestore from 'firebase/firestore';
5
6
  import { Firestore, Timestamp as Timestamp$1, FieldValue } from 'firebase/firestore';
6
7
  import { FirebaseFirestoreTypes, Timestamp } from '@react-native-firebase/firestore';
7
8
 
8
9
  type FirebaseInstance = FirebaseFirestoreTypes.Module | Firestore;
10
+ type FirestoreHelpers = typeof firebase_firestore;
9
11
  type CustomTimestamp = Timestamp | Timestamp$1;
10
12
  type CallableFunction<T = any, R = any> = (data: T) => Promise<R>;
11
13
 
@@ -728,13 +730,13 @@ declare const useCreateNotification: () => {
728
730
  createNotification: (type: SpeakableNotificationType, data: any) => Promise<any>;
729
731
  };
730
732
 
731
- type FsClient = ReturnType<typeof createFsClient>;
732
- declare function createFsClient({ db, platform, httpsCallable, logEvent, }: {
733
+ type FsClient = ReturnType<typeof createFsClientBase>;
734
+ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
733
735
  db: FirebaseInstance;
734
- platform: 'web' | 'native';
736
+ helpers: FirestoreHelpers;
735
737
  httpsCallable: (name: string) => CallableFunction;
736
738
  logEvent: (name: string, data: any) => void;
737
- }): Promise<{
739
+ }): {
738
740
  assignmentRepo: {
739
741
  getAssignment: (params: {
740
742
  assignmentId: string;
@@ -909,7 +911,7 @@ declare function createFsClient({ db, platform, httpsCallable, logEvent, }: {
909
911
  cardId: string;
910
912
  }) => Promise<CardActivityWithId | null>;
911
913
  };
912
- }>;
914
+ };
913
915
 
914
916
  interface UserProfile {
915
917
  googleClassroomUserId: string;
@@ -970,15 +972,12 @@ interface FsContext {
970
972
  permissions: Permissions;
971
973
  }
972
974
  declare const FsCtx: React.Context<FsContext | null>;
973
- declare function SpeakableProvider({ db, platform, children, queryClient, user, permissions, httpsCallable, logEvent, }: {
975
+ declare function SpeakableProvider({ user, children, queryClient, permissions, fsClient, }: {
974
976
  children: React.ReactNode;
975
- user: User;
976
- db: FirebaseInstance;
977
- platform: 'web' | 'native';
978
- queryClient: QueryClient;
977
+ fsClient: FsClient;
979
978
  permissions: Permissions;
980
- httpsCallable: (name: string) => CallableFunction;
981
- logEvent: (name: string, data: any) => void;
979
+ queryClient: QueryClient;
980
+ user: User;
982
981
  }): react_jsx_runtime.JSX.Element | null;
983
982
  declare function useSpeakableApi(): FsContext;
984
983
 
@@ -1112,4 +1111,4 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1112
1111
  };
1113
1112
  };
1114
1113
 
1115
- 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, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };
1114
+ 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, createFsClientBase, createSetRepo, getCardFromCache, getSetFromCache, refsCardsFiresotre, refsSetsFirestore, setsQueryKeys, updateCardInCache, updateSetInCache, useActivity, useAssignment, useCards, useCreateCard, useCreateCards, useCreateNotification, useSet, useSpeakableApi };