@learnpress/api 0.5.0 → 0.6.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.
@@ -10,7 +10,8 @@ interface LpValidateResponse {
10
10
  code: string;
11
11
  message: string;
12
12
  data: {
13
- status: number; /** Remaining seconds until expiry */
13
+ status: number;
14
+ /** Remaining seconds until expiry */
14
15
  exp: number;
15
16
  };
16
17
  }
@@ -43,15 +44,18 @@ interface LpInstructor {
43
44
  description: string;
44
45
  social?: Record<string, unknown>;
45
46
  }
47
+ type LpItemType = "lp_lesson" | "lp_quiz" | "lp_assignment";
48
+ type LpItemStatus = "completed" | "in-progress" | "";
49
+ type LpItemGraduation = "passed" | "failed" | "in-progress" | "";
46
50
  interface LpSectionItem {
47
51
  id: number;
48
- type: string;
52
+ type: LpItemType | string;
49
53
  slug?: string;
50
54
  title: string;
51
55
  preview: boolean;
52
56
  duration: string;
53
- graduation: string;
54
- status: string;
57
+ graduation: LpItemGraduation | string;
58
+ status: LpItemStatus | string;
55
59
  locked: boolean;
56
60
  }
57
61
  interface LpSection {
@@ -103,17 +107,20 @@ interface LpCourse {
103
107
  content?: string;
104
108
  excerpt?: string;
105
109
  count_students?: number;
110
+ /** Total lesson/item count. Not returned by listing API; computed from sections on single-course fetch. */
111
+ lesson_count?: number;
106
112
  can_finish?: boolean;
107
113
  can_retake?: number | boolean;
108
- ratake_count?: number;
109
- rataken?: number;
114
+ retake_count?: number;
115
+ retaken?: number;
110
116
  duration?: string;
111
117
  categories?: LpTerm[];
112
118
  tags?: LpTerm[];
113
119
  instructor?: LpInstructor;
114
120
  sections?: LpSection[];
115
121
  course_data?: LpCourseUserData;
116
- rating?: number;
122
+ /** LearnPress returns false when the course does not have a rating yet. */
123
+ rating?: number | false;
117
124
  price?: number;
118
125
  price_rendered?: string;
119
126
  origin_price?: number;
@@ -147,7 +154,15 @@ interface LpCoursesQuery {
147
154
  slug?: string | string[];
148
155
  /** Applies only when `learned` is enabled. */
149
156
  course_filter?: "in-progress" | "passed" | "failed" | string;
157
+ /** Filter by post status (e.g. instructor's own courses): "all", "publish", "pending". */
158
+ c_status?: "all" | "publish" | "pending" | string;
159
+ /** LearnPress course filters: free, paid, sale, feature. */
160
+ sort_by?: "on_free" | "on_paid" | "on_sale" | "on_feature" | string;
150
161
  on_sale?: boolean;
162
+ /** Filter by featured courses (`meta_key = '_lp_featured'`). Pass `1` or `true`. */
163
+ on_feature?: boolean | 1;
164
+ /** @deprecated LearnPress REST courses do not support `free`; use `sort_by: "on_free"`. */
165
+ free?: boolean;
151
166
  popular?: boolean;
152
167
  /** Skip heavy fields (sections, course_data, instructor, meta_data, ...). */
153
168
  optimize?: boolean | string;
@@ -171,6 +186,60 @@ interface LpCourseIdInput {
171
186
  interface LpLessonResults {
172
187
  status?: string;
173
188
  }
189
+ interface LpAssignmentDuration {
190
+ format: string;
191
+ time: number;
192
+ time_remaining: number;
193
+ }
194
+ interface LpAssignmentResults {
195
+ /** "" = not started, "started", "completed" = submitted (pending review), "evaluated" = graded */
196
+ status: "started" | "completed" | "evaluated" | "";
197
+ start_time: string;
198
+ expiration_time: string;
199
+ end_time: string;
200
+ }
201
+ interface LpAssignmentAnswer {
202
+ note: string;
203
+ file: string[];
204
+ }
205
+ interface LpAssignmentEvaluationFile {
206
+ id: string;
207
+ url: string;
208
+ name: string;
209
+ }
210
+ interface LpAssignmentEvaluation {
211
+ mark: number;
212
+ user_mark: number;
213
+ /** "passed" | "failed" */
214
+ graduation: string;
215
+ /** Percentage 0–100 */
216
+ result: number;
217
+ instructor_note?: string;
218
+ reference_files?: LpAssignmentEvaluationFile[];
219
+ }
220
+ interface LpAssignment {
221
+ id: number;
222
+ name: string;
223
+ slug: string;
224
+ permalink: string;
225
+ status?: string;
226
+ content?: string;
227
+ excerpt?: string;
228
+ introdution?: string;
229
+ passing_grade?: string;
230
+ retake_count?: number;
231
+ retaken?: number;
232
+ allow_file_type?: string;
233
+ files_amount?: number;
234
+ attachment?: unknown[];
235
+ duration?: LpAssignmentDuration;
236
+ results?: LpAssignmentResults;
237
+ assignment_answer?: LpAssignmentAnswer;
238
+ /** Present as an object when instructor has graded; empty array when not yet graded. */
239
+ evaluation?: LpAssignmentEvaluation | [];
240
+ can_finish_course?: boolean;
241
+ assigned?: LpAssigned;
242
+ }
174
243
  interface LpAssignedCourse {
175
244
  id: number;
176
245
  title: string;
@@ -197,12 +266,83 @@ interface LpLesson {
197
266
  assigned?: LpAssigned;
198
267
  meta_data?: Record<string, unknown>;
199
268
  }
269
+ interface LpQuizQuestionOption {
270
+ /** API returns a numeric DB id; coerce with String() when used as a Radio/Checkbox value. */
271
+ uid: string | number;
272
+ title: string;
273
+ value?: string;
274
+ /** Present (as "yes"/"no") only when answer is revealed (instant_check or completed). */
275
+ is_true?: string;
276
+ }
277
+ interface LpQuizFibAnswerEntry {
278
+ is_correct: boolean;
279
+ /** User's answer. */
280
+ answer: string;
281
+ /** Correct fill value. */
282
+ correct: string;
283
+ }
200
284
  interface LpQuizQuestion {
201
285
  id: number;
202
- type?: string;
203
- title?: string;
204
- point?: number;
286
+ title: string;
287
+ type: string;
288
+ point: number;
289
+ /** For FIB questions, this contains `{{FIB_<id>}}` placeholders instead of raw shortcodes. */
290
+ content?: string;
291
+ hint?: string;
292
+ explanation?: string;
293
+ has_explanation?: boolean;
294
+ options: LpQuizQuestionOption[];
295
+ /** For FIB on revealed state: per-blank correctness + correct answer. */
296
+ fib_answers?: Record<string, LpQuizFibAnswerEntry>;
297
+ }
298
+ interface LpQuizCheckAnswerResponse {
299
+ status?: string;
300
+ message?: string;
301
+ explanation?: string;
302
+ /** Options with `is_true` revealed. */
303
+ options?: LpQuizQuestionOption[];
304
+ /** Plugin's internal correctness check object. Shape varies by question type. */
305
+ result?: {
306
+ correct?: boolean;
307
+ [key: string]: unknown;
308
+ };
309
+ [key: string]: unknown;
310
+ }
311
+ interface LpQuizResultScore {
312
+ mark?: number;
313
+ user_mark?: number;
314
+ question_count?: number;
315
+ question_correct?: number;
316
+ question_wrong?: number;
317
+ question_empty?: number;
318
+ result?: number;
319
+ pass?: number;
320
+ }
321
+ interface LpQuizUserResults {
322
+ status?: string;
323
+ passing_grade?: number | string;
324
+ retake_count?: number;
325
+ retaken?: number;
326
+ total_time?: number;
327
+ /** Number of questions per page; 0 or undefined = show all on one page. */
328
+ questions_per_page?: number;
329
+ page_numbers?: boolean;
330
+ attempts?: unknown[];
331
+ checked_questions?: number[];
332
+ start_time?: string;
333
+ question_ids?: number[];
334
+ answered?: Record<string, {
335
+ answered?: string | string[] | Record<string, string>;
336
+ correct?: boolean;
337
+ }>;
338
+ results?: LpQuizResultScore;
339
+ instant_check?: boolean;
340
+ negative_marking?: boolean;
341
+ /** "Allow students to review this quiz after they finish the quiz." */
342
+ review_questions?: boolean;
343
+ show_correct_review?: boolean;
205
344
  }
345
+ type LpQuizAnswerInput = Record<string | number, string | string[] | Record<string, string>>;
206
346
  interface LpQuiz {
207
347
  id: number;
208
348
  name: string;
@@ -214,7 +354,7 @@ interface LpQuiz {
214
354
  duration?: string;
215
355
  can_finish_course?: boolean;
216
356
  questions?: LpQuizQuestion[];
217
- results?: Record<string, unknown>;
357
+ results?: LpQuizUserResults;
218
358
  assigned?: LpAssigned;
219
359
  meta_data?: Record<string, unknown>;
220
360
  }
@@ -234,6 +374,180 @@ interface LpCourseActionResponse {
234
374
  message?: string;
235
375
  [key: string]: unknown;
236
376
  }
377
+ interface LpWishlistData {
378
+ /** Present on toggle responses: which action was performed. */
379
+ type?: "add" | "remove";
380
+ /** Present on single-course responses: whether the course is in the wishlist. */
381
+ in_wishlist?: "yes" | "no";
382
+ /** Localized add/remove button labels. */
383
+ text?: {
384
+ add: string;
385
+ remove: string;
386
+ };
387
+ /** Wishlisted courses, resolved from `/learnpress/v1/courses`. */
388
+ items?: LpCourse[];
389
+ }
390
+ interface LpWishlistResponse extends LpCourseActionResponse {
391
+ data?: LpWishlistData;
392
+ }
393
+ interface LpPaymentMethodConfig {
394
+ client_id?: string;
395
+ sandbox?: boolean;
396
+ currency?: string;
397
+ }
398
+ interface LpPaymentMethod {
399
+ id: string;
400
+ title: string;
401
+ description: string;
402
+ icon: string;
403
+ is_default: boolean;
404
+ config?: LpPaymentMethodConfig;
405
+ }
406
+ interface LpPaypalCreateOrderInput {
407
+ course_id: number;
408
+ notes?: string;
409
+ }
410
+ interface LpPaypalCreateOrderResponse extends LpCourseActionResponse {
411
+ data?: {
412
+ lp_order_id?: number;
413
+ paypal_order_id?: string;
414
+ };
415
+ }
416
+ interface LpPaypalCaptureInput {
417
+ paypal_order_id: string;
418
+ }
419
+ interface LpPaypalCaptureResponse extends LpCourseActionResponse {
420
+ data?: {
421
+ order?: LpOrderSummary;
422
+ };
423
+ }
424
+ interface LpCheckoutInput {
425
+ course_id: number;
426
+ payment_method?: string;
427
+ notes?: string;
428
+ }
429
+ interface LpOrderItem {
430
+ name: string;
431
+ course_id: number;
432
+ total: number;
433
+ }
434
+ interface LpOrderSummary {
435
+ id: number;
436
+ number: string;
437
+ status: string;
438
+ status_label: string;
439
+ total: number;
440
+ total_formatted: string;
441
+ subtotal: number;
442
+ created_at: string;
443
+ payment_method: string;
444
+ items: LpOrderItem[];
445
+ }
446
+ interface LpCheckoutResponse extends LpCourseActionResponse {
447
+ data?: {
448
+ order_id?: number;
449
+ redirect?: string;
450
+ /** True when the gateway requires the user to be redirected externally (e.g. PayPal). */
451
+ requires_redirect?: boolean;
452
+ order?: LpOrderSummary;
453
+ };
454
+ }
455
+ interface LpUserSocial {
456
+ facebook?: string;
457
+ twitter?: string;
458
+ youtube?: string;
459
+ linkedin?: string;
460
+ instagram?: string;
461
+ github?: string;
462
+ }
463
+ interface LpUserOrderEntry {
464
+ order_key: string;
465
+ total: number | string;
466
+ currency: string;
467
+ status: string;
468
+ date: string;
469
+ }
470
+ interface LpUserProfile {
471
+ id: number;
472
+ name?: string;
473
+ first_name?: string;
474
+ last_name?: string;
475
+ email?: string;
476
+ description?: string;
477
+ url?: string;
478
+ nickname?: string;
479
+ registered_date?: string;
480
+ /** Only returned with `context: "edit"`. */
481
+ roles?: string[];
482
+ avatar_url?: string;
483
+ avatar_size?: {
484
+ width: number;
485
+ height: number;
486
+ };
487
+ cover_image_url?: string;
488
+ social?: LpUserSocial;
489
+ tabs?: {
490
+ orders?: {
491
+ content?: Record<string, LpUserOrderEntry>;
492
+ };
493
+ [key: string]: unknown;
494
+ };
495
+ }
496
+ interface LpUserUpdateInput {
497
+ first_name?: string;
498
+ last_name?: string;
499
+ email?: string;
500
+ description?: string;
501
+ url?: string;
502
+ nickname?: string;
503
+ social?: Record<string, string>;
504
+ }
505
+ interface LpChangePasswordInput {
506
+ current_password: string;
507
+ password: string;
508
+ confirm_password: string;
509
+ }
510
+ interface LpThumbnailDimensions {
511
+ width: number;
512
+ height: number;
513
+ crop: boolean;
514
+ }
515
+ interface LpCourseSettings {
516
+ archive_layout: "grid" | "list" | string;
517
+ archive_layouts: string[];
518
+ archive_limit: number;
519
+ pagination_type: "standard" | "load_more" | "infinite" | string;
520
+ layout_single_course: string;
521
+ curriculum_display: string;
522
+ section_per_page: number;
523
+ course_item_per_page: number;
524
+ auto_enroll: boolean;
525
+ popup_confirm_finish: boolean;
526
+ courses_of_subcategory: boolean;
527
+ thumbnail_dimensions: LpThumbnailDimensions;
528
+ }
529
+ interface LpCurrencySettings {
530
+ currency: string;
531
+ symbol: string;
532
+ position: "left" | "right" | "left_space" | "right_space" | string;
533
+ thousands_separator: string;
534
+ decimals_separator: string;
535
+ number_of_decimals: number;
536
+ }
537
+ interface LpSettings {
538
+ course: LpCourseSettings;
539
+ currency: LpCurrencySettings;
540
+ [key: string]: unknown;
541
+ }
542
+ /** Instructor dashboard counters from GET /lp/v1/profile/instructor/statistic. */
543
+ interface LpInstructorStatistic {
544
+ total_course: number;
545
+ published_course: number;
546
+ pending_course: number;
547
+ total_student: number;
548
+ student_completed: number;
549
+ student_in_progress: number;
550
+ }
237
551
  //#endregion
238
552
  //#region src/client.d.ts
239
553
  interface ApiClientOptions {
@@ -275,9 +589,9 @@ interface ResponseMeta<T> {
275
589
  declare class ApiError extends Error {
276
590
  readonly status: number;
277
591
  readonly code?: string | undefined;
278
- readonly data?: unknown | undefined;
592
+ readonly data?: unknown;
279
593
  readonly response?: Response | undefined;
280
- constructor(message: string, status: number, code?: string | undefined, data?: unknown | undefined, response?: Response | undefined);
594
+ constructor(message: string, status: number, code?: string | undefined, data?: unknown, response?: Response | undefined);
281
595
  }
282
596
  type AuthInput = Pick<ApiClientOptions, "bearerToken" | "authorization"> | null;
283
597
  declare class ApiClient {
@@ -305,6 +619,47 @@ declare class ApiClient {
305
619
  };
306
620
  }
307
621
  //#endregion
622
+ //#region src/endpoints/lp/certificates.d.ts
623
+ interface LpCertificateItem {
624
+ cert_id: number;
625
+ user_id: number;
626
+ course_id: number;
627
+ }
628
+ interface LpCertificateProfileResponse {
629
+ status: string;
630
+ message?: string;
631
+ data?: {
632
+ certKey: string[];
633
+ template?: string;
634
+ };
635
+ }
636
+ interface LpCertificatePurchaseResponse {
637
+ status: string;
638
+ message?: string;
639
+ data?: {
640
+ redirect: string;
641
+ };
642
+ }
643
+ interface LpCertificateProfileQuery {
644
+ userID?: number;
645
+ page?: number;
646
+ }
647
+ interface LpCertificateInfo {
648
+ enable: number;
649
+ image?: string;
650
+ title?: string;
651
+ description?: string;
652
+ }
653
+ declare const createCertificates: (client: ApiClient) => {
654
+ /** GET /lp/v1/certificate/items-profile */
655
+ getProfileItems(query?: LpCertificateProfileQuery): Promise<LpCertificateProfileResponse>;
656
+ /** POST /lp/v1/certificate/purchase */
657
+ purchase(input: {
658
+ lp_cert_id: number;
659
+ lp_course_id_of_cert: number;
660
+ }): Promise<LpCertificatePurchaseResponse>;
661
+ };
662
+ //#endregion
308
663
  //#region src/types/common.d.ts
309
664
  interface Rendered {
310
665
  rendered: string;
@@ -369,6 +724,7 @@ interface WpUser {
369
724
  slug: string;
370
725
  avatar_urls: Record<string, string>;
371
726
  meta?: Record<string, unknown>;
727
+ cover_image_url?: string;
372
728
  }
373
729
  interface WpMedia extends WpPost {
374
730
  alt_text: string;
@@ -468,6 +824,8 @@ interface WpPagesQuery extends PaginatedQuery {
468
824
  //#region src/endpoints/wp/users.d.ts
469
825
  interface WpUsersQuery extends PaginatedQuery {
470
826
  slug?: string | string[];
827
+ roles?: string | string[];
828
+ who?: string;
471
829
  }
472
830
  //#endregion
473
831
  //#region src/endpoints/wp/media.d.ts
@@ -654,12 +1012,52 @@ declare const createApi: (options: CreateApiOptions) => {
654
1012
  };
655
1013
  };
656
1014
  lp: {
1015
+ assignments: {
1016
+ list(query?: LpItemQuery): Promise<LpAssignment[]>;
1017
+ get(id: number): Promise<LpAssignment>;
1018
+ getBySlug(slug: string): Promise<LpAssignment | undefined>;
1019
+ start(input: {
1020
+ id: number;
1021
+ }): Promise<{
1022
+ message: string;
1023
+ }>;
1024
+ submit(input: {
1025
+ id: number;
1026
+ note?: string;
1027
+ }): Promise<{
1028
+ message: string;
1029
+ }>;
1030
+ retake(input: {
1031
+ id: number;
1032
+ }): Promise<{
1033
+ message: string;
1034
+ }>;
1035
+ deleteFile(input: {
1036
+ id: number;
1037
+ file: string;
1038
+ }): Promise<{
1039
+ message: string;
1040
+ }>;
1041
+ };
657
1042
  auth: {
658
1043
  login(input: LpLoginInput): Promise<LpTokenResponse>;
659
1044
  validate(): Promise<LpValidateResponse>;
660
1045
  register(input: LpRegisterInput): Promise<LpTokenResponse>;
661
1046
  logout(): void;
662
1047
  };
1048
+ certificates: {
1049
+ getProfileItems(query?: LpCertificateProfileQuery): Promise<LpCertificateProfileResponse>;
1050
+ purchase(input: {
1051
+ lp_cert_id: number;
1052
+ lp_course_id_of_cert: number;
1053
+ }): Promise<LpCertificatePurchaseResponse>;
1054
+ };
1055
+ checkout: {
1056
+ listPaymentMethods(): Promise<LpPaymentMethod[]>;
1057
+ create(input: LpCheckoutInput): Promise<LpCheckoutResponse>;
1058
+ paypalCreateOrder(input: LpPaypalCreateOrderInput): Promise<LpPaypalCreateOrderResponse>;
1059
+ paypalCapture(input: LpPaypalCaptureInput): Promise<LpPaypalCaptureResponse>;
1060
+ };
663
1061
  courseCategories: {
664
1062
  list(query?: LpTermsQuery): Promise<LpCourseCategory[]>;
665
1063
  listWithMeta(query?: LpTermsQuery): Promise<ResponseMeta<LpCourseCategory[]>>;
@@ -699,24 +1097,159 @@ declare const createApi: (options: CreateApiOptions) => {
699
1097
  checkAnswer(input: {
700
1098
  id: number;
701
1099
  question_id: number;
702
- answered: unknown;
703
- }): Promise<LpCourseActionResponse>;
1100
+ answered: string | string[] | Record<string, string>;
1101
+ }): Promise<LpQuizCheckAnswerResponse>;
704
1102
  finish(input: {
705
1103
  id: number;
1104
+ answered?: LpQuizAnswerInput;
1105
+ time_spend?: number;
706
1106
  }): Promise<LpCourseActionResponse>;
707
1107
  };
1108
+ reviews: {
1109
+ getCourseReviews(courseId: number): Promise<LpCourseReviewData>;
1110
+ submit(params: LpReviewSubmitParams): Promise<{
1111
+ status: string;
1112
+ message: string;
1113
+ }>;
1114
+ };
1115
+ settings: {
1116
+ get(): Promise<LpSettings>;
1117
+ };
1118
+ users: {
1119
+ get(id: number, query?: {
1120
+ context?: "view" | "edit";
1121
+ }): Promise<LpUserProfile>;
1122
+ update(id: number, data: LpUserUpdateInput): Promise<{
1123
+ status: string;
1124
+ message: string;
1125
+ data?: LpUserProfile;
1126
+ }>;
1127
+ changePassword(data: LpChangePasswordInput): Promise<{
1128
+ code?: string;
1129
+ message: string;
1130
+ }>;
1131
+ uploadAvatar(dataUrl: string): Promise<{
1132
+ status: string;
1133
+ message: string;
1134
+ }>;
1135
+ removeAvatar(): Promise<{
1136
+ status: string;
1137
+ message: string;
1138
+ }>;
1139
+ uploadCoverImage(file: File): Promise<{
1140
+ status: string;
1141
+ message: string;
1142
+ data?: {
1143
+ url?: string;
1144
+ };
1145
+ }>;
1146
+ removeCoverImage(): Promise<{
1147
+ status: string;
1148
+ message: string;
1149
+ }>;
1150
+ instructorStatistic(userId: number): Promise<LpInstructorStatistic>;
1151
+ };
1152
+ wishlist: {
1153
+ list(): Promise<LpWishlistResponse>;
1154
+ getCourseStatus(id: number): Promise<LpWishlistResponse>;
1155
+ toggle(input: LpCourseIdInput): Promise<LpWishlistResponse>;
1156
+ };
708
1157
  };
709
1158
  };
710
1159
  type Api = ReturnType<typeof createApi>;
711
1160
  //#endregion
1161
+ //#region src/endpoints/lp/reviews.d.ts
1162
+ interface LpReviewItem {
1163
+ comment_id: string;
1164
+ display_name: string;
1165
+ user_email?: string;
1166
+ rate: string;
1167
+ title: string;
1168
+ content: string;
1169
+ comment_date_gmt: string;
1170
+ }
1171
+ interface LpRatingStar {
1172
+ rated: number;
1173
+ total: number;
1174
+ percent: number;
1175
+ percent_float: number;
1176
+ }
1177
+ interface LpCourseReviewData {
1178
+ rated: number;
1179
+ total: number;
1180
+ items: Record<string, LpRatingStar>;
1181
+ reviews: {
1182
+ reviews: LpReviewItem[];
1183
+ paged: number;
1184
+ total: number;
1185
+ per_page: number;
1186
+ };
1187
+ can_review: boolean;
1188
+ }
1189
+ interface LpReviewSubmitParams {
1190
+ id: number;
1191
+ rate: number;
1192
+ title: string;
1193
+ content: string;
1194
+ }
1195
+ declare const createReviews: (client: ApiClient) => {
1196
+ /** GET /learnpress/v1/review/course/{courseId} */
1197
+ getCourseReviews(courseId: number): Promise<LpCourseReviewData>;
1198
+ /** POST /learnpress/v1/review/submit */
1199
+ submit(params: LpReviewSubmitParams): Promise<{
1200
+ status: string;
1201
+ message: string;
1202
+ }>;
1203
+ };
1204
+ //#endregion
712
1205
  //#region src/endpoints/lp/index.d.ts
713
1206
  declare const createLpApi: (client: ApiClient) => {
1207
+ assignments: {
1208
+ list(query?: LpItemQuery): Promise<LpAssignment[]>;
1209
+ get(id: number): Promise<LpAssignment>;
1210
+ getBySlug(slug: string): Promise<LpAssignment | undefined>;
1211
+ start(input: {
1212
+ id: number;
1213
+ }): Promise<{
1214
+ message: string;
1215
+ }>;
1216
+ submit(input: {
1217
+ id: number;
1218
+ note?: string;
1219
+ }): Promise<{
1220
+ message: string;
1221
+ }>;
1222
+ retake(input: {
1223
+ id: number;
1224
+ }): Promise<{
1225
+ message: string;
1226
+ }>;
1227
+ deleteFile(input: {
1228
+ id: number;
1229
+ file: string;
1230
+ }): Promise<{
1231
+ message: string;
1232
+ }>;
1233
+ };
714
1234
  auth: {
715
1235
  login(input: LpLoginInput): Promise<LpTokenResponse>;
716
1236
  validate(): Promise<LpValidateResponse>;
717
1237
  register(input: LpRegisterInput): Promise<LpTokenResponse>;
718
1238
  logout(): void;
719
1239
  };
1240
+ certificates: {
1241
+ getProfileItems(query?: LpCertificateProfileQuery): Promise<LpCertificateProfileResponse>;
1242
+ purchase(input: {
1243
+ lp_cert_id: number;
1244
+ lp_course_id_of_cert: number;
1245
+ }): Promise<LpCertificatePurchaseResponse>;
1246
+ };
1247
+ checkout: {
1248
+ listPaymentMethods(): Promise<LpPaymentMethod[]>;
1249
+ create(input: LpCheckoutInput): Promise<LpCheckoutResponse>;
1250
+ paypalCreateOrder(input: LpPaypalCreateOrderInput): Promise<LpPaypalCreateOrderResponse>;
1251
+ paypalCapture(input: LpPaypalCaptureInput): Promise<LpPaypalCaptureResponse>;
1252
+ };
720
1253
  courseCategories: {
721
1254
  list(query?: LpTermsQuery): Promise<LpCourseCategory[]>;
722
1255
  listWithMeta(query?: LpTermsQuery): Promise<ResponseMeta<LpCourseCategory[]>>;
@@ -756,14 +1289,65 @@ declare const createLpApi: (client: ApiClient) => {
756
1289
  checkAnswer(input: {
757
1290
  id: number;
758
1291
  question_id: number;
759
- answered: unknown;
760
- }): Promise<LpCourseActionResponse>;
1292
+ answered: string | string[] | Record<string, string>;
1293
+ }): Promise<LpQuizCheckAnswerResponse>;
761
1294
  finish(input: {
762
1295
  id: number;
1296
+ answered?: LpQuizAnswerInput;
1297
+ time_spend?: number;
763
1298
  }): Promise<LpCourseActionResponse>;
764
1299
  };
1300
+ reviews: {
1301
+ getCourseReviews(courseId: number): Promise<LpCourseReviewData>;
1302
+ submit(params: LpReviewSubmitParams): Promise<{
1303
+ status: string;
1304
+ message: string;
1305
+ }>;
1306
+ };
1307
+ settings: {
1308
+ get(): Promise<LpSettings>;
1309
+ };
1310
+ users: {
1311
+ get(id: number, query?: {
1312
+ context?: "view" | "edit";
1313
+ }): Promise<LpUserProfile>;
1314
+ update(id: number, data: LpUserUpdateInput): Promise<{
1315
+ status: string;
1316
+ message: string;
1317
+ data?: LpUserProfile;
1318
+ }>;
1319
+ changePassword(data: LpChangePasswordInput): Promise<{
1320
+ code?: string;
1321
+ message: string;
1322
+ }>;
1323
+ uploadAvatar(dataUrl: string): Promise<{
1324
+ status: string;
1325
+ message: string;
1326
+ }>;
1327
+ removeAvatar(): Promise<{
1328
+ status: string;
1329
+ message: string;
1330
+ }>;
1331
+ uploadCoverImage(file: File): Promise<{
1332
+ status: string;
1333
+ message: string;
1334
+ data?: {
1335
+ url?: string;
1336
+ };
1337
+ }>;
1338
+ removeCoverImage(): Promise<{
1339
+ status: string;
1340
+ message: string;
1341
+ }>;
1342
+ instructorStatistic(userId: number): Promise<LpInstructorStatistic>;
1343
+ };
1344
+ wishlist: {
1345
+ list(): Promise<LpWishlistResponse>;
1346
+ getCourseStatus(id: number): Promise<LpWishlistResponse>;
1347
+ toggle(input: LpCourseIdInput): Promise<LpWishlistResponse>;
1348
+ };
765
1349
  };
766
1350
  type LpApi = ReturnType<typeof createLpApi>;
767
1351
  //#endregion
768
- export { LpCourse as A, LpLesson as B, ApiError as C, ResponseMeta as D, RequestOptions as E, LpCourseResultItem as F, LpRegisterInput as G, LpLoginInput as H, LpCourseUserData as I, LpTerm as J, LpSection as K, LpCoursesQuery as L, LpCourseCategory as M, LpCourseIdInput as N, LpAssigned as O, LpCourseResult as P, LpInstructor as R, ApiClientOptions as S, QueryParams as T, LpQuiz as U, LpLessonResults as V, LpQuizQuestion as W, LpTokenResponse as X, LpTermsQuery as Y, LpValidateResponse as Z, WpUser as _, createApi as a, Rendered as b, WpComment as c, WpMenu as d, WpMenuItem as f, WpTerm as g, WpSearchResult as h, CreateApiOptions as i, LpCourseActionResponse as j, LpAssignedCourse as k, WpEmbeddedTerm as l, WpPost as m, createLpApi as n, WpApi as o, WpPage as p, LpSectionItem as q, Api as r, createWpApi as s, LpApi as t, WpMedia as u, ID as v, AuthInput as w, ApiClient as x, PaginatedQuery as y, LpItemQuery as z };
769
- //# sourceMappingURL=index-CWyrNDh3.d.ts.map
1352
+ export { LpCourseIdInput as $, LpCertificatePurchaseResponse as A, LpQuizUserResults as At, LpAssignedCourse as B, LpUserProfile as Bt, ID as C, LpQuiz as Ct, LpCertificateItem as D, LpQuizQuestion as Dt, LpCertificateInfo as E, LpQuizFibAnswerEntry as Et, AuthInput as F, LpTerm as Ft, LpAssignmentEvaluationFile as G, LpWishlistResponse as Gt, LpAssignmentAnswer as H, LpUserUpdateInput as Ht, QueryParams as I, LpTermsQuery as It, LpCheckoutInput as J, LpAssignmentResults as K, RequestOptions as L, LpThumbnailDimensions as Lt, ApiClient as M, LpSection as Mt, ApiClientOptions as N, LpSectionItem as Nt, LpCertificateProfileQuery as O, LpQuizQuestionOption as Ot, ApiError as P, LpSettings as Pt, LpCourseCategory as Q, ResponseMeta as R, LpTokenResponse as Rt, WpUser as S, LpPaypalCreateOrderResponse as St, Rendered as T, LpQuizCheckAnswerResponse as Tt, LpAssignmentDuration as U, LpValidateResponse as Ut, LpAssignment as V, LpUserSocial as Vt, LpAssignmentEvaluation as W, LpWishlistData as Wt, LpCourse as X, LpCheckoutResponse as Y, LpCourseActionResponse as Z, WpMenuItem as _, LpPaymentMethod as _t, LpReviewItem as a, LpCurrencySettings as at, WpSearchResult as b, LpPaypalCaptureResponse as bt, Api as c, LpItemGraduation as ct, WpApi as d, LpItemType as dt, LpCourseResult as et, createWpApi as f, LpLesson as ft, WpMenu as g, LpOrderSummary as gt, WpMedia as h, LpOrderItem as ht, LpRatingStar as i, LpCoursesQuery as it, createCertificates as j, LpRegisterInput as jt, LpCertificateProfileResponse as k, LpQuizResultScore as kt, CreateApiOptions as l, LpItemQuery as lt, WpEmbeddedTerm as m, LpLoginInput as mt, createLpApi as n, LpCourseSettings as nt, LpReviewSubmitParams as o, LpInstructor as ot, WpComment as p, LpLessonResults as pt, LpChangePasswordInput as q, LpCourseReviewData as r, LpCourseUserData as rt, createReviews as s, LpInstructorStatistic as st, LpApi as t, LpCourseResultItem as tt, createApi as u, LpItemStatus as ut, WpPage as v, LpPaymentMethodConfig as vt, PaginatedQuery as w, LpQuizAnswerInput as wt, WpTerm as x, LpPaypalCreateOrderInput as xt, WpPost as y, LpPaypalCaptureInput as yt, LpAssigned as z, LpUserOrderEntry as zt };
1353
+ //# sourceMappingURL=index-ukSfrLhg.d.ts.map