@learnpack/learnpack 5.0.244 → 5.0.246
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/lib/commands/serve.js +3 -9
- package/lib/creatorDist/assets/{index-BWHp9KF3.js → index-CZYzWk3G.js} +1094 -1100
- package/lib/creatorDist/index.html +1 -1
- package/lib/utils/api.js +1 -1
- package/package.json +1 -1
- package/src/commands/serve.ts +3 -10
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +1 -3
- package/src/creator/src/utils/rigo.ts +3 -2
- package/src/creatorDist/assets/{index-BWHp9KF3.js → index-CZYzWk3G.js} +1094 -1100
- package/src/creatorDist/index.html +1 -1
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +347 -347
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +1 -1
package/lib/commands/serve.js
CHANGED
@@ -132,15 +132,9 @@ const createMultiLangAsset = async (bucket, rigoToken, bcToken, courseSlug, cour
|
|
132
132
|
const indexReadmeString = indexReadmeContent.toString();
|
133
133
|
const b64IndexReadme = Buffer.from(indexReadmeString).toString("base64");
|
134
134
|
// eslint-disable-next-line no-await-in-loop
|
135
|
-
const asset = await (0, publish_1.handleAssetCreation)({ token: bcToken, rigobotToken: rigoToken }, courseJson, lang, deployUrl, b64IndexReadme, all_translations);
|
135
|
+
const asset = await (0, publish_1.handleAssetCreation)({ token: bcToken, rigobotToken: rigoToken.trim() }, courseJson, lang, deployUrl, b64IndexReadme, all_translations);
|
136
136
|
all_translations.push(asset.slug);
|
137
137
|
}
|
138
|
-
// const languageCodes = new Set(languageCodes)
|
139
|
-
// const asset = await api.createAsset(rigoToken, {
|
140
|
-
// slug: courseSlug,
|
141
|
-
// title: courseJson.title,
|
142
|
-
// description: courseJson.description,
|
143
|
-
// })
|
144
138
|
};
|
145
139
|
async function startExerciseGeneration(bucket, rigoToken, steps, packageContext, exercise, tutorialDir, courseSlug, purposeSlug, lastLesson = "") {
|
146
140
|
const exSlug = (0, creatorUtilities_2.slugify)(exercise.id + "-" + exercise.title);
|
@@ -892,6 +886,7 @@ class ServeCommand extends SessionCommand_1.default {
|
|
892
886
|
app.post("/actions/publish/:slug", async (req, res) => {
|
893
887
|
try {
|
894
888
|
const { slug } = req.params;
|
889
|
+
const { currentLanguage } = req.body;
|
895
890
|
const rigoToken = req.header("x-rigo-token");
|
896
891
|
const bcToken = req.header("x-breathecode-token");
|
897
892
|
// const { academyId, categoryId } = req.body
|
@@ -901,7 +896,6 @@ class ServeCommand extends SessionCommand_1.default {
|
|
901
896
|
.json({ error: "Authentication failed, missing tokens" });
|
902
897
|
}
|
903
898
|
const { config, exercises } = await (0, configBuilder_1.buildConfig)(bucket, slug);
|
904
|
-
// const fixedSlug = fixSlugLength(slug)
|
905
899
|
const prefix = `courses/${slug}/`;
|
906
900
|
const tmpRoot = path.join(os.tmpdir(), `learnpack-${slug}`);
|
907
901
|
const buildRoot = path.join(tmpRoot, "build");
|
@@ -976,7 +970,7 @@ class ServeCommand extends SessionCommand_1.default {
|
|
976
970
|
form.append("file", fs.createReadStream(zipPath));
|
977
971
|
form.append("config", JSON.stringify(config));
|
978
972
|
const rigoRes = await axios_1.default.post(`${api_1.RIGOBOT_HOST}/v1/learnpack/upload`, form, {
|
979
|
-
headers: Object.assign(Object.assign({}, form.getHeaders()), { Authorization:
|
973
|
+
headers: Object.assign(Object.assign({}, form.getHeaders()), { Authorization: "Token " + rigoToken.trim() }),
|
980
974
|
});
|
981
975
|
await createMultiLangAsset(bucket, rigoToken, bcToken, slug, fullConfig.config, rigoRes.data.url);
|
982
976
|
rimraf.sync(tmpRoot);
|