@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.
@@ -10,7 +10,7 @@
10
10
  />
11
11
 
12
12
  <title>Learnpack Creator: Craft tutorials in seconds!</title>
13
- <script type="module" crossorigin src="/creator/assets/index-BWHp9KF3.js"></script>
13
+ <script type="module" crossorigin src="/creator/assets/index-CZYzWk3G.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/creator/assets/index-DmpsXknz.css">
15
15
  </head>
16
16
  <body>
package/lib/utils/api.js CHANGED
@@ -420,7 +420,7 @@ const getCategories = async (token) => {
420
420
  const updateRigoAssetID = async (token, slug, asset_id) => {
421
421
  const url = `${exports.RIGOBOT_HOST}/v1/learnpack/package/${slug}/`;
422
422
  const headers = {
423
- Authorization: `Token ${token}`,
423
+ Authorization: `Token ${token.trim()}`,
424
424
  };
425
425
  try {
426
426
  const response = await axios_1.default.put(url, { asset_id }, { headers });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@learnpack/learnpack",
3
3
  "description": "Seamlessly build, sell and/or take interactive & auto-graded tutorials, start learning now or build a new tutorial to your audience.",
4
- "version": "5.0.244",
4
+ "version": "5.0.246",
5
5
  "author": "Alejandro Sanchez @alesanchezr",
6
6
  "contributors": [
7
7
  {
@@ -219,7 +219,7 @@ const createMultiLangAsset = async (
219
219
 
220
220
  // eslint-disable-next-line no-await-in-loop
221
221
  const asset = await handleAssetCreation(
222
- { token: bcToken, rigobotToken: rigoToken },
222
+ { token: bcToken, rigobotToken: rigoToken.trim() },
223
223
  courseJson,
224
224
  lang,
225
225
  deployUrl,
@@ -229,12 +229,6 @@ const createMultiLangAsset = async (
229
229
 
230
230
  all_translations.push(asset.slug)
231
231
  }
232
- // const languageCodes = new Set(languageCodes)
233
- // const asset = await api.createAsset(rigoToken, {
234
- // slug: courseSlug,
235
- // title: courseJson.title,
236
- // description: courseJson.description,
237
- // })
238
232
  }
239
233
 
240
234
  async function startExerciseGeneration(
@@ -1399,6 +1393,7 @@ export default class ServeCommand extends SessionCommand {
1399
1393
  app.post("/actions/publish/:slug", async (req, res) => {
1400
1394
  try {
1401
1395
  const { slug } = req.params
1396
+ const { currentLanguage } = req.body
1402
1397
  const rigoToken = req.header("x-rigo-token")
1403
1398
  const bcToken = req.header("x-breathecode-token")
1404
1399
  // const { academyId, categoryId } = req.body
@@ -1414,8 +1409,6 @@ export default class ServeCommand extends SessionCommand {
1414
1409
  slug
1415
1410
  )
1416
1411
 
1417
- // const fixedSlug = fixSlugLength(slug)
1418
-
1419
1412
  const prefix = `courses/${slug}/`
1420
1413
  const tmpRoot = path.join(os.tmpdir(), `learnpack-${slug}`)
1421
1414
  const buildRoot = path.join(tmpRoot, "build")
@@ -1518,7 +1511,7 @@ export default class ServeCommand extends SessionCommand {
1518
1511
  {
1519
1512
  headers: {
1520
1513
  ...form.getHeaders(),
1521
- Authorization: `Token ${rigoToken.trim()}`,
1514
+ Authorization: "Token " + rigoToken.trim(),
1522
1515
  },
1523
1516
  }
1524
1517
  )
@@ -212,9 +212,7 @@ const SyllabusEditor: React.FC = () => {
212
212
 
213
213
  const timeout = setTimeout(() => {
214
214
  cleanAll()
215
- window.location.href = `/preview/${slugify(
216
- syllabus.courseInfo.title || ""
217
- )}?token=${auth.bcToken}&language=${syllabus.courseInfo.language}`
215
+ window.location.href = `/preview/${syllabus.courseInfo.slug}?token=${auth.bcToken}&language=${syllabus.courseInfo.language}`
218
216
  }, 8000)
219
217
  try {
220
218
  await createCourse(syllabus, tokenToUse, auth.bcToken)
@@ -19,8 +19,9 @@ export const publicInteractiveCreation = async (
19
19
  const webhookUrl = `${
20
20
  DEV_MODE
21
21
  ? "https://9cw5zmww-3000.use2.devtunnels.ms"
22
- : window.location.origin
23
- // "https://9cw5zmww-3000.use2.devtunnels.ms"
22
+ : // TODO: remove this
23
+ // : window.location.origin
24
+ "https://9cw5zmww-3000.use2.devtunnels.ms"
24
25
  }/notifications/${randomUID}`
25
26
 
26
27
  const response = await axios.post(