@learnpack/learnpack 5.0.262 → 5.0.265
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 +82 -50
- package/lib/commands/translate.js +1 -2
- package/lib/managers/server/routes.js +1 -2
- package/lib/utils/rigoActions.d.ts +6 -3
- package/lib/utils/rigoActions.js +15 -4
- package/package.json +1 -1
- package/src/commands/serve.ts +123 -72
- package/src/commands/translate.ts +8 -5
- package/src/managers/server/routes.ts +9 -7
- package/src/ui/_app/app.js +101 -101
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/rigoActions.ts +27 -5
package/src/ui/app.tar.gz
CHANGED
Binary file
|
package/src/utils/rigoActions.ts
CHANGED
@@ -117,18 +117,19 @@ export async function downloadImage(
|
|
117
117
|
type TTranslateInputs = {
|
118
118
|
text_to_translate: string
|
119
119
|
output_language: string
|
120
|
-
exercise_slug: string
|
121
120
|
}
|
122
121
|
export const translateExercise = async (
|
123
122
|
token: string,
|
124
|
-
inputs: TTranslateInputs
|
123
|
+
inputs: TTranslateInputs,
|
124
|
+
webhookUrl: string
|
125
125
|
) => {
|
126
126
|
const response = await axios.post(
|
127
|
-
`${RIGOBOT_HOST}/v1/prompting/completion/
|
127
|
+
`${RIGOBOT_HOST}/v1/prompting/completion/translate-asset-markdown/`,
|
128
128
|
{
|
129
129
|
inputs: inputs,
|
130
130
|
include_purpose_objective: false,
|
131
|
-
execute_async:
|
131
|
+
execute_async: true,
|
132
|
+
webhook_url: webhookUrl,
|
132
133
|
},
|
133
134
|
{
|
134
135
|
headers: {
|
@@ -335,7 +336,7 @@ export const translateCourseMetadata = async (
|
|
335
336
|
inputs: {
|
336
337
|
title: string
|
337
338
|
description: string
|
338
|
-
|
339
|
+
new_languages: string
|
339
340
|
}
|
340
341
|
) => {
|
341
342
|
const response = await axios.post(
|
@@ -476,3 +477,24 @@ export const isPackageAuthor = async (
|
|
476
477
|
return { isAuthor: false, status }
|
477
478
|
}
|
478
479
|
}
|
480
|
+
|
481
|
+
type TGetLanguageCodesInputs = {
|
482
|
+
raw_languages: string
|
483
|
+
}
|
484
|
+
export const getLanguageCodes = async (
|
485
|
+
token: string,
|
486
|
+
inputs: TGetLanguageCodesInputs
|
487
|
+
) => {
|
488
|
+
const response = await axios.post(
|
489
|
+
`${RIGOBOT_HOST}/v1/prompting/completion/get-language-codes/`,
|
490
|
+
{ inputs, include_purpose_objective: false, execute_async: false },
|
491
|
+
{
|
492
|
+
headers: {
|
493
|
+
"Content-Type": "application/json",
|
494
|
+
Authorization: "Token " + token,
|
495
|
+
},
|
496
|
+
}
|
497
|
+
)
|
498
|
+
|
499
|
+
return response.data
|
500
|
+
}
|