@orjok/commons 1.0.2 → 1.2.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.
- package/dist/amplify.cjs +30 -5
- package/dist/amplify.cjs.map +1 -1
- package/dist/amplify.d.cts +5 -2
- package/dist/amplify.d.ts +5 -2
- package/dist/amplify.js +30 -5
- package/dist/amplify.js.map +1 -1
- package/dist/chunk-B4UJE3F4.js +529 -0
- package/dist/chunk-B4UJE3F4.js.map +1 -0
- package/dist/chunk-ODXD2WJN.cjs +529 -0
- package/dist/chunk-ODXD2WJN.cjs.map +1 -0
- package/dist/hooks.cjs +639 -2
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +162 -3
- package/dist/hooks.d.ts +162 -3
- package/dist/hooks.js +638 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +2454 -363
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +303 -15
- package/dist/index.d.ts +303 -15
- package/dist/index.js +2430 -339
- package/dist/index.js.map +1 -1
- package/dist/{client-BaOC79Nc.d.cts → notification-BoqtkNrc.d.ts} +392 -12
- package/dist/{client-Bm9aiyTx.d.ts → notification-Ctfy0m05.d.cts} +392 -12
- package/dist/{storage-DLqdJgQt.d.cts → storage-9pK8KwIM.d.cts} +4 -2
- package/dist/{storage-DLqdJgQt.d.ts → storage-9pK8KwIM.d.ts} +4 -2
- package/dist/testing.cjs +34 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +9 -2
- package/dist/testing.d.ts +9 -2
- package/dist/testing.js +34 -3
- package/dist/testing.js.map +1 -1
- package/package.json +6 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NetworkProvider, S as StorageProvider, A as AuthProvider } from './storage-
|
|
1
|
+
import { N as NetworkProvider, S as StorageProvider, A as AuthProvider } from './storage-9pK8KwIM.js';
|
|
2
2
|
|
|
3
3
|
interface CreateQuestionInput {
|
|
4
4
|
question: string;
|
|
@@ -6,6 +6,7 @@ interface CreateQuestionInput {
|
|
|
6
6
|
options: string;
|
|
7
7
|
language: string;
|
|
8
8
|
level: string;
|
|
9
|
+
publicExam?: string;
|
|
9
10
|
difficulty: string;
|
|
10
11
|
type?: string;
|
|
11
12
|
explanation?: string;
|
|
@@ -24,6 +25,7 @@ interface CreateQuestionInput {
|
|
|
24
25
|
interface CreatePackInput {
|
|
25
26
|
name: string;
|
|
26
27
|
level: string;
|
|
28
|
+
publicExam?: string;
|
|
27
29
|
language: string;
|
|
28
30
|
difficulty: string;
|
|
29
31
|
automaticNumbering?: boolean;
|
|
@@ -141,6 +143,17 @@ interface ListByCurriculumInput {
|
|
|
141
143
|
sortDirection?: "ASC" | "DESC";
|
|
142
144
|
language?: string;
|
|
143
145
|
difficulty?: string;
|
|
146
|
+
publicExam?: string;
|
|
147
|
+
questionType?: string;
|
|
148
|
+
}
|
|
149
|
+
interface ListByPublicExamInput {
|
|
150
|
+
publicExam: string;
|
|
151
|
+
limit?: number;
|
|
152
|
+
nextToken?: string | null;
|
|
153
|
+
sortDirection?: "ASC" | "DESC";
|
|
154
|
+
language?: string;
|
|
155
|
+
difficulty?: string;
|
|
156
|
+
questionType?: string;
|
|
144
157
|
}
|
|
145
158
|
interface ListByRandomHashInput {
|
|
146
159
|
id: string;
|
|
@@ -155,15 +168,130 @@ interface ListByRandomHashInput {
|
|
|
155
168
|
}
|
|
156
169
|
interface UpdateUserAvatarInput {
|
|
157
170
|
userId: string;
|
|
158
|
-
avatarUrl
|
|
159
|
-
avatarConfig
|
|
171
|
+
avatarUrl?: string | null;
|
|
172
|
+
avatarConfig?: string | null;
|
|
173
|
+
}
|
|
174
|
+
interface CreateAnnouncementInput {
|
|
175
|
+
title: string;
|
|
176
|
+
message: string;
|
|
177
|
+
senderType?: "ORJOK" | "ADMIN" | string;
|
|
178
|
+
senderName?: string | null;
|
|
179
|
+
senderAvatar?: string | null;
|
|
180
|
+
category?: string | null;
|
|
181
|
+
actionUrl?: string | null;
|
|
182
|
+
priority?: "NORMAL" | "HIGH" | string | null;
|
|
183
|
+
}
|
|
184
|
+
interface CreateUserNotificationInput {
|
|
185
|
+
userId: string;
|
|
186
|
+
title: string;
|
|
187
|
+
message: string;
|
|
188
|
+
type?: "LEVEL_UP" | "DIRECT" | "SYSTEM" | "ACHIEVEMENT" | string | null;
|
|
189
|
+
senderType?: "SYSTEM" | "ORJOK" | "ADMIN" | string | null;
|
|
190
|
+
senderName?: string | null;
|
|
191
|
+
senderAvatar?: string | null;
|
|
192
|
+
actionUrl?: string | null;
|
|
193
|
+
metadata?: string | null;
|
|
194
|
+
}
|
|
195
|
+
interface UpdateUserNotificationInput {
|
|
196
|
+
id: string;
|
|
197
|
+
isRead?: boolean | null;
|
|
198
|
+
readAt?: string | null;
|
|
199
|
+
}
|
|
200
|
+
interface ListByLevelInput {
|
|
201
|
+
level: string;
|
|
202
|
+
limit?: number;
|
|
203
|
+
nextToken?: string | null;
|
|
204
|
+
sortDirection?: "ASC" | "DESC";
|
|
205
|
+
language?: string;
|
|
206
|
+
difficulty?: string;
|
|
207
|
+
publicExam?: string;
|
|
208
|
+
questionType?: string;
|
|
209
|
+
}
|
|
210
|
+
interface CreatePackGroupInput {
|
|
211
|
+
name: string;
|
|
212
|
+
description?: string;
|
|
213
|
+
imageUrl?: string;
|
|
214
|
+
type?: string;
|
|
215
|
+
level?: string;
|
|
216
|
+
order?: number;
|
|
217
|
+
packIds?: string[];
|
|
218
|
+
}
|
|
219
|
+
interface ListPackGroupsInput {
|
|
220
|
+
type?: string;
|
|
221
|
+
level?: string;
|
|
222
|
+
limit?: number;
|
|
223
|
+
nextToken?: string | null;
|
|
224
|
+
sortDirection?: "ASC" | "DESC";
|
|
225
|
+
}
|
|
226
|
+
interface UpdateUserProfileInput {
|
|
227
|
+
id: string;
|
|
228
|
+
fullName?: string;
|
|
229
|
+
phoneNumber?: string | null;
|
|
230
|
+
tier?: string | null;
|
|
231
|
+
subscriptionExpiresAt?: string | null;
|
|
232
|
+
aiEvaluationRemaining?: number | null;
|
|
233
|
+
aiQuestionGenRemaining?: number | null;
|
|
234
|
+
xp?: number | null;
|
|
235
|
+
userLevel?: number | null;
|
|
236
|
+
avatarUrl?: string | null;
|
|
237
|
+
avatarConfig?: string | null;
|
|
238
|
+
}
|
|
239
|
+
interface ListUsersInput {
|
|
240
|
+
filter?: Record<string, unknown>;
|
|
241
|
+
limit?: number;
|
|
242
|
+
nextToken?: string | null;
|
|
243
|
+
}
|
|
244
|
+
interface CreateSubscriptionRequestInput {
|
|
245
|
+
userId: string;
|
|
246
|
+
userFullName?: string;
|
|
247
|
+
userEmail?: string;
|
|
248
|
+
itemType: string;
|
|
249
|
+
itemId: string;
|
|
250
|
+
itemTitle: string;
|
|
251
|
+
amount: number;
|
|
252
|
+
billingCycle?: string;
|
|
253
|
+
paymentMethod: string;
|
|
254
|
+
senderPhone: string;
|
|
255
|
+
contactPhone: string;
|
|
256
|
+
trxId: string;
|
|
257
|
+
status?: string;
|
|
258
|
+
aiEvals?: number;
|
|
259
|
+
aiQuestions?: number;
|
|
260
|
+
adminNotes?: string;
|
|
261
|
+
}
|
|
262
|
+
interface UpdateSubscriptionRequestInput {
|
|
263
|
+
id: string;
|
|
264
|
+
status?: string;
|
|
265
|
+
adminNotes?: string;
|
|
266
|
+
processedAt?: string;
|
|
267
|
+
processedBy?: string;
|
|
268
|
+
aiEvals?: number;
|
|
269
|
+
aiQuestions?: number;
|
|
270
|
+
}
|
|
271
|
+
interface ListSubscriptionRequestsInput {
|
|
272
|
+
status?: string;
|
|
273
|
+
userId?: string;
|
|
274
|
+
limit?: number;
|
|
275
|
+
nextToken?: string | null;
|
|
276
|
+
sortDirection?: "ASC" | "DESC";
|
|
277
|
+
filter?: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
interface UploadCourseItemInput {
|
|
280
|
+
courseId: string;
|
|
281
|
+
fileName: string;
|
|
282
|
+
fileType: string;
|
|
283
|
+
fileData?: ArrayBuffer | Blob | Uint8Array | string;
|
|
284
|
+
parentId?: string | null;
|
|
285
|
+
itemOrder: number;
|
|
286
|
+
itemName?: string;
|
|
160
287
|
}
|
|
161
288
|
|
|
162
|
-
type Tier = "FREE" | "
|
|
289
|
+
type Tier = "FREE" | "PRO" | "PRO_AI";
|
|
290
|
+
type PaymentMethod = "BKASH" | "ROCKET" | "NAGAD" | "CARD" | "OTHER";
|
|
163
291
|
type QuestionType = "MCQ" | "WRITTEN";
|
|
164
292
|
type Difficulty = "Easy" | "Medium" | "Hard";
|
|
165
|
-
type Level = "
|
|
166
|
-
type Language = "Bangla" | "English";
|
|
293
|
+
type Level = "One" | "Two" | "Three" | "Four" | "Five" | "Six" | "Seven" | "Eight" | "SSC" | "HSC" | "Admission" | "HSC+Admission" | "BCS";
|
|
294
|
+
type Language = "Bangla" | "English" | "Any";
|
|
167
295
|
type VoteType = "upvote" | "downvote";
|
|
168
296
|
type ModelType = "question" | "pack";
|
|
169
297
|
type VerificationType = "question" | "pack";
|
|
@@ -184,6 +312,7 @@ interface User {
|
|
|
184
312
|
tier?: Tier | null;
|
|
185
313
|
subscriptionExpiresAt?: string | null;
|
|
186
314
|
aiEvaluationRemaining?: number | null;
|
|
315
|
+
aiQuestionGenRemaining?: number | null;
|
|
187
316
|
questionCount?: number | null;
|
|
188
317
|
packCount?: number | null;
|
|
189
318
|
contestCount?: number | null;
|
|
@@ -202,6 +331,11 @@ interface User {
|
|
|
202
331
|
hscMathRating?: number | null;
|
|
203
332
|
hscBiologyRating?: number | null;
|
|
204
333
|
bcsOverallRating?: number | null;
|
|
334
|
+
xp?: number | null;
|
|
335
|
+
userLevel?: number | null;
|
|
336
|
+
lastReadAnnouncementAt?: string | null;
|
|
337
|
+
fcmToken?: string | null;
|
|
338
|
+
apnsToken?: string | null;
|
|
205
339
|
}
|
|
206
340
|
interface Option {
|
|
207
341
|
id: string;
|
|
@@ -220,6 +354,7 @@ interface QuestionObject {
|
|
|
220
354
|
imageUrl?: string | null;
|
|
221
355
|
language: string;
|
|
222
356
|
level: string;
|
|
357
|
+
publicExam?: string | null;
|
|
223
358
|
difficulty?: string | null;
|
|
224
359
|
type?: QuestionType | null;
|
|
225
360
|
markingInstructions?: string | null;
|
|
@@ -246,6 +381,7 @@ interface Pack {
|
|
|
246
381
|
name?: string | null;
|
|
247
382
|
language: string;
|
|
248
383
|
level: string;
|
|
384
|
+
publicExam?: string | null;
|
|
249
385
|
difficulty?: string | null;
|
|
250
386
|
questionCount?: number | null;
|
|
251
387
|
automaticNumbering: boolean;
|
|
@@ -458,6 +594,29 @@ interface PackGroup {
|
|
|
458
594
|
order: number;
|
|
459
595
|
packs?: PaginatedList<Pack> | null;
|
|
460
596
|
}
|
|
597
|
+
interface SubscriptionRequest {
|
|
598
|
+
id: string;
|
|
599
|
+
userId: string;
|
|
600
|
+
userFullName?: string | null;
|
|
601
|
+
userEmail?: string | null;
|
|
602
|
+
itemType: string;
|
|
603
|
+
itemId: string;
|
|
604
|
+
itemTitle: string;
|
|
605
|
+
amount: number;
|
|
606
|
+
billingCycle?: string | null;
|
|
607
|
+
paymentMethod: string;
|
|
608
|
+
senderPhone: string;
|
|
609
|
+
contactPhone: string;
|
|
610
|
+
trxId: string;
|
|
611
|
+
status?: string | null;
|
|
612
|
+
aiEvals?: number | null;
|
|
613
|
+
aiQuestions?: number | null;
|
|
614
|
+
adminNotes?: string | null;
|
|
615
|
+
processedAt?: string | null;
|
|
616
|
+
processedBy?: string | null;
|
|
617
|
+
createdAt?: string | null;
|
|
618
|
+
updatedAt?: string | null;
|
|
619
|
+
}
|
|
461
620
|
interface PaymentTransaction {
|
|
462
621
|
id: string;
|
|
463
622
|
userId: string;
|
|
@@ -467,6 +626,7 @@ interface PaymentTransaction {
|
|
|
467
626
|
trxId: string;
|
|
468
627
|
status?: PaymentStatus | null;
|
|
469
628
|
tierSelected: string;
|
|
629
|
+
senderPhone?: string | null;
|
|
470
630
|
}
|
|
471
631
|
interface AIUsageLog {
|
|
472
632
|
id: string;
|
|
@@ -529,16 +689,47 @@ interface NewsArticle {
|
|
|
529
689
|
createdAt?: string | null;
|
|
530
690
|
updatedAt?: string | null;
|
|
531
691
|
}
|
|
692
|
+
interface Announcement {
|
|
693
|
+
id: string;
|
|
694
|
+
title: string;
|
|
695
|
+
message: string;
|
|
696
|
+
senderType: "ORJOK" | "ADMIN" | string;
|
|
697
|
+
senderName?: string | null;
|
|
698
|
+
senderAvatar?: string | null;
|
|
699
|
+
category?: string | null;
|
|
700
|
+
actionUrl?: string | null;
|
|
701
|
+
priority?: "NORMAL" | "HIGH" | string | null;
|
|
702
|
+
createdAt?: string | null;
|
|
703
|
+
updatedAt?: string | null;
|
|
704
|
+
}
|
|
705
|
+
interface UserNotification {
|
|
706
|
+
id: string;
|
|
707
|
+
userId: string;
|
|
708
|
+
title: string;
|
|
709
|
+
message: string;
|
|
710
|
+
type?: "LEVEL_UP" | "DIRECT" | "SYSTEM" | "ACHIEVEMENT" | string | null;
|
|
711
|
+
senderType?: "SYSTEM" | "ORJOK" | "ADMIN" | string | null;
|
|
712
|
+
senderName?: string | null;
|
|
713
|
+
senderAvatar?: string | null;
|
|
714
|
+
actionUrl?: string | null;
|
|
715
|
+
isRead?: boolean | null;
|
|
716
|
+
readAt?: string | null;
|
|
717
|
+
metadata?: string | null;
|
|
718
|
+
createdAt?: string | null;
|
|
719
|
+
updatedAt?: string | null;
|
|
720
|
+
}
|
|
532
721
|
|
|
533
722
|
declare class UserService {
|
|
534
723
|
private network;
|
|
535
724
|
constructor(network: NetworkProvider);
|
|
536
725
|
get(id: string): Promise<User | null>;
|
|
537
726
|
updateAvatar(input: UpdateUserAvatarInput): Promise<User | null>;
|
|
538
|
-
getQuestions(userId: string, nextToken?: string): Promise<PaginatedList<QuestionObject>>;
|
|
539
|
-
getPacks(userId: string, nextToken?: string): Promise<PaginatedList<Pack>>;
|
|
727
|
+
getQuestions(userId: string, nextToken?: string, limit?: number): Promise<PaginatedList<QuestionObject>>;
|
|
728
|
+
getPacks(userId: string, nextToken?: string, limit?: number): Promise<PaginatedList<Pack>>;
|
|
540
729
|
getCourses(userId: string): Promise<Course[]>;
|
|
541
730
|
getEnrolledCourses(userId: string): Promise<CourseEnrolled[]>;
|
|
731
|
+
updateProfile(input: UpdateUserProfileInput): Promise<User | null>;
|
|
732
|
+
list(input?: ListUsersInput): Promise<PaginatedList<User>>;
|
|
542
733
|
}
|
|
543
734
|
|
|
544
735
|
interface StatusResponse {
|
|
@@ -607,7 +798,23 @@ declare class QuestionService {
|
|
|
607
798
|
getFull(id: string): Promise<QuestionObject | null>;
|
|
608
799
|
getAnswer(id: string): Promise<Option | null>;
|
|
609
800
|
getQuestionId(packId: string, order: number): Promise<string | null>;
|
|
801
|
+
listByPack(packId: string, limit?: number, sortDirection?: "ASC" | "DESC", nextToken?: string | null): Promise<PaginatedList<QuestionObject>>;
|
|
610
802
|
update(id: string, fields: Record<string, unknown>): Promise<QuestionObject | null>;
|
|
803
|
+
updateOption(id: string, content: string): Promise<{
|
|
804
|
+
id: string;
|
|
805
|
+
content: string;
|
|
806
|
+
} | null>;
|
|
807
|
+
createOption(input: {
|
|
808
|
+
id?: string;
|
|
809
|
+
content: string;
|
|
810
|
+
questionId: string;
|
|
811
|
+
}): Promise<{
|
|
812
|
+
id: string;
|
|
813
|
+
content: string;
|
|
814
|
+
} | null>;
|
|
815
|
+
deleteOption(id: string): Promise<{
|
|
816
|
+
id: string;
|
|
817
|
+
} | null>;
|
|
611
818
|
delete(id: string): Promise<QuestionObject | null>;
|
|
612
819
|
vote(input: VoteInput): Promise<StatusIdResponse>;
|
|
613
820
|
upVote(questionId: string): Promise<StatusIdResponse>;
|
|
@@ -620,7 +827,9 @@ declare class QuestionService {
|
|
|
620
827
|
listBySubject(input: ListByCurriculumInput): Promise<PaginatedList<QuestionObject>>;
|
|
621
828
|
listByChapter(input: ListByCurriculumInput): Promise<PaginatedList<QuestionObject>>;
|
|
622
829
|
listByTopic(input: ListByCurriculumInput): Promise<PaginatedList<QuestionObject>>;
|
|
830
|
+
listByPublicExam(input: ListByPublicExamInput): Promise<PaginatedList<QuestionObject>>;
|
|
623
831
|
listByRandomHash(input: ListByRandomHashInput): Promise<PaginatedList<QuestionObject>>;
|
|
832
|
+
listByLevel(input: ListByLevelInput): Promise<PaginatedList<QuestionObject>>;
|
|
624
833
|
}
|
|
625
834
|
|
|
626
835
|
declare class PackService {
|
|
@@ -635,14 +844,28 @@ declare class PackService {
|
|
|
635
844
|
report(id: string, reason: string): Promise<{
|
|
636
845
|
id: string;
|
|
637
846
|
}>;
|
|
638
|
-
submitExam(packId: string, selectedOptions: (string | null)[]
|
|
847
|
+
submitExam(packId: string, selectedOptions: (string | null)[], options?: {
|
|
848
|
+
functionUrl?: string;
|
|
849
|
+
authToken?: string;
|
|
850
|
+
}): Promise<StatusIdResponse>;
|
|
639
851
|
getExams(userId: string, nextToken?: string): Promise<PaginatedList<PackExamResults>>;
|
|
640
852
|
getExamResult(resultId: string): Promise<PackExamResults | null>;
|
|
641
853
|
listBySubject(input: ListByCurriculumInput): Promise<PaginatedList<Pack>>;
|
|
642
854
|
listByChapter(input: ListByCurriculumInput): Promise<PaginatedList<Pack>>;
|
|
643
855
|
listByTopic(input: ListByCurriculumInput): Promise<PaginatedList<Pack>>;
|
|
856
|
+
listByPublicExam(input: ListByPublicExamInput): Promise<PaginatedList<Pack>>;
|
|
857
|
+
listByLevel(input: ListByLevelInput): Promise<PaginatedList<Pack>>;
|
|
858
|
+
createGroup(input: CreatePackGroupInput): Promise<PackGroup>;
|
|
859
|
+
deleteGroup(id: string): Promise<{
|
|
860
|
+
id: string;
|
|
861
|
+
}>;
|
|
644
862
|
listGroups(type: string, level?: string): Promise<PackGroup[]>;
|
|
863
|
+
listGroups(input: ListPackGroupsInput): Promise<PaginatedList<PackGroup>>;
|
|
645
864
|
getGroup(id: string): Promise<PackGroup | null>;
|
|
865
|
+
list(input?: {
|
|
866
|
+
limit?: number;
|
|
867
|
+
nextToken?: string | null;
|
|
868
|
+
}): Promise<PaginatedList<Pack>>;
|
|
646
869
|
}
|
|
647
870
|
|
|
648
871
|
declare class ContestService {
|
|
@@ -689,6 +912,7 @@ declare class CourseService {
|
|
|
689
912
|
selectLiveExamOption(examId: string, optionId: string, order: number): Promise<StatusResponse>;
|
|
690
913
|
getLiveExamLeaderboard(examId: string, nextToken?: string | null): Promise<LeaderboardResponse>;
|
|
691
914
|
publishLiveExamResults(examId: string): Promise<StatusResponse>;
|
|
915
|
+
uploadCourseItem(input: UploadCourseItemInput): Promise<StatusIdResponse>;
|
|
692
916
|
}
|
|
693
917
|
|
|
694
918
|
declare class CurriculumService {
|
|
@@ -700,6 +924,8 @@ declare class CurriculumService {
|
|
|
700
924
|
getSubjects(level: string): Promise<Subject[]>;
|
|
701
925
|
getChapters(subjectId: string): Promise<Chapter[]>;
|
|
702
926
|
getTopics(chapterId: string): Promise<Topic[]>;
|
|
927
|
+
recalculateQuestionCounts(): Promise<void>;
|
|
928
|
+
recalculateCreatorStats(): Promise<void>;
|
|
703
929
|
}
|
|
704
930
|
|
|
705
931
|
declare class MediaService {
|
|
@@ -734,13 +960,18 @@ declare class ProgressService {
|
|
|
734
960
|
getChapterProgress(userId: string): Promise<UserChapterProgress[]>;
|
|
735
961
|
getTopicProgress(userId: string): Promise<UserTopicProgress[]>;
|
|
736
962
|
getTopicMetrics(userId: string): Promise<UserTopicMetric[]>;
|
|
737
|
-
getMistakenQuestions(userId: string): Promise<QuestionTracking[]>;
|
|
963
|
+
getMistakenQuestions(userId: string, status?: QuestionTrackingStatus): Promise<QuestionTracking[]>;
|
|
964
|
+
getCorrectedQuestions(userId: string): Promise<QuestionTracking[]>;
|
|
738
965
|
}
|
|
739
966
|
|
|
967
|
+
interface FunctionUrlOptions {
|
|
968
|
+
functionUrl?: string;
|
|
969
|
+
authToken?: string;
|
|
970
|
+
}
|
|
740
971
|
declare class AIService {
|
|
741
972
|
private network;
|
|
742
973
|
constructor(network: NetworkProvider);
|
|
743
|
-
evaluateWrittenAnswer(input: EvaluateWrittenAnswerInput): Promise<EvaluateWrittenAnswerResponse>;
|
|
974
|
+
evaluateWrittenAnswer(input: EvaluateWrittenAnswerInput, options?: FunctionUrlOptions): Promise<EvaluateWrittenAnswerResponse>;
|
|
744
975
|
}
|
|
745
976
|
|
|
746
977
|
declare class NewsService {
|
|
@@ -751,6 +982,56 @@ declare class NewsService {
|
|
|
751
982
|
get(id: string): Promise<NewsArticle | null>;
|
|
752
983
|
}
|
|
753
984
|
|
|
985
|
+
declare class NotificationService {
|
|
986
|
+
private network;
|
|
987
|
+
constructor(network: NetworkProvider);
|
|
988
|
+
/**
|
|
989
|
+
* List broadcast announcements (ordered by category and createdAt).
|
|
990
|
+
*/
|
|
991
|
+
listAnnouncements(limit?: number, nextToken?: string | null): Promise<PaginatedList<Announcement>>;
|
|
992
|
+
/**
|
|
993
|
+
* List announcements by category.
|
|
994
|
+
*/
|
|
995
|
+
listAnnouncementsByCategory(category?: string, limit?: number, nextToken?: string | null): Promise<PaginatedList<Announcement>>;
|
|
996
|
+
/**
|
|
997
|
+
* Create an announcement (Admins only).
|
|
998
|
+
*/
|
|
999
|
+
createAnnouncement(input: CreateAnnouncementInput): Promise<Announcement | null>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Delete an announcement (Admins only).
|
|
1002
|
+
*/
|
|
1003
|
+
deleteAnnouncement(id: string): Promise<boolean>;
|
|
1004
|
+
/**
|
|
1005
|
+
* List user notifications for a specific user ID.
|
|
1006
|
+
*/
|
|
1007
|
+
listUserNotifications(userId: string, limit?: number, nextToken?: string | null): Promise<PaginatedList<UserNotification>>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Create a user notification (Level up, direct message, system alert).
|
|
1010
|
+
*/
|
|
1011
|
+
createUserNotification(input: CreateUserNotificationInput): Promise<UserNotification | null>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Mark a personal notification as read.
|
|
1014
|
+
*/
|
|
1015
|
+
markNotificationAsRead(id: string): Promise<UserNotification | null>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Delete a personal user notification.
|
|
1018
|
+
*/
|
|
1019
|
+
deleteUserNotification(id: string): Promise<boolean>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Update the user's lastReadAnnouncementAt timestamp in DynamoDB.
|
|
1022
|
+
*/
|
|
1023
|
+
updateLastReadAnnouncement(userId: string, timestamp?: string): Promise<boolean>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
declare class SubscriptionService {
|
|
1027
|
+
private network;
|
|
1028
|
+
constructor(network: NetworkProvider);
|
|
1029
|
+
createRequest(input: CreateSubscriptionRequestInput): Promise<SubscriptionRequest>;
|
|
1030
|
+
getRequest(id: string): Promise<SubscriptionRequest | null>;
|
|
1031
|
+
listRequests(input?: ListSubscriptionRequestsInput): Promise<PaginatedList<SubscriptionRequest>>;
|
|
1032
|
+
updateRequest(input: UpdateSubscriptionRequestInput): Promise<SubscriptionRequest>;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
754
1035
|
interface OrjokClientConfig {
|
|
755
1036
|
authProvider: AuthProvider;
|
|
756
1037
|
networkProvider: NetworkProvider;
|
|
@@ -758,6 +1039,7 @@ interface OrjokClientConfig {
|
|
|
758
1039
|
}
|
|
759
1040
|
declare class OrjokClient {
|
|
760
1041
|
readonly auth: AuthProvider;
|
|
1042
|
+
readonly network: NetworkProvider;
|
|
761
1043
|
readonly users: UserService;
|
|
762
1044
|
readonly questions: QuestionService;
|
|
763
1045
|
readonly packs: PackService;
|
|
@@ -768,8 +1050,106 @@ declare class OrjokClient {
|
|
|
768
1050
|
readonly progress: ProgressService;
|
|
769
1051
|
readonly ai: AIService;
|
|
770
1052
|
readonly news: NewsService;
|
|
1053
|
+
readonly notifications: NotificationService;
|
|
1054
|
+
readonly subscriptions: SubscriptionService;
|
|
1055
|
+
readonly storage?: StorageProvider;
|
|
771
1056
|
constructor(config: OrjokClientConfig);
|
|
772
1057
|
}
|
|
773
1058
|
declare function createOrjokClient(config: OrjokClientConfig): OrjokClient;
|
|
774
1059
|
|
|
775
|
-
|
|
1060
|
+
interface PracticeMetrics {
|
|
1061
|
+
totalPracticed: number;
|
|
1062
|
+
totalMistakes: number;
|
|
1063
|
+
totalCorrected: number;
|
|
1064
|
+
accuracy: number;
|
|
1065
|
+
}
|
|
1066
|
+
declare function aggregateSubjectMetrics(progress: UserSubjectProgress[]): PracticeMetrics;
|
|
1067
|
+
declare function aggregateChapterMetrics(progress: UserChapterProgress[]): PracticeMetrics;
|
|
1068
|
+
declare function aggregateTopicMetrics(progress: UserTopicProgress[]): PracticeMetrics;
|
|
1069
|
+
declare function calculateAccuracy(practiced: number, mistakes: number): number;
|
|
1070
|
+
declare function isLanguageMatch(qLang?: string | null, targetLang?: string): boolean;
|
|
1071
|
+
declare function isDifficultyMatch(qDiff?: string | null, targetDiff?: string): boolean;
|
|
1072
|
+
declare function isValidMCQ(q: unknown): boolean;
|
|
1073
|
+
|
|
1074
|
+
interface SelectOption<T = string> {
|
|
1075
|
+
value: T;
|
|
1076
|
+
label: string;
|
|
1077
|
+
}
|
|
1078
|
+
declare const levelOptions: SelectOption<Level>[];
|
|
1079
|
+
declare const languageOptions: SelectOption<Language>[];
|
|
1080
|
+
declare const difficultyOptions: SelectOption<Difficulty>[];
|
|
1081
|
+
interface PublicExamOption extends SelectOption<string> {
|
|
1082
|
+
level: Level | Level[] | string | string[];
|
|
1083
|
+
}
|
|
1084
|
+
declare const publicExamOptions: PublicExamOption[];
|
|
1085
|
+
/**
|
|
1086
|
+
* Returns public exams relevant to the given level.
|
|
1087
|
+
* Handles normalized level matching (e.g. "Admission" maps to "HSC+Admission").
|
|
1088
|
+
*/
|
|
1089
|
+
declare function getPublicExamsByLevel(level?: string | null): PublicExamOption[];
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* @file notification.ts
|
|
1093
|
+
* @description Logic for notification formatting, level up messaging, and feed management.
|
|
1094
|
+
*/
|
|
1095
|
+
|
|
1096
|
+
interface LevelUpNotificationResult {
|
|
1097
|
+
type: "LEVEL_UP";
|
|
1098
|
+
newLevel: number;
|
|
1099
|
+
oldLevel: number;
|
|
1100
|
+
tierId: string;
|
|
1101
|
+
tierNameEn: string;
|
|
1102
|
+
tierNameBn: string;
|
|
1103
|
+
isTierPromotion: boolean;
|
|
1104
|
+
titleEn: string;
|
|
1105
|
+
titleBn: string;
|
|
1106
|
+
messageEn: string;
|
|
1107
|
+
messageBn: string;
|
|
1108
|
+
metadata: {
|
|
1109
|
+
newLevel: number;
|
|
1110
|
+
oldLevel: number;
|
|
1111
|
+
tierId: string;
|
|
1112
|
+
isTierPromotion: boolean;
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
interface FormatLevelUpParams {
|
|
1116
|
+
newLevel: number;
|
|
1117
|
+
oldLevel?: number;
|
|
1118
|
+
userName?: string;
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Format level-up notifications with bilingual support and tier promotion detection.
|
|
1122
|
+
*/
|
|
1123
|
+
declare function formatLevelUpNotification({ newLevel, oldLevel, userName, }: FormatLevelUpParams): LevelUpNotificationResult;
|
|
1124
|
+
interface NotificationTimelineItem {
|
|
1125
|
+
id: string;
|
|
1126
|
+
itemType: "ANNOUNCEMENT" | "USER_NOTIFICATION";
|
|
1127
|
+
title: string;
|
|
1128
|
+
message: string;
|
|
1129
|
+
senderType: string;
|
|
1130
|
+
senderName?: string | null;
|
|
1131
|
+
senderAvatar?: string | null;
|
|
1132
|
+
category?: string | null;
|
|
1133
|
+
actionUrl?: string | null;
|
|
1134
|
+
priority?: string | null;
|
|
1135
|
+
isUnread: boolean;
|
|
1136
|
+
createdAt: string;
|
|
1137
|
+
metadata?: string | null;
|
|
1138
|
+
rawAnnouncement?: Announcement;
|
|
1139
|
+
rawUserNotification?: UserNotification;
|
|
1140
|
+
}
|
|
1141
|
+
interface MergeTimelineParams {
|
|
1142
|
+
announcements?: Announcement[] | null;
|
|
1143
|
+
userNotifications?: UserNotification[] | null;
|
|
1144
|
+
lastReadAnnouncementAt?: string | null;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* Merges announcements and user-specific notifications into a single chronological stream.
|
|
1148
|
+
*/
|
|
1149
|
+
declare function mergeNotificationTimeline({ announcements, userNotifications, lastReadAnnouncementAt, }: MergeTimelineParams): NotificationTimelineItem[];
|
|
1150
|
+
/**
|
|
1151
|
+
* Calculate total unread count for badge display.
|
|
1152
|
+
*/
|
|
1153
|
+
declare function calculateUnreadCount({ announcements, userNotifications, lastReadAnnouncementAt, }: MergeTimelineParams): number;
|
|
1154
|
+
|
|
1155
|
+
export { CurriculumService as $, type Announcement as A, type CourseLiveExamQuestionsResponse as B, type Chapter as C, type Difficulty as D, CourseService as E, type CreateAnnouncementInput as F, type CreateContestInput as G, type CreateCourseInput as H, type CreateCourseItemInput as I, type CreateCourseLiveExamInput as J, type CreateCourseResponse as K, type Language as L, type CreateCourseVideoInput as M, type NotificationTimelineItem as N, OrjokClient as O, type Pack as P, type QuestionObject as Q, type CreateCourseVideoResponse as R, type Subject as S, type Topic as T, type UserSubjectProgress as U, type CreatePackGroupInput as V, type CreatePackInput as W, type CreateQuestionInput as X, type CreateQuestionResponse as Y, type CreateSubscriptionRequestInput as Z, type CreateUserNotificationInput as _, type Contest as a, type VoteInput as a$, type DeleteCourseItemInput as a0, type EnrollStudentInput as a1, type EvaluateWrittenAnswerInput as a2, type EvaluateWrittenAnswerResponse as a3, type FormatLevelUpParams as a4, type GetSignedFileURLInput as a5, type GetSignedURLInput as a6, type LeaderboardResponse as a7, type LevelUpNotificationResult as a8, type ListByCurriculumInput as a9, type QuestionTracking as aA, type QuestionTrackingStatus as aB, type QuestionVote as aC, type SelectOption as aD, type SendEnrollmentRequestInput as aE, type SignedURLResponse as aF, type SortDirection as aG, type StatusIdResponse as aH, type StatusResponse as aI, type SubmitPackExamInput as aJ, type SubscriptionRequest as aK, SubscriptionService as aL, type Tag as aM, type Tier as aN, type TrackPracticeProgressInput as aO, type UpdateSubscriptionRequestInput as aP, type UpdateUserAvatarInput as aQ, type UpdateUserNotificationInput as aR, type UpdateUserProfileInput as aS, type UploadCourseItemInput as aT, type UploadImageResponse as aU, type UploadVideoToBunnyInput as aV, type User as aW, UserService as aX, type UserTopicMetric as aY, type Verification as aZ, type VerificationType as a_, type ListByLevelInput as aa, type ListByPublicExamInput as ab, type ListByRandomHashInput as ac, type ListPackGroupsInput as ad, type ListSubscriptionRequestsInput as ae, type ListUsersInput as af, MediaService as ag, type MergeTimelineParams as ah, type ModelType as ai, type NewsArticle as aj, NewsService as ak, NotificationService as al, type Option as am, type OrjokClientConfig as an, type PackExamResults as ao, type PackGroup as ap, type PackReport as aq, PackService as ar, type PackTag as as, type PaymentMethod as at, type PaymentStatus as au, type PaymentTransaction as av, ProgressService as aw, type QuestionReport as ax, QuestionService as ay, type QuestionTag as az, type CheckParticipationResponse as b, type VoteType as b0, aggregateChapterMetrics as b1, aggregateSubjectMetrics as b2, aggregateTopicMetrics as b3, calculateAccuracy as b4, calculateUnreadCount as b5, createOrjokClient as b6, difficultyOptions as b7, formatLevelUpNotification as b8, getPublicExamsByLevel as b9, isDifficultyMatch as ba, isLanguageMatch as bb, isValidMCQ as bc, languageOptions as bd, levelOptions as be, mergeNotificationTimeline as bf, publicExamOptions as bg, type Course as c, type CourseItem as d, type CourseLiveExam as e, type UserChapterProgress as f, type UserTopicProgress as g, type PracticeMetrics as h, type PublicExamOption as i, type UserNotification as j, type QuestionType as k, type Level as l, type PaginatedList as m, AIService as n, type AIUsageLog as o, type AddQuestionTagInput as p, type ContestAnswersResponse as q, type ContestOption as r, type ContestParticipant as s, type ContestQuestion as t, type ContestQuestionsResponse as u, ContestService as v, type CourseEnrolled as w, type CourseEnrollmentRequest as x, type CourseItemType as y, type CourseLiveExamParticipant as z };
|