@learnpack/learnpack 5.0.54 → 5.0.57

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.
Files changed (57) hide show
  1. package/README.md +30 -12
  2. package/lib/commands/serve.d.ts +7 -0
  3. package/lib/commands/serve.js +149 -0
  4. package/lib/managers/server/routes.js +2 -0
  5. package/lib/utils/api.js +1 -1
  6. package/lib/utils/cloudStorage.d.ts +8 -0
  7. package/lib/utils/cloudStorage.js +17 -0
  8. package/oclif.manifest.json +1 -1
  9. package/package.json +3 -1
  10. package/src/commands/serve.ts +192 -0
  11. package/src/creator/README.md +54 -0
  12. package/src/creator/eslint.config.js +28 -0
  13. package/src/creator/index.html +13 -0
  14. package/src/creator/package-lock.json +4659 -0
  15. package/src/creator/package.json +41 -0
  16. package/src/creator/public/vite.svg +1 -0
  17. package/src/creator/src/App.css +42 -0
  18. package/src/creator/src/App.tsx +221 -0
  19. package/src/creator/src/assets/react.svg +1 -0
  20. package/src/creator/src/assets/svgs.tsx +88 -0
  21. package/src/creator/src/components/Loader.tsx +28 -0
  22. package/src/creator/src/components/Login.tsx +263 -0
  23. package/src/creator/src/components/SelectableCard.tsx +30 -0
  24. package/src/creator/src/components/StepWizard.tsx +77 -0
  25. package/src/creator/src/components/SyllabusEditor.tsx +431 -0
  26. package/src/creator/src/index.css +68 -0
  27. package/src/creator/src/main.tsx +19 -0
  28. package/src/creator/src/utils/configTypes.ts +122 -0
  29. package/src/creator/src/utils/constants.ts +2 -0
  30. package/src/creator/src/utils/lib.ts +36 -0
  31. package/src/creator/src/utils/rigo.ts +391 -0
  32. package/src/creator/src/utils/store.ts +78 -0
  33. package/src/creator/src/vite-env.d.ts +1 -0
  34. package/src/creator/tsconfig.app.json +26 -0
  35. package/src/creator/tsconfig.json +7 -0
  36. package/src/creator/tsconfig.node.json +24 -0
  37. package/src/creator/vite.config.ts +13 -0
  38. package/src/creatorDist/assets/index-D92OoEoU.js +23719 -0
  39. package/src/creatorDist/assets/index-tt9JBVY0.css +987 -0
  40. package/src/creatorDist/index.html +14 -0
  41. package/src/creatorDist/vite.svg +1 -0
  42. package/src/managers/server/routes.ts +3 -0
  43. package/src/ui/_app/app.css +1 -0
  44. package/src/ui/_app/app.js +3025 -0
  45. package/src/ui/_app/favicon.ico +0 -0
  46. package/src/ui/_app/index.html +109 -0
  47. package/src/ui/_app/index.html.backup +91 -0
  48. package/src/ui/_app/learnpack.svg +7 -0
  49. package/src/ui/_app/logo-192.png +0 -0
  50. package/src/ui/_app/logo-512.png +0 -0
  51. package/src/ui/_app/logo.png +0 -0
  52. package/src/ui/_app/manifest.webmanifest +21 -0
  53. package/src/ui/_app/sw.js +30 -0
  54. package/src/ui/app.tar.gz +0 -0
  55. package/src/utils/api.ts +1 -1
  56. package/src/utils/cloudStorage.ts +24 -0
  57. package/src/utils/creds.json +13 -0
Binary file
@@ -0,0 +1,109 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- Google Tag Manager -->
5
+ <script>
6
+ (function (w, d, s, l, i) {
7
+ w[l] = w[l] || [];
8
+ w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
9
+ var f = d.getElementsByTagName(s)[0],
10
+ j = d.createElement(s),
11
+ dl = l != "dataLayer" ? "&l=" + l : "";
12
+ j.async = true;
13
+ j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
14
+ f.parentNode.insertBefore(j, f);
15
+ })(window, document, "script", "dataLayer", "GTM-5QMWW39Z");
16
+ </script>
17
+ <!-- End Google Tag Manager -->
18
+ <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script>
19
+
20
+ <meta charset="UTF-8" />
21
+
22
+ <link rel="icon" type="image/svg+xml" href="/learnpack.svg" />
23
+ <link
24
+ href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css"
25
+ type="text/css"
26
+ rel="stylesheet"
27
+ />
28
+
29
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
30
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31
+ <link
32
+ href="https://fonts.googleapis.com/css2?family=Inter&display=swap"
33
+ rel="stylesheet"
34
+ />
35
+
36
+ <link rel="manifest" href="/manifest.webmanifest" />
37
+
38
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
39
+ <title>Learnpack: Learn fast</title>
40
+ <meta name="description" content="{{description}}" />
41
+ <meta property="og:title" content="{{title}}" />
42
+ <meta property="og:description" content="{{description}}" />
43
+ <meta property="og:type" content="website" />
44
+ <meta property="og:site_name" content="LearnPack" />
45
+ <meta property="og:image" content="{{preview}}" />
46
+
47
+ <meta name="twitter:card" content="summary_large_image" />
48
+ <meta name="twitter:title" content="{{title}}" />
49
+ <meta name="twitter:description" content="{{description}}" />
50
+ <meta name="twitter:image" content="{{preview}}" />
51
+ <meta name="twitter:site" content="@learnpack" />
52
+ <meta name="twitter:creator" content="@learnpack" />
53
+
54
+ <script type="application/ld+json">
55
+ {
56
+ "@context": "http://schema.org",
57
+ "@type": "Course",
58
+ "name": "{{title}}",
59
+ "description": "{{description}}",
60
+ "provider": {
61
+ "@type": "Organization",
62
+ "name": "Learn Pack",
63
+ "url": "https://www.learnpack.co"
64
+ },
65
+ "inLanguage": "en",
66
+ "courseCode": "{{slug}}",
67
+ "hasCourseInstance": {
68
+ "@type": "CourseInstance",
69
+ "courseMode": "online",
70
+ "duration": "{{duration}}"
71
+ }
72
+ }
73
+ </script>
74
+
75
+
76
+ </head>
77
+ <body>
78
+ <!-- Google Tag Manager (noscript) -->
79
+ <noscript>
80
+ <iframe
81
+ src="https://www.googletagmanager.com/ns.html?id=GTM-5QMWW39Z"
82
+ height="0"
83
+ width="0"
84
+ style="display: none; visibility: hidden"
85
+ ></iframe>
86
+ </noscript>
87
+ <!-- End Google Tag Manager (noscript) -->
88
+ <div id="root"></div>
89
+
90
+
91
+ <!-- Injected by deployment script - Resistance to caching is futile! -->
92
+ <script>
93
+ (function() {
94
+ // Add CSS
95
+ const link = document.createElement('link');
96
+ link.rel = 'stylesheet';
97
+ link.href = "https://learnpack-packages.s3.us-east-1.amazonaws.com/learnpack/v5/app.css?v=" + Date.now();
98
+ document.head.appendChild(link);
99
+
100
+ // Add JavaScript
101
+ const script = document.createElement('script');
102
+ script.type = 'module';
103
+ script.crossOrigin = 'anonymous';
104
+ script.src = "https://learnpack-packages.s3.us-east-1.amazonaws.com/learnpack/v5/app.js?v=" + Date.now();
105
+ document.body.appendChild(script);
106
+ })();
107
+ </script>
108
+ </body>
109
+ </html>
@@ -0,0 +1,91 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- Google Tag Manager -->
5
+ <script>
6
+ (function (w, d, s, l, i) {
7
+ w[l] = w[l] || [];
8
+ w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
9
+ var f = d.getElementsByTagName(s)[0],
10
+ j = d.createElement(s),
11
+ dl = l != "dataLayer" ? "&l=" + l : "";
12
+ j.async = true;
13
+ j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
14
+ f.parentNode.insertBefore(j, f);
15
+ })(window, document, "script", "dataLayer", "GTM-5QMWW39Z");
16
+ </script>
17
+ <!-- End Google Tag Manager -->
18
+ <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.3/dist/confetti.browser.min.js"></script>
19
+
20
+ <meta charset="UTF-8" />
21
+
22
+ <link rel="icon" type="image/svg+xml" href="/learnpack.svg" />
23
+ <link
24
+ href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css"
25
+ type="text/css"
26
+ rel="stylesheet"
27
+ />
28
+
29
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
30
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31
+ <link
32
+ href="https://fonts.googleapis.com/css2?family=Inter&display=swap"
33
+ rel="stylesheet"
34
+ />
35
+
36
+ <link rel="manifest" href="/manifest.webmanifest" />
37
+
38
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
39
+ <title>Learnpack: Learn fast</title>
40
+ <meta name="description" content="{{description}}" />
41
+ <meta property="og:title" content="{{title}}" />
42
+ <meta property="og:description" content="{{description}}" />
43
+ <meta property="og:type" content="website" />
44
+ <meta property="og:site_name" content="LearnPack" />
45
+ <meta property="og:image" content="{{preview}}" />
46
+
47
+ <meta name="twitter:card" content="summary_large_image" />
48
+ <meta name="twitter:title" content="{{title}}" />
49
+ <meta name="twitter:description" content="{{description}}" />
50
+ <meta name="twitter:image" content="{{preview}}" />
51
+ <meta name="twitter:site" content="@learnpack" />
52
+ <meta name="twitter:creator" content="@learnpack" />
53
+
54
+ <script type="application/ld+json">
55
+ {
56
+ "@context": "http://schema.org",
57
+ "@type": "Course",
58
+ "name": "{{title}}",
59
+ "description": "{{description}}",
60
+ "provider": {
61
+ "@type": "Organization",
62
+ "name": "Learn Pack",
63
+ "url": "https://www.learnpack.co"
64
+ },
65
+ "inLanguage": "en",
66
+ "courseCode": "{{slug}}",
67
+ "hasCourseInstance": {
68
+ "@type": "CourseInstance",
69
+ "courseMode": "online",
70
+ "duration": "{{duration}}"
71
+ }
72
+ }
73
+ </script>
74
+ <script type="module" crossorigin src="/app.js"></script>
75
+ <link rel="stylesheet" href="/app.css">
76
+ </head>
77
+ <body>
78
+ <!-- Google Tag Manager (noscript) -->
79
+ <noscript>
80
+ <iframe
81
+ src="https://www.googletagmanager.com/ns.html?id=GTM-5QMWW39Z"
82
+ height="0"
83
+ width="0"
84
+ style="display: none; visibility: hidden"
85
+ ></iframe>
86
+ </noscript>
87
+ <!-- End Google Tag Manager (noscript) -->
88
+ <div id="root"></div>
89
+
90
+ </body>
91
+ </html>
@@ -0,0 +1,7 @@
1
+ <svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4 10.8271V22.3184C4 23.0446 4.38793 23.7155 5.01755 24.0786L14.9824 29.8242C15.6121 30.1873 16.3879 30.1873 17.0176 29.8242L26.9824 24.0786C27.6121 23.7155 28 23.0446 28 22.3184V10.8271C28 10.1009 27.6121 9.42998 26.9824 9.0669L17.0176 3.32114C16.3879 2.95806 15.6121 2.95806 14.9824 3.32114L5.01755 9.0669C4.38793 9.42983 4 10.1009 4 10.8271Z" fill="#00041A"/>
3
+ <path d="M15.9799 24.627C15.8632 24.6896 15.7224 24.688 15.607 24.6229L8.0148 20.3429C7.75702 20.1975 7.43799 20.3836 7.43799 20.6793C7.43799 20.8152 7.50954 20.9411 7.62625 21.0109L15.6296 25.7894C15.7496 25.861 15.8988 25.8624 16.0201 25.7932L24.367 21.0254C24.5 20.9494 24.5753 20.8024 24.5596 20.6503C24.5356 20.4167 24.5137 20.0937 24.5676 20.0293L15.9799 24.627Z" fill="white"/>
4
+ <path d="M24.5708 20.0291L24.5925 20.0176C24.5842 20.0176 24.5771 20.0218 24.5708 20.0291Z" fill="white"/>
5
+ <path d="M24.2608 22.2883L15.8274 27.0176L7.31846 22.1585C7.07286 22.0182 6.92116 21.7573 6.92116 21.4746V19.5681C6.92116 19.2047 7.31237 18.9754 7.63015 19.1523L15.836 23.7249L25.5691 18.2171C25.6739 18.1578 25.6648 18.0039 25.5538 17.9573L24.4218 17.4822C23.6861 17.1734 22.852 17.2021 22.1393 17.5606L15.836 20.7318L9.54557 17.6348C8.72425 17.2303 7.76107 17.2317 6.94085 17.6382C6.28341 17.964 5.86768 18.6336 5.86768 19.3665V20.9276C5.86768 21.8003 6.32903 22.6082 7.08114 23.0524L15.8274 28.2184L26.057 22.356L25.5817 22.1821C25.1471 22.0229 24.6643 22.0618 24.2608 22.2882V22.2883Z" fill="#0097CF"/>
6
+ <path d="M26.5421 11.2556L15.9895 5.16C15.8945 5.10524 15.7774 5.10555 15.6828 5.16078L5.25698 11.2581C5.05262 11.3776 5.05684 11.6741 5.26448 11.7876L8.96534 13.8126V15.5122C8.96534 15.8275 9.13689 16.1178 9.41326 16.2702L15.4095 19.5777C15.6696 19.7211 15.9851 19.7217 16.2455 19.5789L22.2902 16.2696C22.5678 16.1176 22.7405 15.8265 22.7405 15.5102V13.8124L25.4213 12.381V16.1824C25.4213 16.3995 25.5977 16.5757 25.8151 16.5757H25.9842C26.2017 16.5757 26.3781 16.3995 26.3781 16.1824V11.8702L26.533 11.7875C26.7438 11.675 26.7488 11.3751 26.5419 11.2556H26.5421ZM24.8006 11.6904L15.9487 16.3479C15.887 16.3804 15.8132 16.38 15.7518 16.3471L7.0707 11.6979C6.9254 11.6202 6.92274 11.4132 7.06585 11.3316L15.7246 6.39138C15.7884 6.35503 15.8665 6.35456 15.9306 6.39029L24.8046 11.3224C24.9501 11.4032 24.9477 11.613 24.8004 11.6906L24.8006 11.6904Z" fill="white"/>
7
+ </svg>
Binary file
Binary file
Binary file
@@ -0,0 +1,21 @@
1
+ {
2
+ "short_name": "{{course_app_name}}",
3
+ "name": "LearnPack: {{course_title}}",
4
+ "icons": [
5
+ {
6
+ "src": "logo-512.png",
7
+ "type": "image/png",
8
+ "sizes": "512x512"
9
+ },
10
+ {
11
+ "src": "logo-192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ }
15
+ ],
16
+ "start_url": "/",
17
+ "scope": "/",
18
+ "background_color": "#ffffff",
19
+ "display": "standalone",
20
+ "theme_color": "#000000"
21
+ }
@@ -0,0 +1,30 @@
1
+ self.addEventListener('install', (event) => {
2
+ console.log('Service Worker instalado');
3
+ event.waitUntil(
4
+ caches.open('app-cache').then(async (cache) => {
5
+ const urlsToCache = [
6
+ '/',
7
+ '/index.html',
8
+ '/logo-512.png',
9
+ '/logo-192.png',
10
+ '/manifest.webmanifest',
11
+ ];
12
+ const cachePromises = urlsToCache.map(url =>
13
+ fetch(url).then(response => {
14
+ if (!response.ok) throw new Error(`Error al obtener: ${url}`);
15
+ return cache.put(url, response.clone());
16
+ }).catch(error => console.warn(error))
17
+ );
18
+ return Promise.all(cachePromises);
19
+ })
20
+ );
21
+ });
22
+
23
+
24
+ self.addEventListener('fetch', (event) => {
25
+ event.respondWith(
26
+ caches.match(event.request).then((response) => {
27
+ return response || fetch(event.request)
28
+ })
29
+ )
30
+ })
Binary file
package/src/utils/api.ts CHANGED
@@ -428,7 +428,7 @@ export const createAsset = async (
428
428
  title: asset.title,
429
429
  lang: asset.lang,
430
430
  asset_type: "EXERCISE",
431
- visibility: "UNLISTED",
431
+ visibility: "PUBLIC",
432
432
  status: "DRAFT",
433
433
  url: "https://4geeksacademy.com",
434
434
  readme_url: null,
@@ -0,0 +1,24 @@
1
+ import { Bucket } from "@google-cloud/storage"
2
+ import { Storage } from "@google-cloud/storage"
3
+ import * as path from "path"
4
+
5
+ /**
6
+ * Sube contenido de texto directamente a un bucket de GCS.
7
+ * @param bucket Instancia de Bucket
8
+ * @param destination Ruta destino dentro del bucket (incluye carpeta/nombre)
9
+ * @param textContent Contenido textual a subir
10
+ */
11
+ export async function uploadTextToBucket(
12
+ bucket: Bucket,
13
+ destination: string,
14
+ textContent: string
15
+ ): Promise<void> {
16
+ const file = bucket.file(destination)
17
+
18
+ await file.save(textContent, {
19
+ resumable: false,
20
+ contentType: "text/plain",
21
+ })
22
+
23
+ console.log(`✅ Texto subido a gs://${bucket.name}/${destination}`)
24
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "service_account",
3
+ "project_id": "triple-team-448503-f1",
4
+ "private_key_id": "e33a23cfcdcdcf676d89ccd166bc6b8bf83752ce",
5
+ "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCWfDMXeUV3mkJE\nIH5H3DEf8exWEVO9sigSxVrl8r4OWluN1sb3s+7PEcl3qJjks75iUCRds8MM4yg6\nUGR6lNylleeI5d4VWHSgL3sDkQEvoyNXWHVKgazcdgVX7aWESaSxFUx1qEuv8Fh9\nAX919Vcxp1EC8+obabcu0kiCWta+MTlHsxsQsRPk2AO5Ct3kpW929IieVVms909d\nBFhFP/ikYz8QoUCoRfFPk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0n2hp4Qw\noNFGqWRwgjv+VktHUWQmWQwyXhiiQ0S7LzFwi9MmcgyGue8ldp9n6MKXd4uXKchf\n45dQ8EevfKjkvAD16ZjcV549nluzyOaB81AG3He9iQKBgE7sU/jaW81gtPJbHL4F\nRd2c+wF3c+vBDlo1FKz89n0WRszTjdRO4eoPNo+sKtZI2GQYnS6FoQWWbQUmshIj\nsDy9Z8TKfksqxa9ZLEzE1v6yTdi3ospHUbauZqzZGGKZh0pLw6m+xRsjzscjR4xO\ngxynW141ykunw0iWwLqO863C\n-----END PRIVATE KEY-----\n",
6
+ "client_email": "learnpack-creator@triple-team-448503-f1.iam.gserviceaccount.com",
7
+ "client_id": "112130946877780100045",
8
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
9
+ "token_uri": "https://oauth2.googleapis.com/token",
10
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/learnpack-creator%40triple-team-448503-f1.iam.gserviceaccount.com",
12
+ "universe_domain": "googleapis.com"
13
+ }