@oaknational/google-classroom-addon 1.9.0 → 1.10.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.
@@ -79,5 +79,57 @@ declare class OakGoogleClassroomAddOn {
79
79
  } | null>;
80
80
  }
81
81
 
82
- export { OakGoogleClassroomAddOn };
83
- export type { OakGoogleSignInCallback };
82
+ declare enum ExceptionType {
83
+ GoogleOAuth = "google-oauth",
84
+ Firestore = "firestore",
85
+ Encryption = "encryption"
86
+ }
87
+ declare enum ErrorSeverity {
88
+ Error = "error",
89
+ Warning = "warning",
90
+ Info = "info"
91
+ }
92
+ interface ErrorContext {
93
+ operation: string;
94
+ service: ExceptionType;
95
+ userId?: string;
96
+ metadata?: Record<string, unknown>;
97
+ }
98
+ interface ErrorMapping {
99
+ userMessage: string;
100
+ internalMessage: string;
101
+ shouldRetry: boolean;
102
+ severity: ErrorSeverity;
103
+ }
104
+ interface OakGoogleClassroomExceptionLike {
105
+ name: string;
106
+ message: string;
107
+ type: ExceptionType;
108
+ code?: string;
109
+ severity: ErrorSeverity;
110
+ shouldRetry: boolean;
111
+ context?: ErrorContext;
112
+ originalError?: Error;
113
+ }
114
+
115
+ /**
116
+ * Custom exception for Oak Google Classroom Addon errors
117
+ */
118
+ declare class OakGoogleClassroomException extends Error {
119
+ type: ExceptionType;
120
+ code?: string;
121
+ shouldRetry: boolean;
122
+ severity: ErrorSeverity;
123
+ context?: ErrorContext;
124
+ originalError?: Error;
125
+ constructor(message: string, type: ExceptionType, options?: {
126
+ code?: string;
127
+ shouldRetry?: boolean;
128
+ severity?: ErrorSeverity;
129
+ context?: ErrorContext;
130
+ originalError?: Error;
131
+ });
132
+ }
133
+
134
+ export { ErrorSeverity, ExceptionType, OakGoogleClassroomAddOn, OakGoogleClassroomException };
135
+ export type { ErrorContext, ErrorMapping, OakGoogleClassroomExceptionLike, OakGoogleSignInCallback };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oaknational/google-classroom-addon",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Components and helpers for the Oak Google Classroom Add-on",
5
5
  "exports": {
6
6
  "./ui": {