@learnpack/learnpack 5.0.274 → 5.0.276
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/publish.js +5 -10
- package/lib/commands/serve.js +125 -67
- package/lib/models/creator.d.ts +7 -0
- package/lib/utils/api.d.ts +2 -1
- package/lib/utils/api.js +14 -10
- package/package.json +1 -1
- package/src/commands/publish.ts +517 -522
- package/src/commands/serve.ts +159 -99
- package/src/models/creator.ts +7 -0
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +366 -363
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +25 -10
package/src/ui/app.tar.gz
CHANGED
Binary file
|
package/src/utils/api.ts
CHANGED
@@ -8,6 +8,7 @@ dotenv.config()
|
|
8
8
|
|
9
9
|
const HOST = "https://breathecode.herokuapp.com"
|
10
10
|
export const RIGOBOT_HOST = "https://rigobot.herokuapp.com"
|
11
|
+
export const RIGOBOT_REALTIME_HOST = "https://chat.4geeks.com"
|
11
12
|
// export const RIGOBOT_HOST = "https://rigobot-test-cca7d841c9d8.herokuapp.com"
|
12
13
|
// export const RIGOBOT_HOST =
|
13
14
|
// "https://8000-charlytoc-rigobot-bmwdeam7cev.ws-us118.gitpod.io"
|
@@ -422,7 +423,7 @@ type TAssetMissing = {
|
|
422
423
|
description: string;
|
423
424
|
learnpack_deploy_url: string;
|
424
425
|
technologies: string[];
|
425
|
-
category: number;
|
426
|
+
category: number | string;
|
426
427
|
owner: number;
|
427
428
|
author: number;
|
428
429
|
preview: string;
|
@@ -535,13 +536,20 @@ const updateRigoAssetID = async (
|
|
535
536
|
slug: string,
|
536
537
|
asset_id: number
|
537
538
|
) => {
|
539
|
+
const cleanToken = token.replace(/[\n\r]/g, "")
|
540
|
+
|
538
541
|
const url = `${RIGOBOT_HOST}/v1/learnpack/package/${slug}/`
|
539
|
-
|
540
|
-
Authorization: "Token " + token.trim(),
|
541
|
-
}
|
542
|
-
console.log("HEADERS", headers)
|
542
|
+
|
543
543
|
try {
|
544
|
-
const response = await axios.put(
|
544
|
+
const response = await axios.put(
|
545
|
+
url,
|
546
|
+
{ asset_id },
|
547
|
+
{
|
548
|
+
headers: {
|
549
|
+
Authorization: "Token " + cleanToken,
|
550
|
+
},
|
551
|
+
}
|
552
|
+
)
|
545
553
|
return response.data
|
546
554
|
} catch (error) {
|
547
555
|
console.error("Failed to update Rigo package:", error)
|
@@ -551,11 +559,18 @@ const updateRigoAssetID = async (
|
|
551
559
|
|
552
560
|
const createRigoPackage = async (token: string, slug: string, config: any) => {
|
553
561
|
const url = `${RIGOBOT_HOST}/v1/learnpack/package`
|
554
|
-
const
|
555
|
-
|
556
|
-
}
|
562
|
+
const cleanToken = token.replace(/[\n\r]/g, "")
|
563
|
+
|
557
564
|
try {
|
558
|
-
const response = await axios.post(
|
565
|
+
const response = await axios.post(
|
566
|
+
url,
|
567
|
+
{ slug, config },
|
568
|
+
{
|
569
|
+
headers: {
|
570
|
+
Authorization: "Token " + cleanToken,
|
571
|
+
},
|
572
|
+
}
|
573
|
+
)
|
559
574
|
return response.data
|
560
575
|
} catch (error) {
|
561
576
|
console.error("Failed to create Rigo package:", error)
|