@oaknational/google-classroom-addon 1.3.0 → 1.5.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.
@@ -1,5 +1,16 @@
1
1
  import { Firestore } from '@google-cloud/firestore';
2
2
 
3
+ type CreateAnnouncementAttachmentArgs = {
4
+ courseId: string;
5
+ itemId: string;
6
+ addOnToken: string;
7
+ title: string;
8
+ lessonSlug: string;
9
+ programeSlug: string;
10
+ unitSlug: string;
11
+ maxPoints?: number;
12
+ };
13
+
3
14
  type OakGoogleSignInCallback = {
4
15
  encryptedSession: string;
5
16
  profilePictureUrl?: string;
@@ -11,13 +22,14 @@ declare class OakGoogleClassroomAddOn {
11
22
  private readonly googleOAuthClientSecret;
12
23
  private readonly googleOAuthCallbackApiRoute;
13
24
  private readonly sessionSecret;
25
+ private readonly baseUrl;
14
26
  private encryptionService;
15
27
  private firestoreClient;
16
28
  private _googleOAuthClientId;
17
29
  private _googleOAuthClientSecret;
18
30
  private _googleOAuthCallbackApiRoute;
19
31
  private _sessionSecret;
20
- constructor(encryptionSecret: string, firestore: Firestore, googleOAuthClientId: string, googleOAuthClientSecret: string, googleOAuthCallbackApiRoute: string, sessionSecret: string);
32
+ constructor(encryptionSecret: string, firestore: Firestore, googleOAuthClientId: string, googleOAuthClientSecret: string, googleOAuthCallbackApiRoute: string, sessionSecret: string, baseUrl: string);
21
33
  private getOAuthClient;
22
34
  getGoogleSignInUrl(loginHint?: string, subscribeToNewsletter?: boolean): Promise<string>;
23
35
  handleGoogleSignInCallback(code: string, subscribeToNewsletterFn?: (email: string) => Promise<void>): Promise<OakGoogleSignInCallback>;
@@ -28,6 +40,7 @@ declare class OakGoogleClassroomAddOn {
28
40
  * Returns the encrypted session (original or refreshed) if valid.
29
41
  */
30
42
  verifyAuthSession(encryptedSession: string): Promise<string | null>;
43
+ createAttachment(args: CreateAnnouncementAttachmentArgs, accessToken?: string, refreshToken?: string): Promise<FirebaseFirestore.DocumentData | null | undefined>;
31
44
  }
32
45
 
33
46
  export { OakGoogleClassroomAddOn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oaknational/google-classroom-addon",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Components and helpers for the Oak Google Classroom Add-on",
5
5
  "exports": {
6
6
  "./ui": {
@@ -47,6 +47,7 @@
47
47
  },
48
48
  "homepage": "https://github.com/oaknational/google-classroom-addon#readme",
49
49
  "peerDependencies": {
50
+ "@googleapis/classroom": ">=11.0.0",
50
51
  "@google-cloud/firestore": ">=7.11.2",
51
52
  "@oaknational/oak-components": ">=1.165.0",
52
53
  "google-auth-library": ">=9.15.1",