@learnpress/api 0.4.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.
- package/dist/endpoints/lp/index.cjs +3 -1
- package/dist/endpoints/lp/index.d.cts +2 -2
- package/dist/endpoints/lp/index.d.ts +2 -2
- package/dist/endpoints/lp/index.js +2 -2
- package/dist/endpoints/wp/index.cjs +1 -1
- package/dist/endpoints/wp/index.d.cts +1 -1
- package/dist/endpoints/wp/index.d.ts +1 -1
- package/dist/endpoints/wp/index.js +1 -1
- package/dist/index-ukSfrLhg.d.cts +1353 -0
- package/dist/index-ukSfrLhg.d.cts.map +1 -0
- package/dist/index-ukSfrLhg.d.ts +1353 -0
- package/dist/index-ukSfrLhg.d.ts.map +1 -0
- package/dist/index.cjs +22 -9
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/lp-CuwMSqff.js +353 -0
- package/dist/lp-CuwMSqff.js.map +1 -0
- package/dist/lp-DjHGTC0c.cjs +368 -0
- package/dist/{wp-4qPZPs4-.js → wp-DjqcCWa9.js} +1 -1
- package/dist/{wp-4qPZPs4-.js.map → wp-DjqcCWa9.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BxkZRg0G.d.cts +0 -586
- package/dist/index-BxkZRg0G.d.cts.map +0 -1
- package/dist/index-D65SXgXV.d.ts +0 -586
- package/dist/index-D65SXgXV.d.ts.map +0 -1
- package/dist/lp-C5zWPr-e.cjs +0 -71
- package/dist/lp-yK0dlozD.js +0 -68
- package/dist/lp-yK0dlozD.js.map +0 -1
- /package/dist/{wp-Cj52Y1an.cjs → wp-BbczTv61.cjs} +0 -0
|
@@ -0,0 +1,1353 @@
|
|
|
1
|
+
//#region src/endpoints/lp/types.d.ts
|
|
2
|
+
interface LpTokenResponse {
|
|
3
|
+
token: string;
|
|
4
|
+
user_id: number;
|
|
5
|
+
user_login: string;
|
|
6
|
+
user_email: string;
|
|
7
|
+
user_display_name: string;
|
|
8
|
+
}
|
|
9
|
+
interface LpValidateResponse {
|
|
10
|
+
code: string;
|
|
11
|
+
message: string;
|
|
12
|
+
data: {
|
|
13
|
+
status: number;
|
|
14
|
+
/** Remaining seconds until expiry */
|
|
15
|
+
exp: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface LpLoginInput {
|
|
19
|
+
username: string;
|
|
20
|
+
password: string;
|
|
21
|
+
}
|
|
22
|
+
interface LpRegisterInput {
|
|
23
|
+
username: string;
|
|
24
|
+
email: string;
|
|
25
|
+
password: string;
|
|
26
|
+
confirm_password: string;
|
|
27
|
+
}
|
|
28
|
+
interface LpTerm {
|
|
29
|
+
id: number;
|
|
30
|
+
name: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
}
|
|
33
|
+
interface LpCourseCategory extends LpTerm {
|
|
34
|
+
count?: number;
|
|
35
|
+
description?: string;
|
|
36
|
+
link?: string;
|
|
37
|
+
parent?: number;
|
|
38
|
+
taxonomy?: string;
|
|
39
|
+
}
|
|
40
|
+
interface LpInstructor {
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
avatar: string;
|
|
44
|
+
description: string;
|
|
45
|
+
social?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
type LpItemType = "lp_lesson" | "lp_quiz" | "lp_assignment";
|
|
48
|
+
type LpItemStatus = "completed" | "in-progress" | "";
|
|
49
|
+
type LpItemGraduation = "passed" | "failed" | "in-progress" | "";
|
|
50
|
+
interface LpSectionItem {
|
|
51
|
+
id: number;
|
|
52
|
+
type: LpItemType | string;
|
|
53
|
+
slug?: string;
|
|
54
|
+
title: string;
|
|
55
|
+
preview: boolean;
|
|
56
|
+
duration: string;
|
|
57
|
+
graduation: LpItemGraduation | string;
|
|
58
|
+
status: LpItemStatus | string;
|
|
59
|
+
locked: boolean;
|
|
60
|
+
}
|
|
61
|
+
interface LpSection {
|
|
62
|
+
id: number;
|
|
63
|
+
title: string;
|
|
64
|
+
course_id: number;
|
|
65
|
+
description: string;
|
|
66
|
+
order: number;
|
|
67
|
+
percent?: number;
|
|
68
|
+
items: LpSectionItem[];
|
|
69
|
+
}
|
|
70
|
+
interface LpCourseResultItem {
|
|
71
|
+
completed: number;
|
|
72
|
+
passed: number;
|
|
73
|
+
total: number;
|
|
74
|
+
}
|
|
75
|
+
interface LpCourseResult {
|
|
76
|
+
count_items: number;
|
|
77
|
+
completed_items: number;
|
|
78
|
+
items: Record<string, LpCourseResultItem>;
|
|
79
|
+
evaluate_type: string;
|
|
80
|
+
pass: number;
|
|
81
|
+
/** Percentage 0–100. */
|
|
82
|
+
result: number;
|
|
83
|
+
}
|
|
84
|
+
interface LpCourseUserData {
|
|
85
|
+
graduation: string;
|
|
86
|
+
status: string;
|
|
87
|
+
/** RFC3339 datetime, or null if not started. */
|
|
88
|
+
start_time: string | null;
|
|
89
|
+
/** RFC3339 datetime, or null if not finished. */
|
|
90
|
+
end_time: string | null;
|
|
91
|
+
/** RFC3339 datetime, empty string if no expiration, or "Lifetime" in list payload. */
|
|
92
|
+
expiration_time: string;
|
|
93
|
+
result: LpCourseResult;
|
|
94
|
+
}
|
|
95
|
+
interface LpCourse {
|
|
96
|
+
id: number;
|
|
97
|
+
name: string;
|
|
98
|
+
slug: string;
|
|
99
|
+
permalink: string;
|
|
100
|
+
image: string;
|
|
101
|
+
date_created?: string;
|
|
102
|
+
date_created_gmt?: string;
|
|
103
|
+
date_modified?: string;
|
|
104
|
+
date_modified_gmt?: string;
|
|
105
|
+
on_sale?: boolean;
|
|
106
|
+
status?: string;
|
|
107
|
+
content?: string;
|
|
108
|
+
excerpt?: string;
|
|
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;
|
|
112
|
+
can_finish?: boolean;
|
|
113
|
+
can_retake?: number | boolean;
|
|
114
|
+
retake_count?: number;
|
|
115
|
+
retaken?: number;
|
|
116
|
+
duration?: string;
|
|
117
|
+
categories?: LpTerm[];
|
|
118
|
+
tags?: LpTerm[];
|
|
119
|
+
instructor?: LpInstructor;
|
|
120
|
+
sections?: LpSection[];
|
|
121
|
+
course_data?: LpCourseUserData;
|
|
122
|
+
/** LearnPress returns false when the course does not have a rating yet. */
|
|
123
|
+
rating?: number | false;
|
|
124
|
+
price?: number;
|
|
125
|
+
price_rendered?: string;
|
|
126
|
+
origin_price?: number;
|
|
127
|
+
origin_price_rendered?: string;
|
|
128
|
+
sale_price?: number;
|
|
129
|
+
sale_price_rendered?: string;
|
|
130
|
+
meta_data?: Record<string, unknown>;
|
|
131
|
+
}
|
|
132
|
+
interface LpCoursesQuery {
|
|
133
|
+
context?: "view" | "edit";
|
|
134
|
+
page?: number;
|
|
135
|
+
per_page?: number;
|
|
136
|
+
search?: string;
|
|
137
|
+
after?: string;
|
|
138
|
+
before?: string;
|
|
139
|
+
exclude?: number | number[];
|
|
140
|
+
include?: number | number[];
|
|
141
|
+
offset?: number;
|
|
142
|
+
order?: "asc" | "desc" | "ASC" | "DESC";
|
|
143
|
+
orderby?: "date" | "id" | "include" | "title" | "slug" | "modified" | "menu_order" | "price";
|
|
144
|
+
author?: number | number[];
|
|
145
|
+
author_exclude?: number | number[];
|
|
146
|
+
/** Alias used by LearnPress to filter by course author. */
|
|
147
|
+
user?: number | number[];
|
|
148
|
+
/** Return only courses the current user has learned (requires auth). */
|
|
149
|
+
learned?: boolean;
|
|
150
|
+
parent?: number | number[];
|
|
151
|
+
parent_exclude?: number | number[];
|
|
152
|
+
category?: number | number[];
|
|
153
|
+
tag?: number | number[];
|
|
154
|
+
slug?: string | string[];
|
|
155
|
+
/** Applies only when `learned` is enabled. */
|
|
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;
|
|
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;
|
|
166
|
+
popular?: boolean;
|
|
167
|
+
/** Skip heavy fields (sections, course_data, instructor, meta_data, ...). */
|
|
168
|
+
optimize?: boolean | string;
|
|
169
|
+
}
|
|
170
|
+
interface LpTermsQuery {
|
|
171
|
+
page?: number;
|
|
172
|
+
per_page?: number;
|
|
173
|
+
search?: string;
|
|
174
|
+
order?: "asc" | "desc";
|
|
175
|
+
orderby?: string;
|
|
176
|
+
hide_empty?: boolean;
|
|
177
|
+
include?: number | number[];
|
|
178
|
+
exclude?: number | number[];
|
|
179
|
+
parent?: number;
|
|
180
|
+
post?: number;
|
|
181
|
+
slug?: string | string[];
|
|
182
|
+
}
|
|
183
|
+
interface LpCourseIdInput {
|
|
184
|
+
id: number;
|
|
185
|
+
}
|
|
186
|
+
interface LpLessonResults {
|
|
187
|
+
status?: string;
|
|
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
|
+
}
|
|
243
|
+
interface LpAssignedCourse {
|
|
244
|
+
id: number;
|
|
245
|
+
title: string;
|
|
246
|
+
slug: string;
|
|
247
|
+
content?: string;
|
|
248
|
+
author?: number;
|
|
249
|
+
}
|
|
250
|
+
interface LpAssigned {
|
|
251
|
+
course?: LpAssignedCourse;
|
|
252
|
+
}
|
|
253
|
+
interface LpLesson {
|
|
254
|
+
id: number;
|
|
255
|
+
name: string;
|
|
256
|
+
slug: string;
|
|
257
|
+
permalink: string;
|
|
258
|
+
status?: string;
|
|
259
|
+
content?: string;
|
|
260
|
+
excerpt?: string;
|
|
261
|
+
duration?: string;
|
|
262
|
+
video_intro?: string;
|
|
263
|
+
can_finish_course?: boolean;
|
|
264
|
+
results?: LpLessonResults;
|
|
265
|
+
end_time?: string;
|
|
266
|
+
assigned?: LpAssigned;
|
|
267
|
+
meta_data?: Record<string, unknown>;
|
|
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
|
+
}
|
|
284
|
+
interface LpQuizQuestion {
|
|
285
|
+
id: 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;
|
|
344
|
+
}
|
|
345
|
+
type LpQuizAnswerInput = Record<string | number, string | string[] | Record<string, string>>;
|
|
346
|
+
interface LpQuiz {
|
|
347
|
+
id: number;
|
|
348
|
+
name: string;
|
|
349
|
+
slug: string;
|
|
350
|
+
permalink: string;
|
|
351
|
+
status?: string;
|
|
352
|
+
content?: string;
|
|
353
|
+
excerpt?: string;
|
|
354
|
+
duration?: string;
|
|
355
|
+
can_finish_course?: boolean;
|
|
356
|
+
questions?: LpQuizQuestion[];
|
|
357
|
+
results?: LpQuizUserResults;
|
|
358
|
+
assigned?: LpAssigned;
|
|
359
|
+
meta_data?: Record<string, unknown>;
|
|
360
|
+
}
|
|
361
|
+
interface LpItemQuery {
|
|
362
|
+
context?: "view" | "edit";
|
|
363
|
+
page?: number;
|
|
364
|
+
per_page?: number;
|
|
365
|
+
slug?: string | string[];
|
|
366
|
+
include?: number | number[];
|
|
367
|
+
exclude?: number | number[];
|
|
368
|
+
search?: string;
|
|
369
|
+
order?: "asc" | "desc";
|
|
370
|
+
orderby?: string;
|
|
371
|
+
}
|
|
372
|
+
interface LpCourseActionResponse {
|
|
373
|
+
status?: string;
|
|
374
|
+
message?: string;
|
|
375
|
+
[key: string]: unknown;
|
|
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
|
+
}
|
|
551
|
+
//#endregion
|
|
552
|
+
//#region src/client.d.ts
|
|
553
|
+
interface ApiClientOptions {
|
|
554
|
+
/** Site base URL, e.g. https://example.com */
|
|
555
|
+
baseUrl: string;
|
|
556
|
+
/** WP REST API root path. Default: "/wp-json" */
|
|
557
|
+
restPath?: string;
|
|
558
|
+
/** WP nonce header value (X-WP-Nonce) for cookie-authed requests */
|
|
559
|
+
nonce?: string;
|
|
560
|
+
/** Bearer token — auto-prefixed with "Bearer " */
|
|
561
|
+
bearerToken?: string;
|
|
562
|
+
/** Raw Authorization header value (e.g. "Basic abc...") — takes precedence over bearerToken */
|
|
563
|
+
authorization?: string;
|
|
564
|
+
/** Extra default headers */
|
|
565
|
+
headers?: Record<string, string>;
|
|
566
|
+
/** fetch credentials mode. Default: "same-origin" */
|
|
567
|
+
credentials?: RequestCredentials;
|
|
568
|
+
/** Custom fetch implementation */
|
|
569
|
+
fetch?: typeof fetch;
|
|
570
|
+
}
|
|
571
|
+
type QueryParams = Record<string, any>;
|
|
572
|
+
interface RequestOptions {
|
|
573
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
574
|
+
query?: QueryParams;
|
|
575
|
+
body?: unknown;
|
|
576
|
+
headers?: Record<string, string>;
|
|
577
|
+
signal?: AbortSignal;
|
|
578
|
+
/** Override credentials mode for this request */
|
|
579
|
+
credentials?: RequestCredentials;
|
|
580
|
+
}
|
|
581
|
+
interface ResponseMeta<T> {
|
|
582
|
+
data: T;
|
|
583
|
+
headers: Headers;
|
|
584
|
+
/** Parsed from X-WP-Total, if present */
|
|
585
|
+
total?: number;
|
|
586
|
+
/** Parsed from X-WP-TotalPages, if present */
|
|
587
|
+
totalPages?: number;
|
|
588
|
+
}
|
|
589
|
+
declare class ApiError extends Error {
|
|
590
|
+
readonly status: number;
|
|
591
|
+
readonly code?: string | undefined;
|
|
592
|
+
readonly data?: unknown;
|
|
593
|
+
readonly response?: Response | undefined;
|
|
594
|
+
constructor(message: string, status: number, code?: string | undefined, data?: unknown, response?: Response | undefined);
|
|
595
|
+
}
|
|
596
|
+
type AuthInput = Pick<ApiClientOptions, "bearerToken" | "authorization"> | null;
|
|
597
|
+
declare class ApiClient {
|
|
598
|
+
readonly baseUrl: string;
|
|
599
|
+
readonly restPath: string;
|
|
600
|
+
private options;
|
|
601
|
+
private readonly fetchImpl;
|
|
602
|
+
constructor(options: ApiClientOptions);
|
|
603
|
+
private buildUrl;
|
|
604
|
+
private raw;
|
|
605
|
+
private parse;
|
|
606
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
607
|
+
requestWithMeta<T>(path: string, options?: RequestOptions): Promise<ResponseMeta<T>>;
|
|
608
|
+
get<T>(path: string, query?: QueryParams, opts?: Omit<RequestOptions, "method" | "query">): Promise<T>;
|
|
609
|
+
getWithMeta<T>(path: string, query?: QueryParams, opts?: Omit<RequestOptions, "method" | "query">): Promise<ResponseMeta<T>>;
|
|
610
|
+
post<T>(path: string, body?: unknown, opts?: Omit<RequestOptions, "method" | "body">): Promise<T>;
|
|
611
|
+
put<T>(path: string, body?: unknown, opts?: Omit<RequestOptions, "method" | "body">): Promise<T>;
|
|
612
|
+
patch<T>(path: string, body?: unknown, opts?: Omit<RequestOptions, "method" | "body">): Promise<T>;
|
|
613
|
+
delete<T>(path: string, opts?: Omit<RequestOptions, "method">): Promise<T>;
|
|
614
|
+
/** Update bearer token / raw Authorization at runtime. Pass `null` to clear. */
|
|
615
|
+
setAuth(auth: AuthInput): void;
|
|
616
|
+
getAuth(): {
|
|
617
|
+
bearerToken?: string;
|
|
618
|
+
authorization?: string;
|
|
619
|
+
};
|
|
620
|
+
}
|
|
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
|
|
663
|
+
//#region src/types/common.d.ts
|
|
664
|
+
interface Rendered {
|
|
665
|
+
rendered: string;
|
|
666
|
+
protected?: boolean;
|
|
667
|
+
}
|
|
668
|
+
interface PaginatedQuery {
|
|
669
|
+
page?: number;
|
|
670
|
+
per_page?: number;
|
|
671
|
+
search?: string;
|
|
672
|
+
order?: "asc" | "desc";
|
|
673
|
+
orderby?: string;
|
|
674
|
+
}
|
|
675
|
+
type ID = number | string;
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region src/endpoints/wp/types.d.ts
|
|
678
|
+
interface WpPost {
|
|
679
|
+
id: number;
|
|
680
|
+
date: string;
|
|
681
|
+
date_gmt: string;
|
|
682
|
+
modified: string;
|
|
683
|
+
modified_gmt: string;
|
|
684
|
+
slug: string;
|
|
685
|
+
status: string;
|
|
686
|
+
type: string;
|
|
687
|
+
link: string;
|
|
688
|
+
title: Rendered;
|
|
689
|
+
content: Rendered;
|
|
690
|
+
excerpt: Rendered;
|
|
691
|
+
author: number;
|
|
692
|
+
featured_media: number;
|
|
693
|
+
comment_status: "open" | "closed";
|
|
694
|
+
ping_status: "open" | "closed";
|
|
695
|
+
sticky?: boolean;
|
|
696
|
+
template?: string;
|
|
697
|
+
format?: string;
|
|
698
|
+
categories?: number[];
|
|
699
|
+
tags?: number[];
|
|
700
|
+
meta?: Record<string, unknown>;
|
|
701
|
+
_embedded?: {
|
|
702
|
+
"wp:featuredmedia"?: WpMedia[];
|
|
703
|
+
author?: WpUser[];
|
|
704
|
+
"wp:term"?: WpEmbeddedTerm[][];
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
interface WpEmbeddedTerm {
|
|
708
|
+
id: number;
|
|
709
|
+
link: string;
|
|
710
|
+
name: string;
|
|
711
|
+
slug: string;
|
|
712
|
+
taxonomy: string;
|
|
713
|
+
}
|
|
714
|
+
interface WpPage extends Omit<WpPost, "categories" | "tags" | "format" | "sticky"> {
|
|
715
|
+
parent: number;
|
|
716
|
+
menu_order: number;
|
|
717
|
+
}
|
|
718
|
+
interface WpUser {
|
|
719
|
+
id: number;
|
|
720
|
+
name: string;
|
|
721
|
+
url: string;
|
|
722
|
+
description: string;
|
|
723
|
+
link: string;
|
|
724
|
+
slug: string;
|
|
725
|
+
avatar_urls: Record<string, string>;
|
|
726
|
+
meta?: Record<string, unknown>;
|
|
727
|
+
cover_image_url?: string;
|
|
728
|
+
}
|
|
729
|
+
interface WpMedia extends WpPost {
|
|
730
|
+
alt_text: string;
|
|
731
|
+
caption: Rendered;
|
|
732
|
+
description: Rendered;
|
|
733
|
+
media_type: string;
|
|
734
|
+
mime_type: string;
|
|
735
|
+
media_details: Record<string, unknown>;
|
|
736
|
+
source_url: string;
|
|
737
|
+
}
|
|
738
|
+
interface WpComment {
|
|
739
|
+
id: number;
|
|
740
|
+
post: number;
|
|
741
|
+
parent: number;
|
|
742
|
+
author: number;
|
|
743
|
+
author_name: string;
|
|
744
|
+
author_url: string;
|
|
745
|
+
date: string;
|
|
746
|
+
content: Rendered;
|
|
747
|
+
link: string;
|
|
748
|
+
status: string;
|
|
749
|
+
type: string;
|
|
750
|
+
author_avatar_urls: Record<string, string>;
|
|
751
|
+
}
|
|
752
|
+
interface WpTerm {
|
|
753
|
+
id: number;
|
|
754
|
+
count: number;
|
|
755
|
+
description: string;
|
|
756
|
+
link: string;
|
|
757
|
+
name: string;
|
|
758
|
+
slug: string;
|
|
759
|
+
taxonomy: string;
|
|
760
|
+
parent?: number;
|
|
761
|
+
}
|
|
762
|
+
interface WpSearchResult {
|
|
763
|
+
id: number;
|
|
764
|
+
title: string;
|
|
765
|
+
url: string;
|
|
766
|
+
type: string;
|
|
767
|
+
subtype: string;
|
|
768
|
+
}
|
|
769
|
+
interface WpMenu {
|
|
770
|
+
id: number;
|
|
771
|
+
description: string;
|
|
772
|
+
name: string;
|
|
773
|
+
slug: string;
|
|
774
|
+
meta: Record<string, unknown>;
|
|
775
|
+
locations: string[];
|
|
776
|
+
auto_add: boolean;
|
|
777
|
+
}
|
|
778
|
+
interface WpMenuItem {
|
|
779
|
+
id: number;
|
|
780
|
+
title: Rendered;
|
|
781
|
+
status: string;
|
|
782
|
+
url: string;
|
|
783
|
+
attr_title: string;
|
|
784
|
+
description: string;
|
|
785
|
+
type: "taxonomy" | "post_type" | "post_type_archive" | "custom";
|
|
786
|
+
type_label: string;
|
|
787
|
+
object: string;
|
|
788
|
+
object_id: number;
|
|
789
|
+
parent: number;
|
|
790
|
+
menu_order: number;
|
|
791
|
+
target: string;
|
|
792
|
+
classes: string[];
|
|
793
|
+
xfn: string[];
|
|
794
|
+
invalid: boolean;
|
|
795
|
+
menus: number;
|
|
796
|
+
meta: Record<string, unknown>;
|
|
797
|
+
}
|
|
798
|
+
//#endregion
|
|
799
|
+
//#region src/endpoints/wp/posts.d.ts
|
|
800
|
+
interface WpPostsQuery extends PaginatedQuery {
|
|
801
|
+
author?: number | number[];
|
|
802
|
+
author_exclude?: number[];
|
|
803
|
+
categories?: number[];
|
|
804
|
+
categories_exclude?: number[];
|
|
805
|
+
tags?: number[];
|
|
806
|
+
tags_exclude?: number[];
|
|
807
|
+
slug?: string | string[];
|
|
808
|
+
exclude?: number[];
|
|
809
|
+
include?: number[];
|
|
810
|
+
sticky?: boolean;
|
|
811
|
+
before?: string;
|
|
812
|
+
after?: string;
|
|
813
|
+
_embed?: boolean;
|
|
814
|
+
}
|
|
815
|
+
//#endregion
|
|
816
|
+
//#region src/endpoints/wp/pages.d.ts
|
|
817
|
+
interface WpPagesQuery extends PaginatedQuery {
|
|
818
|
+
parent?: number[];
|
|
819
|
+
slug?: string | string[];
|
|
820
|
+
menu_order?: number;
|
|
821
|
+
_embed?: boolean;
|
|
822
|
+
}
|
|
823
|
+
//#endregion
|
|
824
|
+
//#region src/endpoints/wp/users.d.ts
|
|
825
|
+
interface WpUsersQuery extends PaginatedQuery {
|
|
826
|
+
slug?: string | string[];
|
|
827
|
+
roles?: string | string[];
|
|
828
|
+
who?: string;
|
|
829
|
+
}
|
|
830
|
+
//#endregion
|
|
831
|
+
//#region src/endpoints/wp/media.d.ts
|
|
832
|
+
interface WpMediaQuery extends PaginatedQuery {
|
|
833
|
+
media_type?: "image" | "video" | "audio" | "application" | "file";
|
|
834
|
+
mime_type?: string;
|
|
835
|
+
parent?: number[];
|
|
836
|
+
}
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region src/endpoints/wp/comments.d.ts
|
|
839
|
+
interface WpCommentsQuery extends PaginatedQuery {
|
|
840
|
+
post?: number[];
|
|
841
|
+
parent?: number[];
|
|
842
|
+
author?: number[];
|
|
843
|
+
}
|
|
844
|
+
interface WpCommentCreate {
|
|
845
|
+
post: number;
|
|
846
|
+
content: string;
|
|
847
|
+
parent?: number;
|
|
848
|
+
author_name?: string;
|
|
849
|
+
author_email?: string;
|
|
850
|
+
author_url?: string;
|
|
851
|
+
}
|
|
852
|
+
//#endregion
|
|
853
|
+
//#region src/endpoints/wp/taxonomies.d.ts
|
|
854
|
+
interface WpTermsQuery extends PaginatedQuery {
|
|
855
|
+
hide_empty?: boolean;
|
|
856
|
+
parent?: number;
|
|
857
|
+
post?: number;
|
|
858
|
+
slug?: string | string[];
|
|
859
|
+
}
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region src/endpoints/wp/search.d.ts
|
|
862
|
+
interface WpSearchQuery extends PaginatedQuery {
|
|
863
|
+
type?: "post" | "term" | "post-format";
|
|
864
|
+
subtype?: string | string[];
|
|
865
|
+
exclude?: number[];
|
|
866
|
+
include?: number[];
|
|
867
|
+
}
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region src/endpoints/wp/menus.d.ts
|
|
870
|
+
type WpMenusQuery = PaginatedQuery & {
|
|
871
|
+
slug?: string | string[];
|
|
872
|
+
};
|
|
873
|
+
interface WpMenuItemsQuery extends PaginatedQuery {
|
|
874
|
+
menus?: number[];
|
|
875
|
+
menu_order?: number;
|
|
876
|
+
parent?: number;
|
|
877
|
+
}
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region src/endpoints/wp/index.d.ts
|
|
880
|
+
declare const createWpApi: (client: ApiClient) => {
|
|
881
|
+
posts: {
|
|
882
|
+
list: (query?: WpPostsQuery) => Promise<WpPost[]>;
|
|
883
|
+
listWithMeta: (query?: WpPostsQuery) => Promise<ResponseMeta<WpPost[]>>;
|
|
884
|
+
get: (id: ID) => Promise<WpPost>;
|
|
885
|
+
getBySlug: (slug: string, query?: Omit<WpPostsQuery, "slug" | "per_page" | "page">) => Promise<WpPost | undefined>;
|
|
886
|
+
};
|
|
887
|
+
pages: {
|
|
888
|
+
list: (query?: WpPagesQuery) => Promise<WpPage[]>;
|
|
889
|
+
listWithMeta: (query?: WpPagesQuery) => Promise<ResponseMeta<WpPage[]>>;
|
|
890
|
+
get: (id: ID) => Promise<WpPage>;
|
|
891
|
+
getBySlug: (slug: string) => Promise<WpPage | undefined>;
|
|
892
|
+
};
|
|
893
|
+
users: {
|
|
894
|
+
list: (query?: WpUsersQuery) => Promise<WpUser[]>;
|
|
895
|
+
listWithMeta: (query?: WpUsersQuery) => Promise<ResponseMeta<WpUser[]>>;
|
|
896
|
+
get: (id: ID) => Promise<WpUser>;
|
|
897
|
+
};
|
|
898
|
+
media: {
|
|
899
|
+
list: (query?: WpMediaQuery) => Promise<WpMedia[]>;
|
|
900
|
+
listWithMeta: (query?: WpMediaQuery) => Promise<ResponseMeta<WpMedia[]>>;
|
|
901
|
+
get: (id: ID) => Promise<WpMedia>;
|
|
902
|
+
};
|
|
903
|
+
comments: {
|
|
904
|
+
list: (query?: WpCommentsQuery) => Promise<WpComment[]>;
|
|
905
|
+
listWithMeta: (query?: WpCommentsQuery) => Promise<ResponseMeta<WpComment[]>>;
|
|
906
|
+
get: (id: ID) => Promise<WpComment>;
|
|
907
|
+
create: (data: WpCommentCreate) => Promise<WpComment>;
|
|
908
|
+
};
|
|
909
|
+
taxonomies: {
|
|
910
|
+
categories: {
|
|
911
|
+
list: (query?: WpTermsQuery) => Promise<WpTerm[]>;
|
|
912
|
+
listWithMeta: (query?: WpTermsQuery) => Promise<ResponseMeta<WpTerm[]>>;
|
|
913
|
+
get: (id: ID) => Promise<WpTerm>;
|
|
914
|
+
getBySlug: (slug: string) => Promise<WpTerm | undefined>;
|
|
915
|
+
};
|
|
916
|
+
tags: {
|
|
917
|
+
list: (query?: WpTermsQuery) => Promise<WpTerm[]>;
|
|
918
|
+
listWithMeta: (query?: WpTermsQuery) => Promise<ResponseMeta<WpTerm[]>>;
|
|
919
|
+
get: (id: ID) => Promise<WpTerm>;
|
|
920
|
+
getBySlug: (slug: string) => Promise<WpTerm | undefined>;
|
|
921
|
+
};
|
|
922
|
+
custom: (restBase: string) => {
|
|
923
|
+
list: (query?: WpTermsQuery) => Promise<WpTerm[]>;
|
|
924
|
+
listWithMeta: (query?: WpTermsQuery) => Promise<ResponseMeta<WpTerm[]>>;
|
|
925
|
+
get: (id: ID) => Promise<WpTerm>;
|
|
926
|
+
getBySlug: (slug: string) => Promise<WpTerm | undefined>;
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
search: {
|
|
930
|
+
search: (query: WpSearchQuery) => Promise<WpSearchResult[]>;
|
|
931
|
+
searchWithMeta: (query: WpSearchQuery) => Promise<ResponseMeta<WpSearchResult[]>>;
|
|
932
|
+
};
|
|
933
|
+
menus: {
|
|
934
|
+
list: (query?: WpMenusQuery) => Promise<WpMenu[]>;
|
|
935
|
+
listWithMeta: (query?: WpMenusQuery) => Promise<ResponseMeta<WpMenu[]>>;
|
|
936
|
+
get: (id: ID) => Promise<WpMenu>;
|
|
937
|
+
};
|
|
938
|
+
menuItems: {
|
|
939
|
+
list: (query?: WpMenuItemsQuery) => Promise<WpMenuItem[]>;
|
|
940
|
+
listWithMeta: (query?: WpMenuItemsQuery) => Promise<ResponseMeta<WpMenuItem[]>>;
|
|
941
|
+
get: (id: ID) => Promise<WpMenuItem>;
|
|
942
|
+
};
|
|
943
|
+
};
|
|
944
|
+
type WpApi = ReturnType<typeof createWpApi>;
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/index.d.ts
|
|
947
|
+
interface CreateApiOptions extends ApiClientOptions {}
|
|
948
|
+
declare const createApi: (options: CreateApiOptions) => {
|
|
949
|
+
client: ApiClient;
|
|
950
|
+
wp: {
|
|
951
|
+
posts: {
|
|
952
|
+
list: (query?: WpPostsQuery) => Promise<WpPost[]>;
|
|
953
|
+
listWithMeta: (query?: WpPostsQuery) => Promise<ResponseMeta<WpPost[]>>;
|
|
954
|
+
get: (id: ID) => Promise<WpPost>;
|
|
955
|
+
getBySlug: (slug: string, query?: Omit<WpPostsQuery, "slug" | "per_page" | "page">) => Promise<WpPost | undefined>;
|
|
956
|
+
};
|
|
957
|
+
pages: {
|
|
958
|
+
list: (query?: WpPagesQuery) => Promise<WpPage[]>;
|
|
959
|
+
listWithMeta: (query?: WpPagesQuery) => Promise<ResponseMeta<WpPage[]>>;
|
|
960
|
+
get: (id: ID) => Promise<WpPage>;
|
|
961
|
+
getBySlug: (slug: string) => Promise<WpPage | undefined>;
|
|
962
|
+
};
|
|
963
|
+
users: {
|
|
964
|
+
list: (query?: WpUsersQuery) => Promise<WpUser[]>;
|
|
965
|
+
listWithMeta: (query?: WpUsersQuery) => Promise<ResponseMeta<WpUser[]>>;
|
|
966
|
+
get: (id: ID) => Promise<WpUser>;
|
|
967
|
+
};
|
|
968
|
+
media: {
|
|
969
|
+
list: (query?: WpMediaQuery) => Promise<WpMedia[]>;
|
|
970
|
+
listWithMeta: (query?: WpMediaQuery) => Promise<ResponseMeta<WpMedia[]>>;
|
|
971
|
+
get: (id: ID) => Promise<WpMedia>;
|
|
972
|
+
};
|
|
973
|
+
comments: {
|
|
974
|
+
list: (query?: WpCommentsQuery) => Promise<WpComment[]>;
|
|
975
|
+
listWithMeta: (query?: WpCommentsQuery) => Promise<ResponseMeta<WpComment[]>>;
|
|
976
|
+
get: (id: ID) => Promise<WpComment>;
|
|
977
|
+
create: (data: WpCommentCreate) => Promise<WpComment>;
|
|
978
|
+
};
|
|
979
|
+
taxonomies: {
|
|
980
|
+
categories: {
|
|
981
|
+
list: (query?: WpTermsQuery) => Promise<WpTerm[]>;
|
|
982
|
+
listWithMeta: (query?: WpTermsQuery) => Promise<ResponseMeta<WpTerm[]>>;
|
|
983
|
+
get: (id: ID) => Promise<WpTerm>;
|
|
984
|
+
getBySlug: (slug: string) => Promise<WpTerm | undefined>;
|
|
985
|
+
};
|
|
986
|
+
tags: {
|
|
987
|
+
list: (query?: WpTermsQuery) => Promise<WpTerm[]>;
|
|
988
|
+
listWithMeta: (query?: WpTermsQuery) => Promise<ResponseMeta<WpTerm[]>>;
|
|
989
|
+
get: (id: ID) => Promise<WpTerm>;
|
|
990
|
+
getBySlug: (slug: string) => Promise<WpTerm | undefined>;
|
|
991
|
+
};
|
|
992
|
+
custom: (restBase: string) => {
|
|
993
|
+
list: (query?: WpTermsQuery) => Promise<WpTerm[]>;
|
|
994
|
+
listWithMeta: (query?: WpTermsQuery) => Promise<ResponseMeta<WpTerm[]>>;
|
|
995
|
+
get: (id: ID) => Promise<WpTerm>;
|
|
996
|
+
getBySlug: (slug: string) => Promise<WpTerm | undefined>;
|
|
997
|
+
};
|
|
998
|
+
};
|
|
999
|
+
search: {
|
|
1000
|
+
search: (query: WpSearchQuery) => Promise<WpSearchResult[]>;
|
|
1001
|
+
searchWithMeta: (query: WpSearchQuery) => Promise<ResponseMeta<WpSearchResult[]>>;
|
|
1002
|
+
};
|
|
1003
|
+
menus: {
|
|
1004
|
+
list: (query?: WpMenusQuery) => Promise<WpMenu[]>;
|
|
1005
|
+
listWithMeta: (query?: WpMenusQuery) => Promise<ResponseMeta<WpMenu[]>>;
|
|
1006
|
+
get: (id: ID) => Promise<WpMenu>;
|
|
1007
|
+
};
|
|
1008
|
+
menuItems: {
|
|
1009
|
+
list: (query?: WpMenuItemsQuery) => Promise<WpMenuItem[]>;
|
|
1010
|
+
listWithMeta: (query?: WpMenuItemsQuery) => Promise<ResponseMeta<WpMenuItem[]>>;
|
|
1011
|
+
get: (id: ID) => Promise<WpMenuItem>;
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
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
|
+
};
|
|
1042
|
+
auth: {
|
|
1043
|
+
login(input: LpLoginInput): Promise<LpTokenResponse>;
|
|
1044
|
+
validate(): Promise<LpValidateResponse>;
|
|
1045
|
+
register(input: LpRegisterInput): Promise<LpTokenResponse>;
|
|
1046
|
+
logout(): void;
|
|
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
|
+
};
|
|
1061
|
+
courseCategories: {
|
|
1062
|
+
list(query?: LpTermsQuery): Promise<LpCourseCategory[]>;
|
|
1063
|
+
listWithMeta(query?: LpTermsQuery): Promise<ResponseMeta<LpCourseCategory[]>>;
|
|
1064
|
+
get(id: number): Promise<LpCourseCategory>;
|
|
1065
|
+
getBySlug(slug: string, query?: Omit<LpTermsQuery, "slug" | "page" | "per_page">): Promise<LpCourseCategory | undefined>;
|
|
1066
|
+
};
|
|
1067
|
+
courses: {
|
|
1068
|
+
list(query?: LpCoursesQuery): Promise<LpCourse[]>;
|
|
1069
|
+
listWithMeta(query?: LpCoursesQuery): Promise<ResponseMeta<LpCourse[]>>;
|
|
1070
|
+
get(id: number, query?: {
|
|
1071
|
+
context?: "view" | "edit";
|
|
1072
|
+
}): Promise<LpCourse>;
|
|
1073
|
+
getBySlug(slug: string, query?: Omit<LpCoursesQuery, "slug" | "page" | "per_page">): Promise<LpCourse | undefined>;
|
|
1074
|
+
enroll(input: LpCourseIdInput): Promise<LpCourseActionResponse>;
|
|
1075
|
+
finish(input: LpCourseIdInput): Promise<LpCourseActionResponse>;
|
|
1076
|
+
retake(input: LpCourseIdInput): Promise<LpCourseActionResponse>;
|
|
1077
|
+
};
|
|
1078
|
+
lessons: {
|
|
1079
|
+
list(query?: LpItemQuery): Promise<LpLesson[]>;
|
|
1080
|
+
get(id: number, query?: {
|
|
1081
|
+
context?: "view" | "edit";
|
|
1082
|
+
}): Promise<LpLesson>;
|
|
1083
|
+
getBySlug(slug: string, query?: Omit<LpItemQuery, "slug" | "page" | "per_page">): Promise<LpLesson | undefined>;
|
|
1084
|
+
finish(input: {
|
|
1085
|
+
id: number;
|
|
1086
|
+
}): Promise<LpCourseActionResponse>;
|
|
1087
|
+
};
|
|
1088
|
+
quizzes: {
|
|
1089
|
+
list(query?: LpItemQuery): Promise<LpQuiz[]>;
|
|
1090
|
+
get(id: number, query?: {
|
|
1091
|
+
context?: "view" | "edit";
|
|
1092
|
+
}): Promise<LpQuiz>;
|
|
1093
|
+
getBySlug(slug: string, query?: Omit<LpItemQuery, "slug" | "page" | "per_page">): Promise<LpQuiz | undefined>;
|
|
1094
|
+
start(input: {
|
|
1095
|
+
id: number;
|
|
1096
|
+
}): Promise<LpCourseActionResponse>;
|
|
1097
|
+
checkAnswer(input: {
|
|
1098
|
+
id: number;
|
|
1099
|
+
question_id: number;
|
|
1100
|
+
answered: string | string[] | Record<string, string>;
|
|
1101
|
+
}): Promise<LpQuizCheckAnswerResponse>;
|
|
1102
|
+
finish(input: {
|
|
1103
|
+
id: number;
|
|
1104
|
+
answered?: LpQuizAnswerInput;
|
|
1105
|
+
time_spend?: number;
|
|
1106
|
+
}): Promise<LpCourseActionResponse>;
|
|
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
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
type Api = ReturnType<typeof createApi>;
|
|
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
|
|
1205
|
+
//#region src/endpoints/lp/index.d.ts
|
|
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
|
+
};
|
|
1234
|
+
auth: {
|
|
1235
|
+
login(input: LpLoginInput): Promise<LpTokenResponse>;
|
|
1236
|
+
validate(): Promise<LpValidateResponse>;
|
|
1237
|
+
register(input: LpRegisterInput): Promise<LpTokenResponse>;
|
|
1238
|
+
logout(): void;
|
|
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
|
+
};
|
|
1253
|
+
courseCategories: {
|
|
1254
|
+
list(query?: LpTermsQuery): Promise<LpCourseCategory[]>;
|
|
1255
|
+
listWithMeta(query?: LpTermsQuery): Promise<ResponseMeta<LpCourseCategory[]>>;
|
|
1256
|
+
get(id: number): Promise<LpCourseCategory>;
|
|
1257
|
+
getBySlug(slug: string, query?: Omit<LpTermsQuery, "slug" | "page" | "per_page">): Promise<LpCourseCategory | undefined>;
|
|
1258
|
+
};
|
|
1259
|
+
courses: {
|
|
1260
|
+
list(query?: LpCoursesQuery): Promise<LpCourse[]>;
|
|
1261
|
+
listWithMeta(query?: LpCoursesQuery): Promise<ResponseMeta<LpCourse[]>>;
|
|
1262
|
+
get(id: number, query?: {
|
|
1263
|
+
context?: "view" | "edit";
|
|
1264
|
+
}): Promise<LpCourse>;
|
|
1265
|
+
getBySlug(slug: string, query?: Omit<LpCoursesQuery, "slug" | "page" | "per_page">): Promise<LpCourse | undefined>;
|
|
1266
|
+
enroll(input: LpCourseIdInput): Promise<LpCourseActionResponse>;
|
|
1267
|
+
finish(input: LpCourseIdInput): Promise<LpCourseActionResponse>;
|
|
1268
|
+
retake(input: LpCourseIdInput): Promise<LpCourseActionResponse>;
|
|
1269
|
+
};
|
|
1270
|
+
lessons: {
|
|
1271
|
+
list(query?: LpItemQuery): Promise<LpLesson[]>;
|
|
1272
|
+
get(id: number, query?: {
|
|
1273
|
+
context?: "view" | "edit";
|
|
1274
|
+
}): Promise<LpLesson>;
|
|
1275
|
+
getBySlug(slug: string, query?: Omit<LpItemQuery, "slug" | "page" | "per_page">): Promise<LpLesson | undefined>;
|
|
1276
|
+
finish(input: {
|
|
1277
|
+
id: number;
|
|
1278
|
+
}): Promise<LpCourseActionResponse>;
|
|
1279
|
+
};
|
|
1280
|
+
quizzes: {
|
|
1281
|
+
list(query?: LpItemQuery): Promise<LpQuiz[]>;
|
|
1282
|
+
get(id: number, query?: {
|
|
1283
|
+
context?: "view" | "edit";
|
|
1284
|
+
}): Promise<LpQuiz>;
|
|
1285
|
+
getBySlug(slug: string, query?: Omit<LpItemQuery, "slug" | "page" | "per_page">): Promise<LpQuiz | undefined>;
|
|
1286
|
+
start(input: {
|
|
1287
|
+
id: number;
|
|
1288
|
+
}): Promise<LpCourseActionResponse>;
|
|
1289
|
+
checkAnswer(input: {
|
|
1290
|
+
id: number;
|
|
1291
|
+
question_id: number;
|
|
1292
|
+
answered: string | string[] | Record<string, string>;
|
|
1293
|
+
}): Promise<LpQuizCheckAnswerResponse>;
|
|
1294
|
+
finish(input: {
|
|
1295
|
+
id: number;
|
|
1296
|
+
answered?: LpQuizAnswerInput;
|
|
1297
|
+
time_spend?: number;
|
|
1298
|
+
}): Promise<LpCourseActionResponse>;
|
|
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
|
+
};
|
|
1349
|
+
};
|
|
1350
|
+
type LpApi = ReturnType<typeof createLpApi>;
|
|
1351
|
+
//#endregion
|
|
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.cts.map
|