@learnpack/learnpack 5.0.238 → 5.0.240

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/src/ui/app.tar.gz CHANGED
Binary file
package/src/utils/api.ts CHANGED
@@ -426,6 +426,7 @@ type TAssetMissing = {
426
426
  owner: number
427
427
  author: number
428
428
  preview: string
429
+ readme_raw: string
429
430
  }
430
431
 
431
432
  export const createAsset = async (token: string, asset: TAssetMissing) => {
@@ -454,6 +455,7 @@ export const createAsset = async (token: string, asset: TAssetMissing) => {
454
455
  translations: [asset.lang],
455
456
  learnpack_deploy_url: asset.learnpack_deploy_url,
456
457
  technologies: asset.technologies,
458
+ readme_raw: asset.readme_raw,
457
459
  }
458
460
  const url = `https://breathecode.herokuapp.com/v1/registry/asset/me`
459
461
  const headers = {
@@ -72,17 +72,21 @@ export const hasCreatorPermission = async (token: string) => {
72
72
 
73
73
  type TGenerateImageParams = {
74
74
  prompt: string
75
+ callbackUrl: string
75
76
  }
76
77
 
77
78
  export const generateImage = async (
78
79
  token: string,
79
- { prompt }: TGenerateImageParams
80
+ { prompt, callbackUrl }: TGenerateImageParams
80
81
  ) => {
81
82
  try {
82
83
  const response = await axios.post(
83
84
  `${RIGOBOT_HOST}/v1/learnpack/tools/images`,
84
85
  {
85
86
  prompt,
87
+ webhook_callback_url: callbackUrl,
88
+ provider: "bfl",
89
+ model: "flux-pro-1.1",
86
90
  },
87
91
  {
88
92
  headers: {
@@ -299,6 +303,33 @@ export const readmeCreator = async (
299
303
  throw new Error("Invalid kind of lesson")
300
304
  }
301
305
 
306
+ type TCreateStructuredPreviewReadmeInputs = {
307
+ tutorial_info: string
308
+ }
309
+
310
+ export const createStructuredPreviewReadme = async (
311
+ token: string,
312
+ inputs: TCreateStructuredPreviewReadmeInputs,
313
+ webhookUrl?: string
314
+ ) => {
315
+ const response = await axios.post(
316
+ `${RIGOBOT_HOST}/v1/prompting/completion/write-course-introduction-readme/`,
317
+ {
318
+ inputs: inputs,
319
+ include_purpose_objective: false,
320
+ webhook_url: webhookUrl,
321
+ },
322
+ {
323
+ headers: {
324
+ "Content-Type": "application/json",
325
+ Authorization: "Token " + token,
326
+ },
327
+ }
328
+ )
329
+
330
+ return response.data
331
+ }
332
+
302
333
  export async function createPreviewReadme(
303
334
  tutorialDir: string,
304
335
  packageInfo: PackageInfo,
@@ -1 +0,0 @@
1
- {"version":"5.0.236","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false}},"args":[]},"breakToken":{"id":"breakToken","description":"Break the token","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Builds the project by copying necessary files and directories into a zip file","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"serve":{"id":"serve","description":"Runs a small server to build tutorials","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[preview, extension]","options":["extension","preview"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]},"translate":{"id":"translate","description":"List all the lessons, the user is able of select many of them to translate to the given languages","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[]}}}