@selfcommunity/api-services 0.6.4-courses.211 → 0.6.4-courses.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { SCCourseCommentType, SCCourseLessonType, SCCourseSectionType, SCCourseType, SCUserType } from '@selfcommunity/types';
2
2
  import { AxiosRequestConfig } from 'axios';
3
- import { BaseGetParams, BaseSearchParams, CourseCreateParams, CourseDashboardUsersParams, CourseInfoParams, CourseLessonCommentsParams, CourseSearchParams, CourseUserRoleParams, CourseUsersParams, SCPaginatedResponse } from '../../types';
3
+ import { BaseGetParams, CourseCreateParams, CourseDashboardUsersParams, CourseInfoParams, CourseLessonCommentsParams, CourseSearchParams, CourseUserRoleParams, CourseUsersParams, SCPaginatedResponse } from '../../types';
4
4
  import { CourseSectionParams, CourseUserParams } from '../../types/course';
5
5
  export interface CourseApiClientInterface {
6
6
  changeCourseUserRole(id: number | string, data: CourseUserRoleParams, config?: AxiosRequestConfig): Promise<any>;
7
7
  getJoinedCourses(params?: CourseUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
8
- getUserJoinedCourses(id: number | string, params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
8
+ getUserJoinedCourses(id: number | string, params?: CourseUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
9
9
  searchCourses(params?: CourseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
10
10
  getSpecificCourseInfo(id: number | string, params?: CourseInfoParams, config?: AxiosRequestConfig): Promise<SCCourseType>;
11
11
  getCourseDashboardUsers(id: number | string, params?: CourseDashboardUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
@@ -71,9 +71,10 @@ export declare class CourseApiClient {
71
71
  /**
72
72
  * This endpoint retrieves a specific course.
73
73
  * @param id
74
+ * @param params
74
75
  * @param config
75
76
  */
76
- static getUserJoinedCourses(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
77
+ static getUserJoinedCourses(id: number | string, params?: CourseUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
77
78
  /**
78
79
  * This endpoint performs events search
79
80
  * @param params
@@ -401,7 +402,7 @@ export declare class CourseApiClient {
401
402
  export default class CourseService {
402
403
  static changeCourseUserRole(id: number | string, data: CourseUserRoleParams, config?: AxiosRequestConfig): Promise<any>;
403
404
  static getJoinedCourses(params?: CourseUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
404
- static getUserJoinedCourses(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
405
+ static getUserJoinedCourses(id: number | string, params?: CourseUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
405
406
  static searchCourses(params?: CourseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
406
407
  static getSpecificCourseInfo(id: number | string, params?: CourseInfoParams, config?: AxiosRequestConfig): Promise<SCCourseType>;
407
408
  static getCourseDashboardUsers(id: number | string, params?: CourseDashboardUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
@@ -30,10 +30,11 @@ class CourseApiClient {
30
30
  /**
31
31
  * This endpoint retrieves a specific course.
32
32
  * @param id
33
+ * @param params
33
34
  * @param config
34
35
  */
35
- static getUserJoinedCourses(id, config) {
36
- return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GetUserJoinedCourses.url({ id }), method: Endpoints_1.default.GetUserJoinedCourses.method }));
36
+ static getUserJoinedCourses(id, params, config) {
37
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { params, url: Endpoints_1.default.GetUserJoinedCourses.url({ id }), method: Endpoints_1.default.GetUserJoinedCourses.method }));
37
38
  }
38
39
  /**
39
40
  * This endpoint performs events search
@@ -444,9 +445,9 @@ class CourseService {
444
445
  return CourseApiClient.getJoinedCourses(params, config);
445
446
  });
446
447
  }
447
- static getUserJoinedCourses(id, config) {
448
+ static getUserJoinedCourses(id, params, config) {
448
449
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
449
- return CourseApiClient.getUserJoinedCourses(id, config);
450
+ return CourseApiClient.getUserJoinedCourses(id, params, config);
450
451
  });
451
452
  }
452
453
  static searchCourses(params, config) {
@@ -35,14 +35,14 @@ export interface CourseSectionParams {
35
35
  * CourseUserParams interface.
36
36
  */
37
37
  export interface CourseUserParams extends BaseGetParams {
38
- /**
39
- * Filter results by subscription_status
40
- */
41
- join_status?: SCCourseJoinStatusType;
42
38
  /**
43
39
  * Return only courses created by this user id
44
40
  */
45
41
  created_by?: number;
42
+ /**
43
+ * Filter by join_status; default: ["manager", "joined"]
44
+ */
45
+ statuses?: SCCourseJoinStatusType[] | SCCourseJoinStatusType;
46
46
  }
47
47
  /**
48
48
  * CourseSearchParams interface.
@@ -110,7 +110,7 @@ export interface CourseUsersParams extends BaseGetParams {
110
110
  * Filter by join_status; default: ["manager", "joined"].
111
111
  * Only creator, manager and joined are valid status for this route
112
112
  */
113
- statuses?: SCCourseJoinStatusType[];
113
+ statuses?: SCCourseJoinStatusType[] | SCCourseJoinStatusType;
114
114
  }
115
115
  /**
116
116
  * CourseDashboardUsersParams interface.
@@ -1,11 +1,11 @@
1
1
  import { SCCourseCommentType, SCCourseLessonType, SCCourseSectionType, SCCourseType, SCUserType } from '@selfcommunity/types';
2
2
  import { AxiosRequestConfig } from 'axios';
3
- import { BaseGetParams, BaseSearchParams, CourseCreateParams, CourseDashboardUsersParams, CourseInfoParams, CourseLessonCommentsParams, CourseSearchParams, CourseUserRoleParams, CourseUsersParams, SCPaginatedResponse } from '../../types';
3
+ import { BaseGetParams, CourseCreateParams, CourseDashboardUsersParams, CourseInfoParams, CourseLessonCommentsParams, CourseSearchParams, CourseUserRoleParams, CourseUsersParams, SCPaginatedResponse } from '../../types';
4
4
  import { CourseSectionParams, CourseUserParams } from '../../types/course';
5
5
  export interface CourseApiClientInterface {
6
6
  changeCourseUserRole(id: number | string, data: CourseUserRoleParams, config?: AxiosRequestConfig): Promise<any>;
7
7
  getJoinedCourses(params?: CourseUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
8
- getUserJoinedCourses(id: number | string, params?: BaseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
8
+ getUserJoinedCourses(id: number | string, params?: CourseUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
9
9
  searchCourses(params?: CourseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
10
10
  getSpecificCourseInfo(id: number | string, params?: CourseInfoParams, config?: AxiosRequestConfig): Promise<SCCourseType>;
11
11
  getCourseDashboardUsers(id: number | string, params?: CourseDashboardUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
@@ -71,9 +71,10 @@ export declare class CourseApiClient {
71
71
  /**
72
72
  * This endpoint retrieves a specific course.
73
73
  * @param id
74
+ * @param params
74
75
  * @param config
75
76
  */
76
- static getUserJoinedCourses(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
77
+ static getUserJoinedCourses(id: number | string, params?: CourseUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
77
78
  /**
78
79
  * This endpoint performs events search
79
80
  * @param params
@@ -401,7 +402,7 @@ export declare class CourseApiClient {
401
402
  export default class CourseService {
402
403
  static changeCourseUserRole(id: number | string, data: CourseUserRoleParams, config?: AxiosRequestConfig): Promise<any>;
403
404
  static getJoinedCourses(params?: CourseUserParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
404
- static getUserJoinedCourses(id: number | string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
405
+ static getUserJoinedCourses(id: number | string, params?: CourseUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
405
406
  static searchCourses(params?: CourseSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCourseType>>;
406
407
  static getSpecificCourseInfo(id: number | string, params?: CourseInfoParams, config?: AxiosRequestConfig): Promise<SCCourseType>;
407
408
  static getCourseDashboardUsers(id: number | string, params?: CourseDashboardUsersParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserType>>;
@@ -27,10 +27,11 @@ export class CourseApiClient {
27
27
  /**
28
28
  * This endpoint retrieves a specific course.
29
29
  * @param id
30
+ * @param params
30
31
  * @param config
31
32
  */
32
- static getUserJoinedCourses(id, config) {
33
- return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetUserJoinedCourses.url({ id }), method: Endpoints.GetUserJoinedCourses.method }));
33
+ static getUserJoinedCourses(id, params, config) {
34
+ return apiRequest(Object.assign(Object.assign({}, config), { params, url: Endpoints.GetUserJoinedCourses.url({ id }), method: Endpoints.GetUserJoinedCourses.method }));
34
35
  }
35
36
  /**
36
37
  * This endpoint performs events search
@@ -440,9 +441,9 @@ export default class CourseService {
440
441
  return CourseApiClient.getJoinedCourses(params, config);
441
442
  });
442
443
  }
443
- static getUserJoinedCourses(id, config) {
444
+ static getUserJoinedCourses(id, params, config) {
444
445
  return __awaiter(this, void 0, void 0, function* () {
445
- return CourseApiClient.getUserJoinedCourses(id, config);
446
+ return CourseApiClient.getUserJoinedCourses(id, params, config);
446
447
  });
447
448
  }
448
449
  static searchCourses(params, config) {
@@ -35,14 +35,14 @@ export interface CourseSectionParams {
35
35
  * CourseUserParams interface.
36
36
  */
37
37
  export interface CourseUserParams extends BaseGetParams {
38
- /**
39
- * Filter results by subscription_status
40
- */
41
- join_status?: SCCourseJoinStatusType;
42
38
  /**
43
39
  * Return only courses created by this user id
44
40
  */
45
41
  created_by?: number;
42
+ /**
43
+ * Filter by join_status; default: ["manager", "joined"]
44
+ */
45
+ statuses?: SCCourseJoinStatusType[] | SCCourseJoinStatusType;
46
46
  }
47
47
  /**
48
48
  * CourseSearchParams interface.
@@ -110,7 +110,7 @@ export interface CourseUsersParams extends BaseGetParams {
110
110
  * Filter by join_status; default: ["manager", "joined"].
111
111
  * Only creator, manager and joined are valid status for this route
112
112
  */
113
- statuses?: SCCourseJoinStatusType[];
113
+ statuses?: SCCourseJoinStatusType[] | SCCourseJoinStatusType;
114
114
  }
115
115
  /**
116
116
  * CourseDashboardUsersParams interface.