@packt/rustici-sdk
Advanced tools
Comparing version 1.2.0 to 1.3.0
import ClientFactory from "../clients/clientFactory"; | ||
import IResponse from "../interfaces/response-interface"; | ||
import ICourseList from "../interfaces/rustici-course-list-interface"; | ||
import IExportCourseResponse from "../interfaces/export-course-response-interface"; | ||
import IExportCourseRequestBody from "../interfaces/export-course-request-body-interface"; | ||
import ICourseUploadProgressResponse from "../interfaces/course-upload-progress-response-interface"; | ||
import ILaunchLinkRequest from "../interfaces/rustici-launch-link-request-interface"; | ||
import ILaunchLink from "../interfaces/rustici-launch-link-interface"; | ||
export default class Courses { | ||
@@ -12,2 +17,24 @@ private client; | ||
get(): Promise<IResponse<ICourseList>>; | ||
/** | ||
* Export the course into Rustici engine | ||
* @param courseId | ||
* @param body | ||
* @param mayCreateNewVersion | ||
* @returns {Promise<IResponse<IExportCourseResponse>>} | ||
*/ | ||
exportCourse(courseId: string, body: IExportCourseRequestBody, mayCreateNewVersion?: boolean): Promise<IResponse<IExportCourseResponse>>; | ||
/** | ||
* Gets course upload progress | ||
* @param importJobId | ||
* @returns {Promise<IResponse<ICourseUploadProgressResponse>>} | ||
*/ | ||
getCourseUploadProgress(importJobId: string): Promise<IResponse<ICourseUploadProgressResponse>>; | ||
/** | ||
* Gets the course preview link against | ||
* course id. | ||
* @param courseId | ||
* @param body | ||
* @returns { Promise<IResponse<ILaunchLink>> } | ||
*/ | ||
getCoursePreviewLink(courseId: string, body: ILaunchLinkRequest): Promise<IResponse<ILaunchLink>>; | ||
} |
@@ -24,4 +24,38 @@ "use strict"; | ||
} | ||
/** | ||
* Export the course into Rustici engine | ||
* @param courseId | ||
* @param body | ||
* @param mayCreateNewVersion | ||
* @returns {Promise<IResponse<IExportCourseResponse>>} | ||
*/ | ||
exportCourse(courseId, body, mayCreateNewVersion = true) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.client.postRequest(`/courses/importJobs?courseId=${courseId}&mayCreateNewVersion=${mayCreateNewVersion}`, body); | ||
}); | ||
} | ||
/** | ||
* Gets course upload progress | ||
* @param importJobId | ||
* @returns {Promise<IResponse<ICourseUploadProgressResponse>>} | ||
*/ | ||
getCourseUploadProgress(importJobId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.client.getRequest(`/courses/importJobs/${importJobId}`); | ||
}); | ||
} | ||
/** | ||
* Gets the course preview link against | ||
* course id. | ||
* @param courseId | ||
* @param body | ||
* @returns { Promise<IResponse<ILaunchLink>> } | ||
*/ | ||
getCoursePreviewLink(courseId, body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.client.postRequest(`/courses/${courseId}/preview`, body); | ||
}); | ||
} | ||
} | ||
exports.default = Courses; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291cnNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tb2RlbHMvY291cnNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBSUEsTUFBcUIsT0FBTztJQUcxQixZQUFZLGFBQTRCO1FBQ3RDLElBQUksQ0FBQyxNQUFNLEdBQUcsYUFBYSxDQUFDO0lBQzlCLENBQUM7SUFFRDs7O09BR0c7SUFDVSxHQUFHOztZQUNkLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQWMsVUFBVSxDQUFDLENBQUM7UUFDekQsQ0FBQztLQUFBO0NBQ0Y7QUFkRCwwQkFjQyJ9 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291cnNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tb2RlbHMvY291cnNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBU0EsTUFBcUIsT0FBTztJQUcxQixZQUFZLGFBQTRCO1FBQ3RDLElBQUksQ0FBQyxNQUFNLEdBQUcsYUFBYSxDQUFDO0lBQzlCLENBQUM7SUFFRDs7O09BR0c7SUFDVSxHQUFHOztZQUNkLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQWMsVUFBVSxDQUFDLENBQUM7UUFDekQsQ0FBQztLQUFBO0lBRUQ7Ozs7OztPQU1HO0lBQ1UsWUFBWSxDQUFDLFFBQWdCLEVBQUUsSUFBOEIsRUFBRSxzQkFBK0IsSUFBSTs7WUFDN0csT0FBTyxJQUFJLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FDNUIsZ0NBQWdDLFFBQVEsd0JBQXdCLG1CQUFtQixFQUFFLEVBQ3JGLElBQUksQ0FDTCxDQUFDO1FBQ0osQ0FBQztLQUFBO0lBRUQ7Ozs7T0FJRztJQUNVLHVCQUF1QixDQUFDLFdBQW1COztZQUN0RCxPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsVUFBVSxDQUFnQyx1QkFBdUIsV0FBVyxFQUFFLENBQUMsQ0FBQztRQUNyRyxDQUFDO0tBQUE7SUFFRDs7Ozs7O09BTUc7SUFDVSxvQkFBb0IsQ0FBQyxRQUFnQixFQUFFLElBQXdCOztZQUMxRSxPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLFlBQVksUUFBUSxVQUFVLEVBQUUsSUFBSSxDQUFDLENBQUM7UUFDdkUsQ0FBQztLQUFBO0NBQ0Y7QUFoREQsMEJBZ0RDIn0= |
{ | ||
"name": "@packt/rustici-sdk", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Wrapper for Rustici API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50296
45
817