@stackfactor/client-api 1.1.201 → 1.1.203
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/cjs/labSessions.d.ts +1 -9
- package/dist/cjs/labSessions.d.ts.map +1 -1
- package/dist/cjs/labSessions.js +4 -29
- package/dist/cjs/labSessions.js.map +1 -1
- package/dist/esm/labSessions.d.ts +1 -9
- package/dist/esm/labSessions.d.ts.map +1 -1
- package/dist/esm/labSessions.js +2 -27
- package/dist/esm/labSessions.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
interface ProgressData {
|
|
2
2
|
progress: object;
|
|
3
3
|
}
|
|
4
|
-
/**
|
|
5
|
-
* Create a new lab session
|
|
6
|
-
* @param {String} learningContentId - The id of the learning content associated with the lab session
|
|
7
|
-
* @param {String} learningContentMicroSkillId - The id of the micro-skill associated with the learning content
|
|
8
|
-
* @param {String} labId - The id of the lab from the learning content microskill associated with the lab session
|
|
9
|
-
* @param {String} token Authorization token
|
|
10
|
-
*/
|
|
11
|
-
export declare const createLabSession: (learningContentId: string, learningContentMicroSkillId: string, labId: string, token: string) => Promise<object>;
|
|
12
4
|
/**
|
|
13
5
|
* Delete lab session
|
|
14
6
|
* @param {String} id The id of the lab session to be deleted
|
|
@@ -29,6 +21,6 @@ export declare const getLabSessionReadiness: (id: string, token: string) => Prom
|
|
|
29
21
|
* @param {Function} onProgressStatus - Callback function for real-time progress updates
|
|
30
22
|
* @returns {Promise<object>}
|
|
31
23
|
*/
|
|
32
|
-
export declare const launchLabSession: (id: string, token: string, onProgressStatus?: ((progress: ProgressData) => void) | null) => Promise<object>;
|
|
24
|
+
export declare const launchLabSession: (id: string, mode: "default" | "preview" | undefined, token: string, onProgressStatus?: ((progress: ProgressData) => void) | null) => Promise<object>;
|
|
33
25
|
export {};
|
|
34
26
|
//# sourceMappingURL=labSessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labSessions.d.ts","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"labSessions.d.ts","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":"AAUA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OACvB,MAAM,SACH,MAAM,KACZ,OAAO,CAAC,MAAM,CAgBhB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,OAC7B,MAAM,SACH,MAAM,KACZ,OAAO,CAAC,MAAM,CAahB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,OACvB,MAAM,QACJ,SAAS,GAAG,SAAS,qBACpB,MAAM,qBACK,CAAC,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,IAAI,KAC1D,OAAO,CAAC,MAAM,CAwChB,CAAC"}
|
package/dist/cjs/labSessions.js
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.launchLabSession = exports.getLabSessionReadiness = exports.deleteLabSession =
|
|
3
|
+
exports.launchLabSession = exports.getLabSessionReadiness = exports.deleteLabSession = void 0;
|
|
4
4
|
var axiosClient_js_1 = require("./axiosClient.js");
|
|
5
5
|
var utils_js_1 = require("./utils.js");
|
|
6
6
|
var socket_io_client_1 = require("socket.io-client");
|
|
7
|
-
/**
|
|
8
|
-
* Create a new lab session
|
|
9
|
-
* @param {String} learningContentId - The id of the learning content associated with the lab session
|
|
10
|
-
* @param {String} learningContentMicroSkillId - The id of the micro-skill associated with the learning content
|
|
11
|
-
* @param {String} labId - The id of the lab from the learning content microskill associated with the lab session
|
|
12
|
-
* @param {String} token Authorization token
|
|
13
|
-
*/
|
|
14
|
-
var createLabSession = function (learningContentId, learningContentMicroSkillId, labId, token) {
|
|
15
|
-
return new Promise(function (resolve, reject) {
|
|
16
|
-
var requestData = {
|
|
17
|
-
learningContentId: learningContentId,
|
|
18
|
-
learningContentMicroSkillId: learningContentMicroSkillId,
|
|
19
|
-
labId: labId,
|
|
20
|
-
};
|
|
21
|
-
var confirmationRequest = axiosClient_js_1.client.put("/api/v1/labsessions/", requestData, {
|
|
22
|
-
headers: { authorization: token },
|
|
23
|
-
});
|
|
24
|
-
confirmationRequest
|
|
25
|
-
.then(function (response) {
|
|
26
|
-
resolve(response.data);
|
|
27
|
-
})
|
|
28
|
-
.catch(function (error) {
|
|
29
|
-
reject(error);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.createLabSession = createLabSession;
|
|
34
7
|
/**
|
|
35
8
|
* Delete lab session
|
|
36
9
|
* @param {String} id The id of the lab session to be deleted
|
|
@@ -82,12 +55,14 @@ exports.getLabSessionReadiness = getLabSessionReadiness;
|
|
|
82
55
|
* @param {Function} onProgressStatus - Callback function for real-time progress updates
|
|
83
56
|
* @returns {Promise<object>}
|
|
84
57
|
*/
|
|
85
|
-
var launchLabSession = function (id, token, onProgressStatus) {
|
|
58
|
+
var launchLabSession = function (id, mode, token, onProgressStatus) {
|
|
59
|
+
if (mode === void 0) { mode = "default"; }
|
|
86
60
|
if (onProgressStatus === void 0) { onProgressStatus = null; }
|
|
87
61
|
return new Promise(function (resolve, reject) {
|
|
88
62
|
// Prepare data
|
|
89
63
|
var requestData = {
|
|
90
64
|
id: id,
|
|
65
|
+
mode: mode,
|
|
91
66
|
};
|
|
92
67
|
// Use socket.io for real-time progress updates
|
|
93
68
|
var socket = (0, socket_io_client_1.io)((0, utils_js_1.getBaseUrl)(), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labSessions.js","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":";;;AACA,mDAA0C;AAC1C,uCAAwC;AACxC,qDAAsC;
|
|
1
|
+
{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ACtC,MAAM,CAAC,IAAI,KAAK,CAAC,+BAAwB,MAAM,CAAE,CAAC,CAAC,CAAC;YACtD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA7CW,QAAA,gBAAgB,oBA6C3B"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
interface ProgressData {
|
|
2
2
|
progress: object;
|
|
3
3
|
}
|
|
4
|
-
/**
|
|
5
|
-
* Create a new lab session
|
|
6
|
-
* @param {String} learningContentId - The id of the learning content associated with the lab session
|
|
7
|
-
* @param {String} learningContentMicroSkillId - The id of the micro-skill associated with the learning content
|
|
8
|
-
* @param {String} labId - The id of the lab from the learning content microskill associated with the lab session
|
|
9
|
-
* @param {String} token Authorization token
|
|
10
|
-
*/
|
|
11
|
-
export declare const createLabSession: (learningContentId: string, learningContentMicroSkillId: string, labId: string, token: string) => Promise<object>;
|
|
12
4
|
/**
|
|
13
5
|
* Delete lab session
|
|
14
6
|
* @param {String} id The id of the lab session to be deleted
|
|
@@ -29,6 +21,6 @@ export declare const getLabSessionReadiness: (id: string, token: string) => Prom
|
|
|
29
21
|
* @param {Function} onProgressStatus - Callback function for real-time progress updates
|
|
30
22
|
* @returns {Promise<object>}
|
|
31
23
|
*/
|
|
32
|
-
export declare const launchLabSession: (id: string, token: string, onProgressStatus?: ((progress: ProgressData) => void) | null) => Promise<object>;
|
|
24
|
+
export declare const launchLabSession: (id: string, mode: "default" | "preview" | undefined, token: string, onProgressStatus?: ((progress: ProgressData) => void) | null) => Promise<object>;
|
|
33
25
|
export {};
|
|
34
26
|
//# sourceMappingURL=labSessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labSessions.d.ts","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"labSessions.d.ts","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":"AAUA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OACvB,MAAM,SACH,MAAM,KACZ,OAAO,CAAC,MAAM,CAgBhB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,OAC7B,MAAM,SACH,MAAM,KACZ,OAAO,CAAC,MAAM,CAahB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,OACvB,MAAM,QACJ,SAAS,GAAG,SAAS,qBACpB,MAAM,qBACK,CAAC,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,IAAI,KAC1D,OAAO,CAAC,MAAM,CAwChB,CAAC"}
|
package/dist/esm/labSessions.js
CHANGED
|
@@ -1,32 +1,6 @@
|
|
|
1
1
|
import { client } from "./axiosClient.js";
|
|
2
2
|
import { getBaseUrl } from "./utils.js";
|
|
3
3
|
import { io } from "socket.io-client";
|
|
4
|
-
/**
|
|
5
|
-
* Create a new lab session
|
|
6
|
-
* @param {String} learningContentId - The id of the learning content associated with the lab session
|
|
7
|
-
* @param {String} learningContentMicroSkillId - The id of the micro-skill associated with the learning content
|
|
8
|
-
* @param {String} labId - The id of the lab from the learning content microskill associated with the lab session
|
|
9
|
-
* @param {String} token Authorization token
|
|
10
|
-
*/
|
|
11
|
-
export const createLabSession = (learningContentId, learningContentMicroSkillId, labId, token) => {
|
|
12
|
-
return new Promise((resolve, reject) => {
|
|
13
|
-
const requestData = {
|
|
14
|
-
learningContentId,
|
|
15
|
-
learningContentMicroSkillId,
|
|
16
|
-
labId,
|
|
17
|
-
};
|
|
18
|
-
const confirmationRequest = client.put("/api/v1/labsessions/", requestData, {
|
|
19
|
-
headers: { authorization: token },
|
|
20
|
-
});
|
|
21
|
-
confirmationRequest
|
|
22
|
-
.then((response) => {
|
|
23
|
-
resolve(response.data);
|
|
24
|
-
})
|
|
25
|
-
.catch((error) => {
|
|
26
|
-
reject(error);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
4
|
/**
|
|
31
5
|
* Delete lab session
|
|
32
6
|
* @param {String} id The id of the lab session to be deleted
|
|
@@ -76,11 +50,12 @@ export const getLabSessionReadiness = (id, token) => {
|
|
|
76
50
|
* @param {Function} onProgressStatus - Callback function for real-time progress updates
|
|
77
51
|
* @returns {Promise<object>}
|
|
78
52
|
*/
|
|
79
|
-
export const launchLabSession = (id, token, onProgressStatus = null) => {
|
|
53
|
+
export const launchLabSession = (id, mode = "default", token, onProgressStatus = null) => {
|
|
80
54
|
return new Promise((resolve, reject) => {
|
|
81
55
|
// Prepare data
|
|
82
56
|
const requestData = {
|
|
83
57
|
id,
|
|
58
|
+
mode,
|
|
84
59
|
};
|
|
85
60
|
// Use socket.io for real-time progress updates
|
|
86
61
|
const socket = io(getBaseUrl(), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labSessions.js","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"labSessions.js","sourceRoot":"","sources":["../../src/lib/labSessions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAWtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,EAAU,EACV,KAAa,EACI,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE;YACpD,OAAO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