@things-factory/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/client/index.ts +0 -0
- package/client/tsconfig.json +11 -0
- package/config/config.development.js +6 -0
- package/config/config.production.js +6 -0
- package/dist-client/actions/main.d.ts +1 -0
- package/dist-client/actions/main.js +2 -0
- package/dist-client/actions/main.js.map +1 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/codelingua/codelingua-importer.d.ts +22 -0
- package/dist-client/pages/codelingua/codelingua-importer.js +100 -0
- package/dist-client/pages/codelingua/codelingua-importer.js.map +1 -0
- package/dist-client/pages/codelingua/codelingua-list-page.d.ts +62 -0
- package/dist-client/pages/codelingua/codelingua-list-page.js +326 -0
- package/dist-client/pages/codelingua/codelingua-list-page.js.map +1 -0
- package/dist-client/pages/main.d.ts +1 -0
- package/dist-client/pages/main.js +27 -0
- package/dist-client/pages/main.js.map +1 -0
- package/dist-client/reducers/main.d.ts +6 -0
- package/dist-client/reducers/main.js +14 -0
- package/dist-client/reducers/main.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +11 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/controllers/api-doc-completion.js +33 -0
- package/dist-server/controllers/api-doc-completion.js.map +1 -0
- package/dist-server/controllers/chat-completion.js +32 -0
- package/dist-server/controllers/chat-completion.js.map +1 -0
- package/dist-server/controllers/decipher-code.js +34 -0
- package/dist-server/controllers/decipher-code.js.map +1 -0
- package/dist-server/controllers/decipher-error-code.js +34 -0
- package/dist-server/controllers/decipher-error-code.js.map +1 -0
- package/dist-server/controllers/i18n-completion.js +33 -0
- package/dist-server/controllers/i18n-completion.js.map +1 -0
- package/dist-server/controllers/index.js +10 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/controllers/openai-connection.js +17 -0
- package/dist-server/controllers/openai-connection.js.map +1 -0
- package/dist-server/index.js +7 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/routes.js +65 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/api-doc-completion/api-doc-completion-resolver.js +31 -0
- package/dist-server/service/api-doc-completion/api-doc-completion-resolver.js.map +1 -0
- package/dist-server/service/api-doc-completion/api-doc-completion-type.js +30 -0
- package/dist-server/service/api-doc-completion/api-doc-completion-type.js.map +1 -0
- package/dist-server/service/api-doc-completion/index.js +8 -0
- package/dist-server/service/api-doc-completion/index.js.map +1 -0
- package/dist-server/service/chat-completion/chat-completion-resolver.js +30 -0
- package/dist-server/service/chat-completion/chat-completion-resolver.js.map +1 -0
- package/dist-server/service/chat-completion/chat-completion-type.js +26 -0
- package/dist-server/service/chat-completion/chat-completion-type.js.map +1 -0
- package/dist-server/service/chat-completion/index.js +8 -0
- package/dist-server/service/chat-completion/index.js.map +1 -0
- package/dist-server/service/code-decipher/code-decipher-resolver.js +47 -0
- package/dist-server/service/code-decipher/code-decipher-resolver.js.map +1 -0
- package/dist-server/service/code-decipher/code-decipher-type.js +34 -0
- package/dist-server/service/code-decipher/code-decipher-type.js.map +1 -0
- package/dist-server/service/code-decipher/index.js +8 -0
- package/dist-server/service/code-decipher/index.js.map +1 -0
- package/dist-server/service/i18n-completion/i18n-completion-resolver.js +30 -0
- package/dist-server/service/i18n-completion/i18n-completion-resolver.js.map +1 -0
- package/dist-server/service/i18n-completion/i18n-completion-type.js +26 -0
- package/dist-server/service/i18n-completion/i18n-completion-type.js.map +1 -0
- package/dist-server/service/i18n-completion/index.js +8 -0
- package/dist-server/service/i18n-completion/index.js.map +1 -0
- package/dist-server/service/index.js +22 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/codelingua/codelingua.md +160 -0
- package/package.json +36 -0
- package/server/controllers/api-doc-completion.ts +35 -0
- package/server/controllers/chat-completion.ts +28 -0
- package/server/controllers/decipher-code.ts +38 -0
- package/server/controllers/decipher-error-code.ts +38 -0
- package/server/controllers/i18n-completion.ts +29 -0
- package/server/controllers/index.ts +7 -0
- package/server/controllers/openai-connection.ts +17 -0
- package/server/index.ts +4 -0
- package/server/routes.ts +84 -0
- package/server/service/api-doc-completion/api-doc-completion-resolver.ts +22 -0
- package/server/service/api-doc-completion/api-doc-completion-type.ts +16 -0
- package/server/service/api-doc-completion/index.ts +5 -0
- package/server/service/chat-completion/chat-completion-resolver.ts +21 -0
- package/server/service/chat-completion/chat-completion-type.ts +13 -0
- package/server/service/chat-completion/index.ts +5 -0
- package/server/service/code-decipher/code-decipher-resolver.ts +37 -0
- package/server/service/code-decipher/code-decipher-type.ts +19 -0
- package/server/service/code-decipher/index.ts +5 -0
- package/server/service/i18n-completion/i18n-completion-resolver.ts +21 -0
- package/server/service/i18n-completion/i18n-completion-type.ts +13 -0
- package/server/service/i18n-completion/index.ts +5 -0
- package/server/service/index.ts +24 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +1 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../client/pages/main.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,kCAAkC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAG9E,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAGnD,MAAM;QACJ,OAAO,IAAI,CAAA;;;mBAGI,IAAI;;KAElB,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAA;IAC/C,CAAC;CACF,CAAA;AAdC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAoB;AAD3C,cAAc;IADnB,aAAa,CAAC,iBAAiB,CAAC;GAC3B,cAAc,CAenB","sourcesContent":["import { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { store, PageView } from '@operato/shell'\n\nconst logo = new URL('/assets/images/hatiolab-logo.png', import.meta.url).href\n\n@customElement('codelingua-main')\nclass CodelinguaMain extends connect(store)(PageView) {\n @property({ type: String }) codelingua?: string\n\n render() {\n return html`\n <section>\n <h2>Codelingua</h2>\n <img src=${logo}>\n </section>\n `\n }\n\n stateChanged(state) {\n this.codelingua = state.codelingua.state_main\n }\n}\n\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UPDATE_CODELINGUA } from '../actions/main';
|
|
2
|
+
const INITIAL_STATE = {
|
|
3
|
+
codelingua: 'ABC'
|
|
4
|
+
};
|
|
5
|
+
const codelingua = (state = INITIAL_STATE, action) => {
|
|
6
|
+
switch (action.type) {
|
|
7
|
+
case UPDATE_CODELINGUA:
|
|
8
|
+
return Object.assign({}, state);
|
|
9
|
+
default:
|
|
10
|
+
return state;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default codelingua;
|
|
14
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../client/reducers/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,MAAM,aAAa,GAAG;IACpB,UAAU,EAAE,KAAK;CAClB,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,KAAK,GAAG,aAAa,EAAE,MAAM,EAAE,EAAE;IACnD,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,iBAAiB;YACpB,yBAAY,KAAK,EAAE;QAErB;YACE,OAAO,KAAK,CAAA;KACf;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA","sourcesContent":["import { UPDATE_CODELINGUA } from '../actions/main'\n\nconst INITIAL_STATE = {\n codelingua: 'ABC'\n}\n\nconst codelingua = (state = INITIAL_STATE, action) => {\n switch (action.type) {\n case UPDATE_CODELINGUA:\n return { ...state }\n\n default:\n return state\n }\n}\n\nexport default codelingua\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function route(page: string): "codelingua-main" | "codelingua-list" | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default function route(page) {
|
|
2
|
+
switch (page) {
|
|
3
|
+
case 'codelingua-main':
|
|
4
|
+
import('./pages/main');
|
|
5
|
+
return page;
|
|
6
|
+
case 'codelingua-list':
|
|
7
|
+
import('./pages/codelingua/codelingua-list-page');
|
|
8
|
+
return page;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE;QACZ,KAAK,iBAAiB;YACpB,MAAM,CAAC,cAAc,CAAC,CAAA;YACtB,OAAO,IAAI,CAAA;QAEb,KAAK,iBAAiB;YACpB,MAAM,CAAC,yCAAyC,CAAC,CAAA;YACjD,OAAO,IAAI,CAAA;KACd;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case 'codelingua-main':\n import('./pages/main')\n return page\n \n case 'codelingua-list':\n import('./pages/codelingua/codelingua-list-page')\n return page\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../../node_modules/lerna/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../client/bootstrap.ts","../client/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"f1c9fe42b65437a61104e601eb298c5c859fb522b483f1bdb700eed67a16f980",{"version":"1f8f1bd57f21c36cc25547a0cb99a097f5e5443815789833d230741315a3a948","signature":"aac4ddff3d5c1247433870879e9838b1e23b81a9b62c75f59c3e1b64802f2b16"},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"a7534271773a27ff7d136d550e86b41894d8090fa857ba4c02b5bb18d2eb1c8e","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","b8e431e9b9bb2dc832b23d4e3e02774e953d5537998923f215ea446169e9a61e","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"b85c02e14ecb2a873dad5a1de72319b265160ba48f1b83661aeb3bba1366c1bc","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","fc3764040518a1008dd04bdc80964591b566b896283e00df85c95851c1f46237","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","790623a47c5eda62910098884ecb154dc0e5f3a23fc36c1bfb3b5b9ed44e2c2d","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"f5490f53d40291cc8607f5463434d1ac6c5564bc4fbb03abceb03a8f6b014457","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","0cab4d7d4edc40cd3af9eea7c3ed6d1016910c0954c49c4297e479bf3822a625","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270","1fb6c5ec52332a8b531a8d7a5300ac9301f98c4fe62f68e744e0841ccba65e7e",{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","bbda6ea452a2386093a1eda18a6e26a989e98869f1b9f37e46f510a986d2e740","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"75dd741ca6a6c8d2437a6ca8349b64b816421dbf9fe82dd026afaba965576962","affectsGlobalScope":true},{"version":"8799401a7ab57764f0d464513a7fa7c72e1d70a226b172ec60fff534ea94d108","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"247aa3419c98713231952b33801d4f46563fe542e03604acd8c63ac45a32409c","6c1e688f95fcaf53b1e41c0fdadf2c1cfc96fa924eaf7f9fdb60f96deb0a4986","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","db25694be959314fd1e868d72e567746db1db9e2001fae545d12d2a8c1bba1b8","43883cf3635bb1846cbdc6c363787b76227677388c74f7313e3f0edb380840fa","2d47012580f859dae201d2eef898a416bdae719dffc087dfd06aefe3de2f9c8d","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","2cec1a31729b9b01e9294c33fc9425d336eff067282809761ad2e74425d6d2a5",{"version":"240c702fb4b3bd54d83ee167d80fa7f0cd7300fef7eea0b32cef33129740893c","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","sourceMap":true,"strict":true,"target":4,"useDefineForClassFields":false},"fileIdsList":[[93],[93,103],[93,105,108],[47,93],[50,93],[51,56,84,93],[52,63,64,71,81,92,93],[52,53,63,71,93],[54,93],[55,56,64,72,93],[56,81,89,93],[57,59,63,71,93],[58,93],[59,60,93],[63,93],[61,63,93],[63,64,65,81,92,93],[63,64,65,78,81,84,93],[93,97],[59,63,66,71,81,92,93],[63,64,66,67,71,81,89,92,93],[66,68,81,89,92,93],[47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],[63,69,93],[70,92,93],[59,63,71,81,93],[72,93],[73,93],[50,74,93],[75,91,93,97],[76,93],[77,93],[63,78,79,93],[78,80,93,95],[51,63,81,82,83,84,93],[51,81,83,93],[81,82,93],[84,93],[85,93],[81,93],[63,87,88,93],[87,88,93],[56,71,81,89,93],[90,93],[71,91,93],[51,66,77,92,93],[56,93],[81,93,94],[93,95],[93,96],[51,56,63,65,74,81,92,93,95,97],[81,93,98],[93,101,107],[93,105],[93,102,106],[93,104],[44,93]],"referencedMap":[[101,1],[104,2],[103,1],[109,3],[47,4],[48,4],[50,5],[51,6],[52,7],[53,8],[54,9],[55,10],[56,11],[57,12],[58,13],[59,14],[60,14],[62,15],[61,16],[63,15],[64,17],[65,18],[49,19],[99,1],[66,20],[67,21],[68,22],[100,23],[69,24],[70,25],[71,26],[72,27],[73,28],[74,29],[75,30],[76,31],[77,32],[78,33],[79,33],[80,34],[81,35],[83,36],[82,37],[84,38],[85,39],[86,40],[87,41],[88,42],[89,43],[90,44],[91,45],[92,46],[93,47],[94,48],[95,49],[96,50],[97,51],[98,52],[102,1],[108,53],[106,54],[107,55],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[105,56],[44,1],[45,57],[46,1]],"exportedModulesMap":[[101,1],[104,2],[103,1],[109,3],[47,4],[48,4],[50,5],[51,6],[52,7],[53,8],[54,9],[55,10],[56,11],[57,12],[58,13],[59,14],[60,14],[62,15],[61,16],[63,15],[64,17],[65,18],[49,19],[99,1],[66,20],[67,21],[68,22],[100,23],[69,24],[70,25],[71,26],[72,27],[73,28],[74,29],[75,30],[76,31],[77,32],[78,33],[79,33],[80,34],[81,35],[83,36],[82,37],[84,38],[85,39],[86,40],[87,41],[88,42],[89,43],[90,44],[91,45],[92,46],[93,47],[94,48],[95,49],[96,50],[97,51],[98,52],[102,1],[108,53],[106,54],[107,55],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[105,56],[44,1]],"semanticDiagnosticsPerFile":[101,104,103,109,47,48,50,51,52,53,54,55,56,57,58,59,60,62,61,63,64,65,49,99,66,67,68,100,69,70,71,72,73,74,75,76,77,78,79,80,81,83,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,102,108,106,107,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,34,31,32,33,35,7,36,41,42,37,38,39,40,1,43,105,44,45,46]},"version":"4.9.5"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiDocCompletion = void 0;
|
|
4
|
+
const openai_connection_1 = require("./openai-connection");
|
|
5
|
+
async function apiDocCompletion({ code, language = 'en-US' }) {
|
|
6
|
+
try {
|
|
7
|
+
const completion = await openai_connection_1.client.createChatCompletion({
|
|
8
|
+
model: 'gpt-3.5-turbo',
|
|
9
|
+
messages: [
|
|
10
|
+
{
|
|
11
|
+
role: 'system',
|
|
12
|
+
content: `You are an assistant that takes in JavaScript or TypeScript code and generates detailed developer documentation in markdown format.
|
|
13
|
+
And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
role: 'user',
|
|
17
|
+
content: `Here is some code: [${code}]. Can you help generate a detailed explanation and markdown documentation for this code?`
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
role: 'assistant',
|
|
21
|
+
content: `Please generate the documentation according to this locale code "${language}".`
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
return completion.data.choices[0].message.content;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error(error);
|
|
29
|
+
return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.apiDocCompletion = apiDocCompletion;
|
|
33
|
+
//# sourceMappingURL=api-doc-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-doc-completion.js","sourceRoot":"","sources":["../../server/controllers/api-doc-completion.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAErC,KAAK,UAAU,gBAAgB,CAAC,EACrC,IAAI,EACJ,QAAQ,GAAG,OAAO,EAInB;IACC,IAAI;QACF,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE;oJACiI;iBAC3I;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,uBAAuB,IAAI,2FAA2F;iBAChI;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,oEAAoE,QAAQ,IAAI;iBAC1F;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;KACrG;AACH,CAAC;AAhCD,4CAgCC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function apiDocCompletion({\n code,\n language = 'en-US'\n}: {\n code: string\n language?: string\n}): Promise<string> {\n try {\n const completion = await client.createChatCompletion({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: `You are an assistant that takes in JavaScript or TypeScript code and generates detailed developer documentation in markdown format.\n And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`\n },\n {\n role: 'user',\n content: `Here is some code: [${code}]. Can you help generate a detailed explanation and markdown documentation for this code?`\n },\n {\n role: 'assistant',\n content: `Please generate the documentation according to this locale code \"${language}\".`\n }\n ]\n })\n\n return completion.data.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatCompletion = void 0;
|
|
4
|
+
const openai_connection_1 = require("./openai-connection");
|
|
5
|
+
async function chatCompletion({ content }) {
|
|
6
|
+
try {
|
|
7
|
+
const completion = await openai_connection_1.client.createChatCompletion({
|
|
8
|
+
model: 'gpt-3.5-turbo',
|
|
9
|
+
messages: [
|
|
10
|
+
{
|
|
11
|
+
role: 'system',
|
|
12
|
+
content: `You are an assistant that generates detailed information in response to user requests. And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
role: 'user',
|
|
16
|
+
content
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
role: 'assistant',
|
|
20
|
+
content: 'Sure, please fetch the information in JSON format.'
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
return completion.data.choices[0].message.content;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error(error);
|
|
28
|
+
return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.chatCompletion = chatCompletion;
|
|
32
|
+
//# sourceMappingURL=chat-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion.js","sourceRoot":"","sources":["../../server/controllers/chat-completion.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAErC,KAAK,UAAU,cAAc,CAAC,EAAE,OAAO,EAAuB;IACnE,IAAI;QACF,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,gOAAgO;iBAC1O;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO;iBACR;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,oDAAoD;iBAC9D;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;KACrG;AACH,CAAC;AAzBD,wCAyBC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function chatCompletion({ content }: { content: string }): Promise<string> {\n try {\n const completion = await client.createChatCompletion({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: `You are an assistant that generates detailed information in response to user requests. And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`\n },\n {\n role: 'user',\n content\n },\n {\n role: 'assistant',\n content: 'Sure, please fetch the information in JSON format.'\n }\n ]\n })\n\n return completion.data.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decipherCode = void 0;
|
|
4
|
+
const openai_connection_1 = require("./openai-connection");
|
|
5
|
+
async function decipherCode({ code, system, language = 'en-US' }) {
|
|
6
|
+
try {
|
|
7
|
+
const completion = await openai_connection_1.client.createChatCompletion({
|
|
8
|
+
model: 'gpt-3.5-turbo',
|
|
9
|
+
messages: [
|
|
10
|
+
{
|
|
11
|
+
role: 'system',
|
|
12
|
+
content: 'You are a helpful assistant that translates system messages into user-friendly explanations.'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
role: 'user',
|
|
16
|
+
content: system
|
|
17
|
+
? `We received an message from the ${system} system. The message is: ${code}.`
|
|
18
|
+
: `The message is: ${code}.`
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
role: 'system',
|
|
22
|
+
content: `Translate the explanation according to this locale code "${language}".`
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
return completion.data.choices[0].message.content;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.error(error);
|
|
30
|
+
return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.decipherCode = decipherCode;
|
|
34
|
+
//# sourceMappingURL=decipher-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decipher-code.js","sourceRoot":"","sources":["../../server/controllers/decipher-code.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAErC,KAAK,UAAU,YAAY,CAAC,EACjC,IAAI,EACJ,MAAM,EACN,QAAQ,GAAG,OAAO,EAKnB;IACC,IAAI;QACF,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,8FAA8F;iBACxG;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,MAAM;wBACb,CAAC,CAAC,mCAAmC,MAAM,4BAA4B,IAAI,GAAG;wBAC9E,CAAC,CAAC,mBAAmB,IAAI,GAAG;iBAC/B;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,4DAA4D,QAAQ,IAAI;iBAClF;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;KACrG;AACH,CAAC;AAnCD,oCAmCC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function decipherCode({\n code,\n system,\n language = 'en-US'\n}: {\n code: string\n system?: string\n language?: string\n}): Promise<string> {\n try {\n const completion = await client.createChatCompletion({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: 'You are a helpful assistant that translates system messages into user-friendly explanations.'\n },\n {\n role: 'user',\n content: system\n ? `We received an message from the ${system} system. The message is: ${code}.`\n : `The message is: ${code}.`\n },\n {\n role: 'system',\n content: `Translate the explanation according to this locale code \"${language}\".`\n }\n ]\n })\n\n return completion.data.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decipherErrorCode = void 0;
|
|
4
|
+
const openai_connection_1 = require("./openai-connection");
|
|
5
|
+
async function decipherErrorCode({ code, system, language = 'en-US' }) {
|
|
6
|
+
try {
|
|
7
|
+
const completion = await openai_connection_1.client.createChatCompletion({
|
|
8
|
+
model: 'gpt-3.5-turbo',
|
|
9
|
+
messages: [
|
|
10
|
+
{
|
|
11
|
+
role: 'system',
|
|
12
|
+
content: 'You are a helpful assistant that translates error messages into user-friendly explanations.'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
role: 'user',
|
|
16
|
+
content: system
|
|
17
|
+
? `We received an error from the ${system} system. The error message is: ${code}.`
|
|
18
|
+
: `The error message is: ${code}.`
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
role: 'system',
|
|
22
|
+
content: `Translate the explanation according to this locale code "${language}".`
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
return completion.data.choices[0].message.content;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.error(error);
|
|
30
|
+
return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.decipherErrorCode = decipherErrorCode;
|
|
34
|
+
//# sourceMappingURL=decipher-error-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decipher-error-code.js","sourceRoot":"","sources":["../../server/controllers/decipher-error-code.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAErC,KAAK,UAAU,iBAAiB,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,QAAQ,GAAG,OAAO,EAKnB;IACC,IAAI;QACF,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,6FAA6F;iBACvG;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,MAAM;wBACb,CAAC,CAAC,iCAAiC,MAAM,kCAAkC,IAAI,GAAG;wBAClF,CAAC,CAAC,yBAAyB,IAAI,GAAG;iBACrC;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,4DAA4D,QAAQ,IAAI;iBAClF;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;KACrG;AACH,CAAC;AAnCD,8CAmCC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function decipherErrorCode({\n code,\n system,\n language = 'en-US'\n}: {\n code: string\n system?: string\n language?: string\n}): Promise<string> {\n try {\n const completion = await client.createChatCompletion({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: 'You are a helpful assistant that translates error messages into user-friendly explanations.'\n },\n {\n role: 'user',\n content: system\n ? `We received an error from the ${system} system. The error message is: ${code}.`\n : `The error message is: ${code}.`\n },\n {\n role: 'system',\n content: `Translate the explanation according to this locale code \"${language}\".`\n }\n ]\n })\n\n return completion.data.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18nCompletion = void 0;
|
|
4
|
+
const openai_connection_1 = require("./openai-connection");
|
|
5
|
+
async function i18nCompletion({ json }) {
|
|
6
|
+
try {
|
|
7
|
+
const completion = await openai_connection_1.client.createChatCompletion({
|
|
8
|
+
model: 'gpt-3.5-turbo',
|
|
9
|
+
messages: [
|
|
10
|
+
{
|
|
11
|
+
role: 'system',
|
|
12
|
+
content: `You are an assistant that takes a JSON file of key-value pairs in one language and generates equivalent JSON files in other languages.
|
|
13
|
+
And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
role: 'user',
|
|
17
|
+
content: `Here is a JSON file in Korean: [${json}]. Can you help generate equivalent JSON files in these languages: English, Japanese, Chinese and Malaysian?`
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
role: 'assistant',
|
|
21
|
+
content: "Please generate the translations according to these locale codes: 'en', 'ja', 'zh', 'ms'."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
return completion.data.choices[0].message.content;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error(error);
|
|
29
|
+
return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.i18nCompletion = i18nCompletion;
|
|
33
|
+
//# sourceMappingURL=i18n-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-completion.js","sourceRoot":"","sources":["../../server/controllers/i18n-completion.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAErC,KAAK,UAAU,cAAc,CAAC,EAAE,IAAI,EAAoB;IAC7D,IAAI;QACF,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE;oJACiI;iBAC3I;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,mCAAmC,IAAI,8GAA8G;iBAC/J;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,2FAA2F;iBACrG;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;KAClD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;KACrG;AACH,CAAC;AA1BD,wCA0BC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function i18nCompletion({ json }: { json: string }): Promise<string> {\n try {\n const completion = await client.createChatCompletion({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: `You are an assistant that takes a JSON file of key-value pairs in one language and generates equivalent JSON files in other languages.\n And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`\n },\n {\n role: 'user',\n content: `Here is a JSON file in Korean: [${json}]. Can you help generate equivalent JSON files in these languages: English, Japanese, Chinese and Malaysian?`\n },\n {\n role: 'assistant',\n content: \"Please generate the translations according to these locale codes: 'en', 'ja', 'zh', 'ms'.\"\n }\n ]\n })\n\n return completion.data.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./openai-connection"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./chat-completion"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./i18n-completion"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./api-doc-completion"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./decipher-code"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./decipher-error-code"), exports);
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;AAAA,8DAAmC;AAEnC,4DAAiC;AACjC,4DAAiC;AACjC,+DAAoC;AACpC,0DAA+B;AAC/B,gEAAqC","sourcesContent":["export * from './openai-connection'\n\nexport * from './chat-completion'\nexport * from './i18n-completion'\nexport * from './api-doc-completion'\nexport * from './decipher-code'\nexport * from './decipher-error-code'\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
const openai_1 = require("openai");
|
|
5
|
+
const env_1 = require("@things-factory/env");
|
|
6
|
+
const OPENAI = env_1.config.get('openai', {});
|
|
7
|
+
const { organization, apiKey } = OPENAI;
|
|
8
|
+
if (!organization || !apiKey) {
|
|
9
|
+
console.error("'OPENAI_API_KEY' is not configured.");
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
const configuration = new openai_1.Configuration({
|
|
13
|
+
organization,
|
|
14
|
+
apiKey
|
|
15
|
+
});
|
|
16
|
+
exports.client = new openai_1.OpenAIApi(configuration);
|
|
17
|
+
//# sourceMappingURL=openai-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-connection.js","sourceRoot":"","sources":["../../server/controllers/openai-connection.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AACjD,6CAA4C;AAE5C,MAAM,MAAM,GAAG,YAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACvC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;AAEvC,IAAI,CAAC,YAAY,IAAI,CAAC,MAAM,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;CAChB;AAED,MAAM,aAAa,GAAG,IAAI,sBAAa,CAAC;IACtC,YAAY;IACZ,MAAM;CACP,CAAC,CAAA;AAEW,QAAA,MAAM,GAAG,IAAI,kBAAS,CAAC,aAAa,CAAC,CAAA","sourcesContent":["import { Configuration, OpenAIApi } from 'openai'\nimport { config } from '@things-factory/env'\n\nconst OPENAI = config.get('openai', {})\nconst { organization, apiKey } = OPENAI\n\nif (!organization || !apiKey) {\n console.error(\"'OPENAI_API_KEY' is not configured.\")\n process.exit(1)\n}\n\nconst configuration = new Configuration({\n organization,\n apiKey\n})\n\nexport const client = new OpenAIApi(configuration)\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./controllers"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./service"), exports);
|
|
6
|
+
require("./routes");
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,wDAA6B;AAC7B,oDAAyB;AAEzB,oBAAiB","sourcesContent":["export * from './controllers'\nexport * from './service'\n\nimport './routes'\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const controllers_1 = require("./controllers");
|
|
4
|
+
process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
|
|
5
|
+
/*
|
|
6
|
+
* can add global public routes to application (auth not required, tenancy not required)
|
|
7
|
+
*
|
|
8
|
+
* ex) routes.get('/path', async(context, next) => {})
|
|
9
|
+
* ex) routes.post('/path', async(context, next) => {})
|
|
10
|
+
*/
|
|
11
|
+
globalPublicRouter.post('/chat-completion', async (context, next) => {
|
|
12
|
+
const { content } = context.request.body;
|
|
13
|
+
const message = await (0, controllers_1.chatCompletion)({ content });
|
|
14
|
+
context.body = {
|
|
15
|
+
message
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
globalPublicRouter.post('/api-doc-completion', async (context, next) => {
|
|
19
|
+
const { code, language: requestedLanguage } = context.request.body;
|
|
20
|
+
const language = requestedLanguage || context.language;
|
|
21
|
+
const message = await (0, controllers_1.apiDocCompletion)({ code, language });
|
|
22
|
+
context.body = {
|
|
23
|
+
message
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
globalPublicRouter.post('/i18n-completion', async (context, next) => {
|
|
27
|
+
const { json } = context.request.body;
|
|
28
|
+
const message = await (0, controllers_1.i18nCompletion)({ json });
|
|
29
|
+
context.body = {
|
|
30
|
+
message
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
globalPublicRouter.post('/code-decipher', async (context, next) => {
|
|
34
|
+
const { code, system, language: requestedLanguage } = context.request.body;
|
|
35
|
+
const language = requestedLanguage || context.language;
|
|
36
|
+
const message = await (0, controllers_1.decipherCode)({ code, system, language });
|
|
37
|
+
context.body = {
|
|
38
|
+
message
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
globalPublicRouter.post('/error-code-decipher', async (context, next) => {
|
|
42
|
+
const { code, system, language: requestedLanguage } = context.request.body;
|
|
43
|
+
const language = requestedLanguage || context.language;
|
|
44
|
+
const message = await (0, controllers_1.decipherErrorCode)({ code, system, language });
|
|
45
|
+
context.body = {
|
|
46
|
+
message
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
process.on('bootstrap-module-global-private-route', (app, globalPrivateRouter) => {
|
|
51
|
+
/*
|
|
52
|
+
* can add global private routes to application (auth required, tenancy not required)
|
|
53
|
+
*/
|
|
54
|
+
});
|
|
55
|
+
process.on('bootstrap-module-domain-public-route', (app, domainPublicRouter) => {
|
|
56
|
+
/*
|
|
57
|
+
* can add domain public routes to application (auth not required, tenancy required)
|
|
58
|
+
*/
|
|
59
|
+
});
|
|
60
|
+
process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) => {
|
|
61
|
+
/*
|
|
62
|
+
* can add domain private routes to application (auth required, tenancy required)
|
|
63
|
+
*/
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAEA,+CAAiH;AAIjH,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;;;;OAKG;IACH,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA2B,CAAA;QAE/D,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,OAAO,EAAE,CAAC,CAAA;QAEjD,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACrE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA6B,CAAA;QAC3F,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,8BAAgB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QAE1D,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAClE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA2B,CAAA;QAE5D,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QAE9C,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAChE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAAyB,CAAA;QAC/F,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAY,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAE9D,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACtE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAAyB,CAAA;QAC/F,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAiB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEnE,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA","sourcesContent":["import { ChatCompletionInput } from 'service/chat-completion/chat-completion-type'\nimport { CodeDecipherInput } from 'service/code-decipher/code-decipher-type'\nimport { chatCompletion, apiDocCompletion, i18nCompletion, decipherCode, decipherErrorCode } from './controllers'\nimport { APIDocCompletionInput } from 'service/api-doc-completion/api-doc-completion-type'\nimport { i18nCompletionInput } from 'service/i18n-completion/i18n-completion-type'\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n /*\n * can add global public routes to application (auth not required, tenancy not required)\n *\n * ex) routes.get('/path', async(context, next) => {})\n * ex) routes.post('/path', async(context, next) => {})\n */\n globalPublicRouter.post('/chat-completion', async (context, next) => {\n const { content } = context.request.body as ChatCompletionInput\n\n const message = await chatCompletion({ content })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/api-doc-completion', async (context, next) => {\n const { code, language: requestedLanguage } = context.request.body as APIDocCompletionInput\n const language = requestedLanguage || context.language\n\n const message = await apiDocCompletion({ code, language })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/i18n-completion', async (context, next) => {\n const { json } = context.request.body as i18nCompletionInput\n\n const message = await i18nCompletion({ json })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/code-decipher', async (context, next) => {\n const { code, system, language: requestedLanguage } = context.request.body as CodeDecipherInput\n const language = requestedLanguage || context.language\n\n const message = await decipherCode({ code, system, language })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/error-code-decipher', async (context, next) => {\n const { code, system, language: requestedLanguage } = context.request.body as CodeDecipherInput\n const language = requestedLanguage || context.language\n\n const message = await decipherErrorCode({ code, system, language })\n\n context.body = {\n message\n }\n })\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {\n /*\n * can add global private routes to application (auth required, tenancy not required)\n */\n})\n\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {\n /*\n * can add domain public routes to application (auth not required, tenancy required)\n */\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n /*\n * can add domain private routes to application (auth required, tenancy required)\n */\n})\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIDocCompletionResolver = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
require("@things-factory/auth-base"); // for ResolverContext
|
|
7
|
+
const api_doc_completion_type_1 = require("./api-doc-completion-type");
|
|
8
|
+
const controllers_1 = require("../../controllers");
|
|
9
|
+
let APIDocCompletionResolver = class APIDocCompletionResolver {
|
|
10
|
+
async APIDocCompletion(input, context) {
|
|
11
|
+
const { code, language: requestedLanguage } = input;
|
|
12
|
+
const language = requestedLanguage || context.language;
|
|
13
|
+
const message = await (0, controllers_1.apiDocCompletion)({ code, language });
|
|
14
|
+
return {
|
|
15
|
+
message
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, type_graphql_1.Query)(() => api_doc_completion_type_1.APIDocCompletionOutput),
|
|
21
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('input')),
|
|
22
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
23
|
+
tslib_1.__metadata("design:type", Function),
|
|
24
|
+
tslib_1.__metadata("design:paramtypes", [api_doc_completion_type_1.APIDocCompletionInput, Object]),
|
|
25
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
26
|
+
], APIDocCompletionResolver.prototype, "APIDocCompletion", null);
|
|
27
|
+
APIDocCompletionResolver = tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Resolver)()
|
|
29
|
+
], APIDocCompletionResolver);
|
|
30
|
+
exports.APIDocCompletionResolver = APIDocCompletionResolver;
|
|
31
|
+
//# sourceMappingURL=api-doc-completion-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-doc-completion-resolver.js","sourceRoot":"","sources":["../../../server/service/api-doc-completion/api-doc-completion-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AACxD,qCAAkC,CAAC,sBAAsB;AACzD,uEAAyF;AACzF,mDAAoD;AAG7C,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAE7B,AAAN,KAAK,CAAC,gBAAgB,CACN,KAA4B,EACnC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAA;QACnD,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,8BAAgB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QAE1D,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA;AAbO;IADL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,gDAAsB,CAAC;IAEjC,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,+CAAqB;;gEAW3C;AAdU,wBAAwB;IADpC,IAAA,uBAAQ,GAAE;GACE,wBAAwB,CAepC;AAfY,4DAAwB","sourcesContent":["import { Resolver, Query, Arg, Ctx } from 'type-graphql'\nimport '@things-factory/auth-base' // for ResolverContext\nimport { APIDocCompletionInput, APIDocCompletionOutput } from './api-doc-completion-type'\nimport { apiDocCompletion } from '../../controllers'\n\n@Resolver()\nexport class APIDocCompletionResolver {\n @Query(() => APIDocCompletionOutput)\n async APIDocCompletion(\n @Arg('input') input: APIDocCompletionInput,\n @Ctx() context: ResolverContext\n ): Promise<APIDocCompletionOutput> {\n const { code, language: requestedLanguage } = input\n const language = requestedLanguage || context.language\n\n const message = await apiDocCompletion({ code, language })\n\n return {\n message\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIDocCompletionOutput = exports.APIDocCompletionInput = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
let APIDocCompletionInput = class APIDocCompletionInput {
|
|
7
|
+
};
|
|
8
|
+
tslib_1.__decorate([
|
|
9
|
+
(0, type_graphql_1.Field)(),
|
|
10
|
+
tslib_1.__metadata("design:type", String)
|
|
11
|
+
], APIDocCompletionInput.prototype, "code", void 0);
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
14
|
+
tslib_1.__metadata("design:type", String)
|
|
15
|
+
], APIDocCompletionInput.prototype, "language", void 0);
|
|
16
|
+
APIDocCompletionInput = tslib_1.__decorate([
|
|
17
|
+
(0, type_graphql_1.InputType)()
|
|
18
|
+
], APIDocCompletionInput);
|
|
19
|
+
exports.APIDocCompletionInput = APIDocCompletionInput;
|
|
20
|
+
let APIDocCompletionOutput = class APIDocCompletionOutput {
|
|
21
|
+
};
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], APIDocCompletionOutput.prototype, "message", void 0);
|
|
26
|
+
APIDocCompletionOutput = tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.ObjectType)()
|
|
28
|
+
], APIDocCompletionOutput);
|
|
29
|
+
exports.APIDocCompletionOutput = APIDocCompletionOutput;
|
|
30
|
+
//# sourceMappingURL=api-doc-completion-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-doc-completion-type.js","sourceRoot":"","sources":["../../../server/service/api-doc-completion/api-doc-completion-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAGpD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAMjC,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;mDACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACT;AALN,qBAAqB;IADjC,IAAA,wBAAS,GAAE;GACC,qBAAqB,CAMjC;AANY,sDAAqB;AAS3B,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAGlC,CAAA;AAFC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACV;AAFL,sBAAsB;IADlC,IAAA,yBAAU,GAAE;GACA,sBAAsB,CAGlC;AAHY,wDAAsB","sourcesContent":["import { ObjectType, Field, InputType } from 'type-graphql'\n\n@InputType()\nexport class APIDocCompletionInput {\n @Field()\n code: string\n\n @Field({ nullable: true })\n language?: string\n}\n\n@ObjectType()\nexport class APIDocCompletionOutput {\n @Field({ nullable: true })\n message?: string\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const api_doc_completion_resolver_1 = require("./api-doc-completion-resolver");
|
|
5
|
+
exports.entities = [];
|
|
6
|
+
exports.resolvers = [api_doc_completion_resolver_1.APIDocCompletionResolver];
|
|
7
|
+
exports.subscribers = [];
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/api-doc-completion/index.ts"],"names":[],"mappings":";;;AAAA,+EAAwE;AAE3D,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,sDAAwB,CAAC,CAAA;AACtC,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { APIDocCompletionResolver } from './api-doc-completion-resolver'\n\nexport const entities = []\nexport const resolvers = [APIDocCompletionResolver]\nexport const subscribers = []\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatCompletionResolver = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
require("@things-factory/auth-base"); // for ResolverContext
|
|
7
|
+
const chat_completion_type_1 = require("./chat-completion-type");
|
|
8
|
+
const controllers_1 = require("../../controllers");
|
|
9
|
+
let ChatCompletionResolver = class ChatCompletionResolver {
|
|
10
|
+
async chatCompletion(input, context) {
|
|
11
|
+
const { content } = input;
|
|
12
|
+
const message = await (0, controllers_1.chatCompletion)({ content });
|
|
13
|
+
return {
|
|
14
|
+
message
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Query)(() => chat_completion_type_1.ChatCompletionOutput),
|
|
20
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('input')),
|
|
21
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
22
|
+
tslib_1.__metadata("design:type", Function),
|
|
23
|
+
tslib_1.__metadata("design:paramtypes", [chat_completion_type_1.ChatCompletionInput, Object]),
|
|
24
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
25
|
+
], ChatCompletionResolver.prototype, "chatCompletion", null);
|
|
26
|
+
ChatCompletionResolver = tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.Resolver)()
|
|
28
|
+
], ChatCompletionResolver);
|
|
29
|
+
exports.ChatCompletionResolver = ChatCompletionResolver;
|
|
30
|
+
//# sourceMappingURL=chat-completion-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion-resolver.js","sourceRoot":"","sources":["../../../server/service/chat-completion/chat-completion-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AACxD,qCAAkC,CAAC,sBAAsB;AACzD,iEAAkF;AAClF,mDAAkD;AAG3C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAE3B,AAAN,KAAK,CAAC,cAAc,CACJ,KAA0B,EACjC,OAAwB;QAE/B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;QAEzB,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,OAAO,EAAE,CAAC,CAAA;QAEjD,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA;AAZO;IADL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,2CAAoB,CAAC;IAE/B,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,0CAAmB;;4DAUzC;AAbU,sBAAsB;IADlC,IAAA,uBAAQ,GAAE;GACE,sBAAsB,CAclC;AAdY,wDAAsB","sourcesContent":["import { Resolver, Query, Arg, Ctx } from 'type-graphql'\nimport '@things-factory/auth-base' // for ResolverContext\nimport { ChatCompletionInput, ChatCompletionOutput } from './chat-completion-type'\nimport { chatCompletion } from '../../controllers'\n\n@Resolver()\nexport class ChatCompletionResolver {\n @Query(() => ChatCompletionOutput)\n async chatCompletion(\n @Arg('input') input: ChatCompletionInput,\n @Ctx() context: ResolverContext\n ): Promise<ChatCompletionOutput> {\n const { content } = input\n\n const message = await chatCompletion({ content })\n\n return {\n message\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatCompletionOutput = exports.ChatCompletionInput = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
let ChatCompletionInput = class ChatCompletionInput {
|
|
7
|
+
};
|
|
8
|
+
tslib_1.__decorate([
|
|
9
|
+
(0, type_graphql_1.Field)(),
|
|
10
|
+
tslib_1.__metadata("design:type", String)
|
|
11
|
+
], ChatCompletionInput.prototype, "content", void 0);
|
|
12
|
+
ChatCompletionInput = tslib_1.__decorate([
|
|
13
|
+
(0, type_graphql_1.InputType)()
|
|
14
|
+
], ChatCompletionInput);
|
|
15
|
+
exports.ChatCompletionInput = ChatCompletionInput;
|
|
16
|
+
let ChatCompletionOutput = class ChatCompletionOutput {
|
|
17
|
+
};
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], ChatCompletionOutput.prototype, "message", void 0);
|
|
22
|
+
ChatCompletionOutput = tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.ObjectType)()
|
|
24
|
+
], ChatCompletionOutput);
|
|
25
|
+
exports.ChatCompletionOutput = ChatCompletionOutput;
|
|
26
|
+
//# sourceMappingURL=chat-completion-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion-type.js","sourceRoot":"","sources":["../../../server/service/chat-completion/chat-completion-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAGpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAG/B,CAAA;AAFC;IAAC,IAAA,oBAAK,GAAE;;oDACO;AAFJ,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAG/B;AAHY,kDAAmB;AAMzB,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAGhC,CAAA;AAFC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;AAFL,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAGhC;AAHY,oDAAoB","sourcesContent":["import { ObjectType, Field, InputType } from 'type-graphql'\n\n@InputType()\nexport class ChatCompletionInput {\n @Field()\n content: string\n}\n\n@ObjectType()\nexport class ChatCompletionOutput {\n @Field({ nullable: true })\n message?: string\n}\n"]}
|