@things-factory/operato-codelingua 6.1.4
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/CHANGELOG.md +8 -0
- package/Dockerfile +16 -0
- package/README.md +37 -0
- package/_index.html +89 -0
- package/assets/favicon.ico +0 -0
- package/assets/helps/index.md +1 -0
- package/assets/images/hatiolab-logo.png +0 -0
- package/assets/images/spinner.png +0 -0
- package/assets/manifest/apple-1024.png +0 -0
- package/assets/manifest/apple-120.png +0 -0
- package/assets/manifest/apple-152.png +0 -0
- package/assets/manifest/apple-167.png +0 -0
- package/assets/manifest/apple-180.png +0 -0
- package/assets/manifest/apple-touch-icon.png +0 -0
- package/assets/manifest/badge-128x128.png +0 -0
- package/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
- package/assets/manifest/chrome-touch-icon-192x192.png +0 -0
- package/assets/manifest/icon-128x128.png +0 -0
- package/assets/manifest/icon-192x192.png +0 -0
- package/assets/manifest/icon-512x512.png +0 -0
- package/assets/manifest/icon-72x72.png +0 -0
- package/assets/manifest/icon-96x96.png +0 -0
- package/assets/manifest/image-metaog.png +0 -0
- package/assets/manifest/maskable_icon.png +0 -0
- package/assets/manifest/ms-icon-144x144.png +0 -0
- package/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
- package/assets/manifest.json +27 -0
- package/client/actions/main.ts +1 -0
- package/client/bootstrap.ts +8 -0
- package/client/index.ts +1 -0
- package/client/pages/main.ts +33 -0
- package/client/reducers/main.ts +17 -0
- package/client/route.ts +10 -0
- package/client/themes/app-theme.css +142 -0
- package/client/tsconfig.json +12 -0
- package/config/config.development.js +7 -0
- package/config/config.production.js +41 -0
- package/config.development.js +7 -0
- package/db.sqlite +0 -0
- package/dist-server/controllers/index.js +5 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/controllers/openai-connection.js +26 -0
- package/dist-server/controllers/openai-connection.js.map +1 -0
- package/dist-server/index.js +6 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/routes.js +25 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.js +14 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/installer/config.production.js +40 -0
- package/installer/docker-compose.yml +37 -0
- package/installer/install.sh +54 -0
- package/installer/migrate.sh +1 -0
- package/installer/start.sh +18 -0
- package/installer/stop.sh +1 -0
- package/installer/upgrade.sh +1 -0
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +30 -0
- package/logs/application-2023-06-25-11.log +12 -0
- package/logs/application-2023-06-25-12.log +34 -0
- package/logs/application-2023-06-25-13.log +8 -0
- package/openapi/unstable.yaml +41 -0
- package/package.json +55 -0
- package/schema.gql +841 -0
- package/server/controllers/index.ts +1 -0
- package/server/controllers/openai-connection.ts +27 -0
- package/server/index.ts +3 -0
- package/server/routes.ts +28 -0
- package/server/service/index.ts +13 -0
- package/server/tsconfig.json +9 -0
- package/things-factory.config.ts +13 -0
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
- package/views/auth-page.html +93 -0
- package/views/public/home.html +83 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './openai-connection'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Configuration, OpenAIApi } from 'openai'
|
|
2
|
+
import { config } from '@things-factory/env'
|
|
3
|
+
|
|
4
|
+
const OPENAI = config.get('openai', {})
|
|
5
|
+
const { organization, apiKey } = OPENAI
|
|
6
|
+
|
|
7
|
+
if (!organization || !apiKey) {
|
|
8
|
+
console.error("'OPENAI_API_KEY' is not configured.")
|
|
9
|
+
process.exit(1)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const configuration = new Configuration({
|
|
13
|
+
organization,
|
|
14
|
+
apiKey
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const client = new OpenAIApi(configuration)
|
|
18
|
+
const role = 'user'
|
|
19
|
+
|
|
20
|
+
export async function decipher(prompt: string): Promise<string> {
|
|
21
|
+
const completion = await client.createChatCompletion({
|
|
22
|
+
model: 'gpt-3.5-turbo',
|
|
23
|
+
messages: [{ role, content: prompt }]
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
return completion.data.choices[0].message.content
|
|
27
|
+
}
|
package/server/index.ts
ADDED
package/server/routes.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const debug = require('debug')('things-factory:operato-codelingua:routes')
|
|
2
|
+
|
|
3
|
+
process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {
|
|
4
|
+
/*
|
|
5
|
+
* can add global public routes to application (auth not required, tenancy not required)
|
|
6
|
+
*
|
|
7
|
+
* ex) routes.get('/path', async(context, next) => {})
|
|
8
|
+
* ex) routes.post('/path', async(context, next) => {})
|
|
9
|
+
*/
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
process.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {
|
|
13
|
+
/*
|
|
14
|
+
* can add global private routes to application (auth required, tenancy not required)
|
|
15
|
+
*/
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
process.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {
|
|
19
|
+
/*
|
|
20
|
+
* can add domain public routes to application (auth not required, tenancy required)
|
|
21
|
+
*/
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
process.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {
|
|
25
|
+
/*
|
|
26
|
+
* can add domain private routes to application (auth required, tenancy required)
|
|
27
|
+
*/
|
|
28
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Codelingua</title>
|
|
6
|
+
<meta name="generator" content="Things Factory Starter Kit" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<meta name="description" content="Deciphering Code, Simplifying Understanding" />
|
|
9
|
+
|
|
10
|
+
<base href="/" />
|
|
11
|
+
|
|
12
|
+
<link rel="icon" href="/assets/favicon.ico" />
|
|
13
|
+
|
|
14
|
+
<!-- See https://goo.gl/OOhYW5 -->
|
|
15
|
+
<link rel="manifest" href="/assets/manifest.json" />
|
|
16
|
+
|
|
17
|
+
<!-- See https://goo.gl/qRE0vM -->
|
|
18
|
+
<meta name="theme-color" content="#3f51b5" />
|
|
19
|
+
|
|
20
|
+
<!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
|
|
21
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
22
|
+
<meta name="application-name" content="Codelingua" />
|
|
23
|
+
<meta name="application-description" content="Deciphering Code, Simplifying Understanding" />
|
|
24
|
+
<meta name="application-copyright" content="Copyright © hatiolab.com. All Rights Reserved." />
|
|
25
|
+
<link rel="application-icon" href="/assets/manifest/icon-96x96.png" />
|
|
26
|
+
|
|
27
|
+
<!-- Add to homescreen for Safari on iOS -->
|
|
28
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
29
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
30
|
+
<meta name="apple-mobile-web-app-title" content="Codelingua" />
|
|
31
|
+
|
|
32
|
+
<!-- Homescreen icons -->
|
|
33
|
+
<link rel="apple-touch-icon" href="/assets/manifest/icon-48x48.png" />
|
|
34
|
+
<link rel="apple-touch-icon" sizes="72x72" href="/assets/manifest/icon-72x72.png" />
|
|
35
|
+
<link rel="apple-touch-icon" sizes="96x96" href="/assets/manifest/icon-96x96.png" />
|
|
36
|
+
<link rel="apple-touch-icon" sizes="144x144" href="/assets/manifest/icon-144x144.png" />
|
|
37
|
+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/manifest/icon-192x192.png" />
|
|
38
|
+
|
|
39
|
+
<!-- Tile icon for Windows 8 (144x144 + tile color) -->
|
|
40
|
+
<meta name="msapplication-TileImage" content="/assets/manifest/icon-144x144.png" />
|
|
41
|
+
<meta name="msapplication-TileColor" content="#3f51b5" />
|
|
42
|
+
<meta name="msapplication-tap-highlight" content="no" />
|
|
43
|
+
|
|
44
|
+
<!-- Default twitter cards -->
|
|
45
|
+
<meta name="twitter:card" content="summary" />
|
|
46
|
+
<meta name="twitter:site" content="@username" />
|
|
47
|
+
<meta property="og:type" content="website" />
|
|
48
|
+
<meta property="og:site_name" content="Codelingua, Deciphering Code, Simplifying Understanding." />
|
|
49
|
+
<meta property="og:image" content="/assets/manifest/image-metaog.png" />
|
|
50
|
+
|
|
51
|
+
<!-- Performance tip: hint to the browser to start the handshake for the fonts site -->
|
|
52
|
+
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />
|
|
53
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" />
|
|
54
|
+
<link rel="stylesheet" href="/theme.css" />
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
body {
|
|
58
|
+
margin: 0;
|
|
59
|
+
padding: 0;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
|
|
62
|
+
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
63
|
+
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
64
|
+
line-height: 1.5;
|
|
65
|
+
-webkit-font-smoothing: antialiased;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
68
|
+
|
|
69
|
+
<!--- prefetch -->
|
|
70
|
+
<link rel="prefetch" href="/auth/signin.js">
|
|
71
|
+
<link rel="prefetch" href="/auth/signup.js">
|
|
72
|
+
<link rel="prefetch" href="/auth/forgot-password.js">
|
|
73
|
+
<link rel="prefetch" href="/auth/checkin.js">
|
|
74
|
+
</head>
|
|
75
|
+
<body>
|
|
76
|
+
<<%- pageElement %> id="page"></<%- pageElement %>>
|
|
77
|
+
<noscript>
|
|
78
|
+
Please enable JavaScript to view this website.
|
|
79
|
+
</noscript>
|
|
80
|
+
<!-- Load webcomponents-loader.js to check and load any polyfills your browser needs -->
|
|
81
|
+
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
|
82
|
+
<script src="node_modules/web-animations-js/web-animations-next.min.js"></script>
|
|
83
|
+
<script src="node_modules/@lottiefiles/lottie-player/dist/lottie-player.js"></script>
|
|
84
|
+
<!-- Built with love using PWA Starter Kit -->
|
|
85
|
+
|
|
86
|
+
<script src="<%- elementScript %>"></script>
|
|
87
|
+
<script src="/theme.js"></script>
|
|
88
|
+
<script>
|
|
89
|
+
var pageEl = document.querySelector('#page')
|
|
90
|
+
page.data = <%- JSON.stringify(data) %>
|
|
91
|
+
</script>
|
|
92
|
+
</body>
|
|
93
|
+
</html>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Codelingua</title>
|
|
6
|
+
<meta name="generator" content="Things Factory Starter Kit" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<meta name="description" content="Deciphering Code, Simplifying Understanding" />
|
|
9
|
+
|
|
10
|
+
<base href="/" />
|
|
11
|
+
|
|
12
|
+
<link rel="icon" href="/assets/favicon.ico" />
|
|
13
|
+
|
|
14
|
+
<!-- See https://goo.gl/OOhYW5 -->
|
|
15
|
+
<link rel="manifest" href="/assets/manifest.json" />
|
|
16
|
+
|
|
17
|
+
<!-- See https://goo.gl/qRE0vM -->
|
|
18
|
+
<meta name="theme-color" content="#3f51b5" />
|
|
19
|
+
|
|
20
|
+
<!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
|
|
21
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
22
|
+
<meta name="application-name" content="Codelingua" />
|
|
23
|
+
<meta name="application-description" content="Deciphering Code, Simplifying Understanding" />
|
|
24
|
+
<meta name="application-copyright" content="Copyright © hatiolab.com. All Rights Reserved." />
|
|
25
|
+
<link rel="application-icon" href="/assets/manifest/icon-96x96.png" />
|
|
26
|
+
|
|
27
|
+
<!-- Add to homescreen for Safari on iOS -->
|
|
28
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
29
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
30
|
+
<meta name="apple-mobile-web-app-title" content="Codelingua" />
|
|
31
|
+
|
|
32
|
+
<!-- Homescreen icons -->
|
|
33
|
+
<link rel="apple-touch-icon" href="/assets/manifest/icon-48x48.png" />
|
|
34
|
+
<link rel="apple-touch-icon" sizes="72x72" href="/assets/manifest/icon-72x72.png" />
|
|
35
|
+
<link rel="apple-touch-icon" sizes="96x96" href="/assets/manifest/icon-96x96.png" />
|
|
36
|
+
<link rel="apple-touch-icon" sizes="144x144" href="/assets/manifest/icon-144x144.png" />
|
|
37
|
+
<link rel="apple-touch-icon" sizes="192x192" href="/assets/manifest/icon-192x192.png" />
|
|
38
|
+
|
|
39
|
+
<!-- Tile icon for Windows 8 (144x144 + tile color) -->
|
|
40
|
+
<meta name="msapplication-TileImage" content="/assets/manifest/icon-144x144.png" />
|
|
41
|
+
<meta name="msapplication-TileColor" content="#3f51b5" />
|
|
42
|
+
<meta name="msapplication-tap-highlight" content="no" />
|
|
43
|
+
|
|
44
|
+
<!-- Default twitter cards -->
|
|
45
|
+
<meta name="twitter:card" content="summary" />
|
|
46
|
+
<meta name="twitter:site" content="@username" />
|
|
47
|
+
<meta property="og:type" content="website" />
|
|
48
|
+
<meta property="og:site_name" content="Codelingua, Heart of platform." />
|
|
49
|
+
<meta property="og:image" content="/assets/manifest/image-metaog.png" />
|
|
50
|
+
|
|
51
|
+
<!-- Performance tip: hint to the browser to start the handshake for the fonts site -->
|
|
52
|
+
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />
|
|
53
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" />
|
|
54
|
+
<link rel="stylesheet" href="/theme.css" />
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
body {
|
|
58
|
+
margin: 0;
|
|
59
|
+
padding: 0;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
|
|
62
|
+
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
63
|
+
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
64
|
+
line-height: 1.5;
|
|
65
|
+
-webkit-font-smoothing: antialiased;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
68
|
+
|
|
69
|
+
<!--- prefetch -->
|
|
70
|
+
<link rel="prefetch" href="/public/home.js" />
|
|
71
|
+
</head>
|
|
72
|
+
<body>
|
|
73
|
+
<home-page id="page"></home-page>
|
|
74
|
+
<noscript> Please enable JavaScript to view this website. </noscript>
|
|
75
|
+
<!-- Load webcomponents-loader.js to check and load any polyfills your browser needs -->
|
|
76
|
+
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
|
77
|
+
<script src="node_modules/web-animations-js/web-animations-next.min.js"></script>
|
|
78
|
+
<!-- Built with love using PWA Starter Kit -->
|
|
79
|
+
|
|
80
|
+
<script src="/public/home.js"></script>
|
|
81
|
+
<script src="/theme.js"></script>
|
|
82
|
+
</body>
|
|
83
|
+
</html>
|