Spaces:
Runtime error
Runtime error
Commit
·
e6e3b33
1
Parent(s):
4a4aae5
:rocket:
Browse files- .dockerignore +5 -0
- Dockerfile +22 -0
- README.md +1 -0
- chunks/app/client.manifest.mjs +152 -0
- chunks/app/client.manifest.mjs.map +1 -0
- chunks/app/styles.mjs +4 -0
- chunks/app/styles.mjs.map +1 -0
- chunks/completions.post.mjs +46 -0
- chunks/completions.post.mjs.map +1 -0
- chunks/completions.post2.mjs +46 -0
- chunks/completions.post2.mjs.map +1 -0
- chunks/crypto.post.mjs +20 -0
- chunks/crypto.post.mjs.map +1 -0
- chunks/error-500.mjs +21 -0
- chunks/error-500.mjs.map +1 -0
- chunks/generations.post.mjs +46 -0
- chunks/generations.post.mjs.map +1 -0
- chunks/h3.mjs +188 -0
- chunks/h3.mjs.map +1 -0
- chunks/handlers/renderer.mjs +273 -0
- chunks/handlers/renderer.mjs.map +1 -0
- chunks/models.get.mjs +88 -0
- chunks/models.get.mjs.map +1 -0
- chunks/nitro/node-server.mjs +1139 -0
- chunks/nitro/node-server.mjs.map +0 -0
- chunks/rollup/_virtual_head-static.mjs +4 -0
- chunks/rollup/_virtual_head-static.mjs.map +1 -0
- chunks/rollup/_virtual_spa-template.mjs +4 -0
- chunks/rollup/_virtual_spa-template.mjs.map +1 -0
- index.mjs +23 -0
- index.mjs.map +1 -0
- package.json +91 -0
.dockerignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
node_modules
|
2 |
+
Dockerfile
|
3 |
+
.dockerignore
|
4 |
+
.git
|
5 |
+
.gitignore
|
Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 设置基础镜像
|
2 |
+
# FROM node:18-alpine
|
3 |
+
FROM node:20-alpine3.16
|
4 |
+
|
5 |
+
# 设置工作目录
|
6 |
+
WORKDIR /app
|
7 |
+
|
8 |
+
# 复制 package.json 和 package-lock.json 文件
|
9 |
+
COPY package*.json ./
|
10 |
+
|
11 |
+
|
12 |
+
# 安装依赖
|
13 |
+
RUN npm install
|
14 |
+
|
15 |
+
# 复制源代码
|
16 |
+
COPY . .
|
17 |
+
|
18 |
+
# 暴露应用端口, 迷惑行为,只是提示项目里面启动的端口
|
19 |
+
EXPOSE 3000
|
20 |
+
|
21 |
+
# 运行应用
|
22 |
+
CMD [ "index.mjs" ]
|
README.md
CHANGED
@@ -5,6 +5,7 @@ colorFrom: green
|
|
5 |
colorTo: pink
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
|
10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
5 |
colorTo: pink
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
+
app_port: 3000
|
9 |
---
|
10 |
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
chunks/app/client.manifest.mjs
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const client_manifest = {
|
2 |
+
"_config.c258e904.js": {
|
3 |
+
"resourceType": "script",
|
4 |
+
"module": true,
|
5 |
+
"file": "config.c258e904.js",
|
6 |
+
"imports": [
|
7 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
"i18n-meta.json": {
|
11 |
+
"file": "i18n-meta.json",
|
12 |
+
"src": "i18n-meta.json"
|
13 |
+
},
|
14 |
+
"node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-404.css": {
|
15 |
+
"resourceType": "style",
|
16 |
+
"file": "error-404.871584dc.css",
|
17 |
+
"src": "node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-404.css"
|
18 |
+
},
|
19 |
+
"node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-404.vue": {
|
20 |
+
"resourceType": "script",
|
21 |
+
"module": true,
|
22 |
+
"css": [
|
23 |
+
"error-404.871584dc.css"
|
24 |
+
],
|
25 |
+
"file": "error-404.717bb680.js",
|
26 |
+
"imports": [
|
27 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js"
|
28 |
+
],
|
29 |
+
"isDynamicEntry": true,
|
30 |
+
"src": "node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-404.vue"
|
31 |
+
},
|
32 |
+
"error-404.871584dc.css": {
|
33 |
+
"file": "error-404.871584dc.css",
|
34 |
+
"resourceType": "style"
|
35 |
+
},
|
36 |
+
"node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-500.css": {
|
37 |
+
"resourceType": "style",
|
38 |
+
"file": "error-500.5504fd74.css",
|
39 |
+
"src": "node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-500.css"
|
40 |
+
},
|
41 |
+
"node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-500.vue": {
|
42 |
+
"resourceType": "script",
|
43 |
+
"module": true,
|
44 |
+
"css": [
|
45 |
+
"error-500.5504fd74.css"
|
46 |
+
],
|
47 |
+
"file": "error-500.0dcea73a.js",
|
48 |
+
"imports": [
|
49 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js"
|
50 |
+
],
|
51 |
+
"isDynamicEntry": true,
|
52 |
+
"src": "node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-500.vue"
|
53 |
+
},
|
54 |
+
"error-500.5504fd74.css": {
|
55 |
+
"file": "error-500.5504fd74.css",
|
56 |
+
"resourceType": "style"
|
57 |
+
},
|
58 |
+
"node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/Icon.css": {
|
59 |
+
"resourceType": "style",
|
60 |
+
"file": "Icon.7f9eef6a.css",
|
61 |
+
"src": "node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/Icon.css"
|
62 |
+
},
|
63 |
+
"node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/Icon.vue": {
|
64 |
+
"resourceType": "script",
|
65 |
+
"module": true,
|
66 |
+
"css": [
|
67 |
+
"Icon.7f9eef6a.css"
|
68 |
+
],
|
69 |
+
"file": "Icon.3b076208.js",
|
70 |
+
"imports": [
|
71 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js",
|
72 |
+
"_config.c258e904.js"
|
73 |
+
],
|
74 |
+
"isDynamicEntry": true,
|
75 |
+
"src": "node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/Icon.vue"
|
76 |
+
},
|
77 |
+
"Icon.7f9eef6a.css": {
|
78 |
+
"file": "Icon.7f9eef6a.css",
|
79 |
+
"resourceType": "style"
|
80 |
+
},
|
81 |
+
"node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/IconCSS.css": {
|
82 |
+
"resourceType": "style",
|
83 |
+
"file": "IconCSS.c81b379e.css",
|
84 |
+
"src": "node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/IconCSS.css"
|
85 |
+
},
|
86 |
+
"node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/IconCSS.vue": {
|
87 |
+
"resourceType": "script",
|
88 |
+
"module": true,
|
89 |
+
"css": [
|
90 |
+
"IconCSS.c81b379e.css"
|
91 |
+
],
|
92 |
+
"file": "IconCSS.eb488b91.js",
|
93 |
+
"imports": [
|
94 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js",
|
95 |
+
"_config.c258e904.js"
|
96 |
+
],
|
97 |
+
"isDynamicEntry": true,
|
98 |
+
"src": "node_modules/.pnpm/nuxt-icon@0.4.1_vue@3.3.4/node_modules/nuxt-icon/dist/runtime/IconCSS.vue"
|
99 |
+
},
|
100 |
+
"IconCSS.c81b379e.css": {
|
101 |
+
"file": "IconCSS.c81b379e.css",
|
102 |
+
"resourceType": "style"
|
103 |
+
},
|
104 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.css": {
|
105 |
+
"resourceType": "style",
|
106 |
+
"file": "entry.c3d50f7b.css",
|
107 |
+
"src": "node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.css"
|
108 |
+
},
|
109 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js": {
|
110 |
+
"resourceType": "script",
|
111 |
+
"module": true,
|
112 |
+
"css": [
|
113 |
+
"entry.c3d50f7b.css"
|
114 |
+
],
|
115 |
+
"dynamicImports": [
|
116 |
+
"node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-404.vue",
|
117 |
+
"node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-500.vue"
|
118 |
+
],
|
119 |
+
"file": "entry.f7d8c5bc.js",
|
120 |
+
"isEntry": true,
|
121 |
+
"src": "node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js"
|
122 |
+
},
|
123 |
+
"entry.c3d50f7b.css": {
|
124 |
+
"file": "entry.c3d50f7b.css",
|
125 |
+
"resourceType": "style"
|
126 |
+
},
|
127 |
+
"pages/index.css": {
|
128 |
+
"resourceType": "style",
|
129 |
+
"file": "index.8ccdfb9b.css",
|
130 |
+
"src": "pages/index.css"
|
131 |
+
},
|
132 |
+
"pages/index.vue": {
|
133 |
+
"resourceType": "script",
|
134 |
+
"module": true,
|
135 |
+
"css": [
|
136 |
+
"index.8ccdfb9b.css"
|
137 |
+
],
|
138 |
+
"file": "index.9ca75938.js",
|
139 |
+
"imports": [
|
140 |
+
"node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/app/entry.js"
|
141 |
+
],
|
142 |
+
"isDynamicEntry": true,
|
143 |
+
"src": "pages/index.vue"
|
144 |
+
},
|
145 |
+
"index.8ccdfb9b.css": {
|
146 |
+
"file": "index.8ccdfb9b.css",
|
147 |
+
"resourceType": "style"
|
148 |
+
}
|
149 |
+
};
|
150 |
+
|
151 |
+
export { client_manifest as default };
|
152 |
+
//# sourceMappingURL=client.manifest.mjs.map
|
chunks/app/client.manifest.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"client.manifest.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/.nuxt/dist/server/client.manifest.mjs"],"sourcesContent":null,"names":[],"mappings":"AAAA,wBAAe;AACf,EAAE,qBAAqB,EAAE;AACzB,IAAI,cAAc,EAAE,QAAQ;AAC5B,IAAI,QAAQ,EAAE,IAAI;AAClB,IAAI,MAAM,EAAE,oBAAoB;AAChC,IAAI,SAAS,EAAE;AACf,MAAM,uGAAuG;AAC7G,KAAK;AACL,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,MAAM,EAAE,gBAAgB;AAC5B,IAAI,KAAK,EAAE,gBAAgB;AAC3B,GAAG;AACH,EAAE,0GAA0G,EAAE;AAC9G,IAAI,cAAc,EAAE,OAAO;AAC3B,IAAI,MAAM,EAAE,wBAAwB;AACpC,IAAI,KAAK,EAAE,0GAA0G;AACrH,GAAG;AACH,EAAE,0GAA0G,EAAE;AAC9G,IAAI,cAAc,EAAE,QAAQ;AAC5B,IAAI,QAAQ,EAAE,IAAI;AAClB,IAAI,KAAK,EAAE;AACX,MAAM,wBAAwB;AAC9B,KAAK;AACL,IAAI,MAAM,EAAE,uBAAuB;AACnC,IAAI,SAAS,EAAE;AACf,MAAM,uGAAuG;AAC7G,KAAK;AACL,IAAI,gBAAgB,EAAE,IAAI;AAC1B,IAAI,KAAK,EAAE,0GAA0G;AACrH,GAAG;AACH,EAAE,wBAAwB,EAAE;AAC5B,IAAI,MAAM,EAAE,wBAAwB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B,IAAI,cAAc,EAAE,QAAQ;AAC5B,IAAI,QAAQ,EAAE,IAAI;AAClB,IAAI,KAAK,EAAE;AACX,MAAM,oBAAoB;AAC1B,KAAK;AACL,IAAI,MAAM,EAAE,mBAAmB;AAC/B,IAAI,SAAS,EAAE;AACf,MAAM,uGAAuG;AAC7G,KAAK;AACL,IAAI,gBAAgB,EAAE,IAAI;AAC1B,IAAI,KAAK,EAAE,iBAAiB;AAC5B,GAAG;AACH,EAAE,oBAAoB,EAAE;AACxB,IAAI,MAAM,EAAE,oBAAoB;AAChC,IAAI,cAAc,EAAE,OAAO;AAC3B,GAAG;AACH;;;;"}
|
chunks/app/styles.mjs
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const styles = {};
|
2 |
+
|
3 |
+
export { styles as default };
|
4 |
+
//# sourceMappingURL=styles.mjs.map
|
chunks/app/styles.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"styles.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/.nuxt/dist/server/styles.mjs"],"sourcesContent":null,"names":[],"mappings":"AACA,eAAe;;;;"}
|
chunks/completions.post.mjs
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { defineEventHandler, getHeaders, readBody } from 'h3';
|
2 |
+
import { s as setResStatus, e as errorHandler, g as getOpenAIApiInstance } from './h3.mjs';
|
3 |
+
import './crypto.post.mjs';
|
4 |
+
import 'crypto-js';
|
5 |
+
import 'openai';
|
6 |
+
import './nitro/node-server.mjs';
|
7 |
+
import 'node-fetch-native/polyfill';
|
8 |
+
import 'node:http';
|
9 |
+
import 'node:https';
|
10 |
+
import 'destr';
|
11 |
+
import 'ofetch';
|
12 |
+
import 'unenv/runtime/fetch/index';
|
13 |
+
import 'hookable';
|
14 |
+
import 'scule';
|
15 |
+
import 'klona';
|
16 |
+
import 'defu';
|
17 |
+
import 'ohash';
|
18 |
+
import 'ufo';
|
19 |
+
import 'unstorage';
|
20 |
+
import 'unstorage/drivers/fs';
|
21 |
+
import 'radix3';
|
22 |
+
import 'node:fs';
|
23 |
+
import 'node:url';
|
24 |
+
import 'pathe';
|
25 |
+
import '@intlify/bundle-utils';
|
26 |
+
import 'http-graceful-shutdown';
|
27 |
+
import 'axios';
|
28 |
+
|
29 |
+
const completions_post = defineEventHandler(async (event) => {
|
30 |
+
try {
|
31 |
+
const headers = getHeaders(event);
|
32 |
+
const body = await readBody(event);
|
33 |
+
const response = await createChatCompletion(headers, body);
|
34 |
+
setResStatus(event, response.status, response.statusText);
|
35 |
+
return response.data;
|
36 |
+
} catch (e) {
|
37 |
+
return await errorHandler(event, e);
|
38 |
+
}
|
39 |
+
});
|
40 |
+
async function createChatCompletion(headers, body) {
|
41 |
+
const openai = getOpenAIApiInstance("chat", headers, body);
|
42 |
+
return openai.createChatCompletion(body);
|
43 |
+
}
|
44 |
+
|
45 |
+
export { completions_post as default };
|
46 |
+
//# sourceMappingURL=completions.post.mjs.map
|
chunks/completions.post.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"completions.post.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/api/chat/completions.post.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,yBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,OAAA,GAAA,WAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,IAAA,GAAA,MAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,QAAA,GAAA,MAAA,oBAAA,CAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AAEA,IAAA,YAAA,CAAA,KAAA,EAAA,QAAA,CAAA,MAAA,EAAA,QAAA,CAAA,UAAA,CAAA,CAAA;AACA,IAAA,OAAA,QAAA,CAAA,IAAA,CAAA;AAAA,WACA,CAAA,EAAA;AACA,IAAA,OAAA,MAAA,YAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AAAA,GACA;AACA,CAAA,CAAA,CAAA;AAEA,eAAA,oBAAA,CACA,SACA,IACA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,oBAAA,CAAA,MAAA,EAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AACA,EAAA,OAAA,MAAA,CAAA,qBAAA,IAAA,CAAA,CAAA;AACA;;;;"}
|
chunks/completions.post2.mjs
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { defineEventHandler, getHeaders, readBody } from 'h3';
|
2 |
+
import { s as setResStatus, e as errorHandler, g as getOpenAIApiInstance } from './h3.mjs';
|
3 |
+
import './crypto.post.mjs';
|
4 |
+
import 'crypto-js';
|
5 |
+
import 'openai';
|
6 |
+
import './nitro/node-server.mjs';
|
7 |
+
import 'node-fetch-native/polyfill';
|
8 |
+
import 'node:http';
|
9 |
+
import 'node:https';
|
10 |
+
import 'destr';
|
11 |
+
import 'ofetch';
|
12 |
+
import 'unenv/runtime/fetch/index';
|
13 |
+
import 'hookable';
|
14 |
+
import 'scule';
|
15 |
+
import 'klona';
|
16 |
+
import 'defu';
|
17 |
+
import 'ohash';
|
18 |
+
import 'ufo';
|
19 |
+
import 'unstorage';
|
20 |
+
import 'unstorage/drivers/fs';
|
21 |
+
import 'radix3';
|
22 |
+
import 'node:fs';
|
23 |
+
import 'node:url';
|
24 |
+
import 'pathe';
|
25 |
+
import '@intlify/bundle-utils';
|
26 |
+
import 'http-graceful-shutdown';
|
27 |
+
import 'axios';
|
28 |
+
|
29 |
+
const completions_post = defineEventHandler(async (event) => {
|
30 |
+
try {
|
31 |
+
const headers = getHeaders(event);
|
32 |
+
const body = await readBody(event);
|
33 |
+
const response = await createCompletion(headers, body);
|
34 |
+
setResStatus(event, response.status, response.statusText);
|
35 |
+
return response.data;
|
36 |
+
} catch (e) {
|
37 |
+
return await errorHandler(event, e);
|
38 |
+
}
|
39 |
+
});
|
40 |
+
async function createCompletion(headers, body) {
|
41 |
+
const openai = getOpenAIApiInstance("text", headers, body);
|
42 |
+
return openai.createCompletion(body);
|
43 |
+
}
|
44 |
+
|
45 |
+
export { completions_post as default };
|
46 |
+
//# sourceMappingURL=completions.post2.mjs.map
|
chunks/completions.post2.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"completions.post2.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/api/completions.post.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,yBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,OAAA,GAAA,WAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,IAAA,GAAA,MAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,QAAA,GAAA,MAAA,gBAAA,CAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AAEA,IAAA,YAAA,CAAA,KAAA,EAAA,QAAA,CAAA,MAAA,EAAA,QAAA,CAAA,UAAA,CAAA,CAAA;AACA,IAAA,OAAA,QAAA,CAAA,IAAA,CAAA;AAAA,WACA,CAAA,EAAA;AACA,IAAA,OAAA,MAAA,YAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AAAA,GACA;AACA,CAAA,CAAA,CAAA;AAEA,eAAA,gBAAA,CACA,SACA,IACA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,oBAAA,CAAA,MAAA,EAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AACA,EAAA,OAAA,MAAA,CAAA,iBAAA,IAAA,CAAA,CAAA;AACA;;;;"}
|
chunks/crypto.post.mjs
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { defineEventHandler, readBody } from 'h3';
|
2 |
+
import CryptoJS from 'crypto-js';
|
3 |
+
|
4 |
+
const key = "lianginx";
|
5 |
+
const crypto_post = defineEventHandler(async (event) => {
|
6 |
+
const crypto = await readBody(event);
|
7 |
+
return aesCrypto(crypto);
|
8 |
+
});
|
9 |
+
function aesCrypto(crypto) {
|
10 |
+
if (crypto.type === "en") {
|
11 |
+
return CryptoJS.AES.encrypt(crypto.message, key).toString();
|
12 |
+
} else {
|
13 |
+
return CryptoJS.AES.decrypt(crypto.message, key).toString(
|
14 |
+
CryptoJS.enc.Utf8
|
15 |
+
);
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
export { aesCrypto, crypto_post as default };
|
20 |
+
//# sourceMappingURL=crypto.post.mjs.map
|
chunks/crypto.post.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"crypto.post.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/api/crypto.post.ts"],"sourcesContent":null,"names":[],"mappings":";;;AAGA,MAAA,GAAA,GAAA,UAAA,CAAA;AAEA,oBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,MAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,EAAA,OAAA,UAAA,MAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA;AAEA,SAAA,UAAA,MAAA,EAAA;AACA,EAAA,IAAA,MAAA,CAAA,SAAA,IAAA,EAAA;AACA,IAAA,OAAA,SAAA,GAAA,CAAA,OAAA,CAAA,OAAA,OAAA,EAAA,GAAA,EAAA,QAAA,EAAA,CAAA;AAAA,GACA,MAAA;AACA,IAAA,OAAA,SAAA,GAAA,CAAA,OAAA,CAAA,MAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA,QAAA;AAAA,MACA,SAAA,GAAA,CAAA,IAAA;AAAA,KACA,CAAA;AAAA,GACA;AACA;;;;"}
|
chunks/error-500.mjs
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const _messages = {"appName":"Nuxt","version":"","statusCode":500,"statusMessage":"Server error","description":"This page is temporarily unavailable."};
|
2 |
+
const _render = function({ messages }) {
|
3 |
+
var __t, __p = '';
|
4 |
+
__p += '<!DOCTYPE html><html><head><title>' +
|
5 |
+
((__t = ( messages.statusCode )) == null ? '' : __t) +
|
6 |
+
' - ' +
|
7 |
+
((__t = ( messages.statusMessage )) == null ? '' : __t) +
|
8 |
+
' | ' +
|
9 |
+
((__t = ( messages.appName )) == null ? '' : __t) +
|
10 |
+
'</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1,minimum-scale=1" name="viewport"><style>.spotlight{background:linear-gradient(45deg, #00DC82 0%, #36E4DA 50%, #0047E1 100%);filter:blur(20vh)}*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.grid{display:-ms-grid;display:grid}.place-content-center{place-content:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-medium{font-weight:500}.font-light{font-weight:300}.h-1\\/2{height:50%}.text-8xl{font-size:6rem;line-height:1}.text-xl{font-size:1.25rem;line-height:1.75rem}.leading-tight{line-height:1.25}.mb-8{margin-bottom:2rem}.mb-16{margin-bottom:4rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.overflow-hidden{overflow:hidden}.px-8{padding-left:2rem;padding-right:2rem}.fixed{position:fixed}.left-0{left:0}.right-0{right:0}.-bottom-1\\/2{bottom:-50%}.text-center{text-align:center}.text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width: 640px){.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\\:text-10xl{font-size:10rem;line-height:1}.sm\\:px-0{padding-left:0;padding-right:0}}@media (prefers-color-scheme: dark){.dark\\:bg-black{--tw-bg-opacity:1;background-color:rgba(0,0,0,var(--tw-bg-opacity))}.dark\\:text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}}</style><script>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll(\'link[rel="modulepreload"]\'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();</script></head><body class="font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"><div class="fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"></div><div class="max-w-520px text-center"><h1 class="text-8xl sm:text-10xl font-medium mb-8">' +
|
11 |
+
((__t = ( messages.statusCode )) == null ? '' : __t) +
|
12 |
+
'</h1><p class="text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight">' +
|
13 |
+
((__t = ( messages.description )) == null ? '' : __t) +
|
14 |
+
'</p></div></body></html>';
|
15 |
+
return __p
|
16 |
+
};
|
17 |
+
const _template = (messages) => _render({ messages: { ..._messages, ...messages } });
|
18 |
+
const template = _template;
|
19 |
+
|
20 |
+
export { template };
|
21 |
+
//# sourceMappingURL=error-500.mjs.map
|
chunks/error-500.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"error-500.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/node_modules/.pnpm/@nuxt+ui-templates@1.3.1/node_modules/@nuxt/ui-templates/dist/templates/error-500.mjs"],"sourcesContent":null,"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAA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{ defineEventHandler, getHeaders, readBody } from 'h3';
|
2 |
+
import { s as setResStatus, e as errorHandler, g as getOpenAIApiInstance } from './h3.mjs';
|
3 |
+
import './crypto.post.mjs';
|
4 |
+
import 'crypto-js';
|
5 |
+
import 'openai';
|
6 |
+
import './nitro/node-server.mjs';
|
7 |
+
import 'node-fetch-native/polyfill';
|
8 |
+
import 'node:http';
|
9 |
+
import 'node:https';
|
10 |
+
import 'destr';
|
11 |
+
import 'ofetch';
|
12 |
+
import 'unenv/runtime/fetch/index';
|
13 |
+
import 'hookable';
|
14 |
+
import 'scule';
|
15 |
+
import 'klona';
|
16 |
+
import 'defu';
|
17 |
+
import 'ohash';
|
18 |
+
import 'ufo';
|
19 |
+
import 'unstorage';
|
20 |
+
import 'unstorage/drivers/fs';
|
21 |
+
import 'radix3';
|
22 |
+
import 'node:fs';
|
23 |
+
import 'node:url';
|
24 |
+
import 'pathe';
|
25 |
+
import '@intlify/bundle-utils';
|
26 |
+
import 'http-graceful-shutdown';
|
27 |
+
import 'axios';
|
28 |
+
|
29 |
+
const generations_post = defineEventHandler(async (event) => {
|
30 |
+
try {
|
31 |
+
const headers = getHeaders(event);
|
32 |
+
const body = await readBody(event);
|
33 |
+
const response = await createImage(headers, body);
|
34 |
+
setResStatus(event, response.status, response.statusText);
|
35 |
+
return response.data;
|
36 |
+
} catch (e) {
|
37 |
+
await errorHandler(event, e);
|
38 |
+
}
|
39 |
+
});
|
40 |
+
async function createImage(headers, body) {
|
41 |
+
const openai = getOpenAIApiInstance("img", headers, body);
|
42 |
+
return openai.createImage(body);
|
43 |
+
}
|
44 |
+
|
45 |
+
export { generations_post as default };
|
46 |
+
//# sourceMappingURL=generations.post.mjs.map
|
chunks/generations.post.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"generations.post.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/api/images/generations.post.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { aesCrypto } from './crypto.post.mjs';
|
2 |
+
import { OpenAIApi, Configuration } from 'openai';
|
3 |
+
import { l as logger, u as useRuntimeConfig } from './nitro/node-server.mjs';
|
4 |
+
import axios from 'axios';
|
5 |
+
|
6 |
+
const pollingInterval = 1e3;
|
7 |
+
class AzureOpenAIApi extends OpenAIApi {
|
8 |
+
createImage(createImageRequest, options) {
|
9 |
+
var _a, _b;
|
10 |
+
const createImageUrl = (((_a = this.configuration) == null ? void 0 : _a.basePath) || this.basePath) + "/images/generations:submit";
|
11 |
+
const axiosRequestConfig = {
|
12 |
+
...options,
|
13 |
+
...(_b = this.configuration) == null ? void 0 : _b.baseOptions,
|
14 |
+
responseType: "json"
|
15 |
+
};
|
16 |
+
return this.axios.post(createImageUrl, createImageRequest, axiosRequestConfig).then((response) => {
|
17 |
+
const operationId = response.data.id;
|
18 |
+
return this.getImage(operationId, options);
|
19 |
+
}).catch((error) => {
|
20 |
+
return error;
|
21 |
+
});
|
22 |
+
}
|
23 |
+
getImage(operationId, options) {
|
24 |
+
var _a, _b;
|
25 |
+
const getImageUrl = (((_a = this.configuration) == null ? void 0 : _a.basePath) || this.basePath) + "/operations/images/" + operationId;
|
26 |
+
const axiosRequestConfig = {
|
27 |
+
...options,
|
28 |
+
...(_b = this.configuration) == null ? void 0 : _b.baseOptions,
|
29 |
+
responseType: "json"
|
30 |
+
};
|
31 |
+
return new Promise(
|
32 |
+
(resolve, reject) => {
|
33 |
+
const intervalId = setInterval(() => {
|
34 |
+
this.axios.get(getImageUrl, axiosRequestConfig).then((response) => {
|
35 |
+
const finishedStatus = [
|
36 |
+
"succeeded",
|
37 |
+
"canceled",
|
38 |
+
"failed",
|
39 |
+
"deleted"
|
40 |
+
];
|
41 |
+
if (finishedStatus.includes(response.data.status)) {
|
42 |
+
clearInterval(intervalId);
|
43 |
+
if (response.data.result) {
|
44 |
+
response.data = response.data.result;
|
45 |
+
}
|
46 |
+
resolve(response);
|
47 |
+
}
|
48 |
+
}).catch((error) => {
|
49 |
+
clearInterval(intervalId);
|
50 |
+
reject(error);
|
51 |
+
});
|
52 |
+
}, pollingInterval);
|
53 |
+
}
|
54 |
+
);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
function createAxiosInstance() {
|
59 |
+
const axiosRequestConfig = {
|
60 |
+
responseType: "stream",
|
61 |
+
timeout: 1e3 * 20,
|
62 |
+
timeoutErrorMessage: "**Network connection timed out. Please try again**"
|
63 |
+
// 使用代理,配置参考 https://axios-http.com/docs/req_config
|
64 |
+
// proxy: {
|
65 |
+
// protocol: "http",
|
66 |
+
// host: "127.0.0.1",
|
67 |
+
// port: 7890,
|
68 |
+
// },
|
69 |
+
};
|
70 |
+
function onRequest(config) {
|
71 |
+
var _a;
|
72 |
+
logger("onRequest", `[${(_a = config.method) == null ? void 0 : _a.toUpperCase()}]`, config.url);
|
73 |
+
return config;
|
74 |
+
}
|
75 |
+
function onResponse(response) {
|
76 |
+
var _a;
|
77 |
+
logger(
|
78 |
+
"onResponse",
|
79 |
+
`[${(_a = response.config.method) == null ? void 0 : _a.toUpperCase()}]`,
|
80 |
+
response.config.url,
|
81 |
+
response.status,
|
82 |
+
response.statusText
|
83 |
+
);
|
84 |
+
return response;
|
85 |
+
}
|
86 |
+
function onRequestError(error) {
|
87 |
+
logger("onRequestError", error);
|
88 |
+
return error;
|
89 |
+
}
|
90 |
+
function onResponseError(error) {
|
91 |
+
logger("onResponseError", error);
|
92 |
+
return error.response;
|
93 |
+
}
|
94 |
+
const axiosInstance = axios.create(axiosRequestConfig);
|
95 |
+
axiosInstance.interceptors.request.use(
|
96 |
+
(config) => onRequest(config) || config
|
97 |
+
);
|
98 |
+
axiosInstance.interceptors.response.use(
|
99 |
+
(response) => onResponse(response) || response
|
100 |
+
);
|
101 |
+
axiosInstance.interceptors.request.use(
|
102 |
+
void 0,
|
103 |
+
(error) => onRequestError(error) || Promise.reject(error)
|
104 |
+
);
|
105 |
+
axiosInstance.interceptors.response.use(
|
106 |
+
void 0,
|
107 |
+
(error) => onResponseError(error) || Promise.reject(error)
|
108 |
+
);
|
109 |
+
return axiosInstance;
|
110 |
+
}
|
111 |
+
|
112 |
+
const runtimeConfig = useRuntimeConfig();
|
113 |
+
function createOpenAIConfiguration(model, headers, body) {
|
114 |
+
const useEnv = runtimeConfig.public.useEnv === "yes";
|
115 |
+
const apiType = useEnv ? runtimeConfig.public.apiType : headers["x-api-type"];
|
116 |
+
const apiKey = useEnv ? runtimeConfig.apiKey : aesCrypto({ message: headers["x-cipher-api-key"], type: "de" });
|
117 |
+
const apiHost = useEnv ? runtimeConfig.apiHost : headers["x-api-host"];
|
118 |
+
const azureApiVersion = useEnv ? runtimeConfig.azureApiVersion : headers["x-azure-api-version"];
|
119 |
+
const azureGpt35DeploymentId = useEnv ? runtimeConfig.azureGpt35DeploymentId : headers["x-azure-gpt35-deployment-id"];
|
120 |
+
const azureGpt4DeploymentId = useEnv ? runtimeConfig.azureGpt4DeploymentId : headers["x-azure-gpt4-deployment-id"];
|
121 |
+
let basePath = `${apiHost}/openai`;
|
122 |
+
if (model === "chat") {
|
123 |
+
let azureDeploymentId = "";
|
124 |
+
switch (body.model) {
|
125 |
+
case "gpt-3.5-turbo":
|
126 |
+
azureDeploymentId = azureGpt35DeploymentId;
|
127 |
+
break;
|
128 |
+
case "gpt-4":
|
129 |
+
azureDeploymentId = azureGpt4DeploymentId;
|
130 |
+
break;
|
131 |
+
}
|
132 |
+
basePath += `/deployments/${azureDeploymentId}`;
|
133 |
+
}
|
134 |
+
const azureOptions = apiType === "azure" ? {
|
135 |
+
basePath,
|
136 |
+
baseOptions: {
|
137 |
+
headers: { "api-key": apiKey },
|
138 |
+
params: {
|
139 |
+
"api-version": azureApiVersion
|
140 |
+
}
|
141 |
+
}
|
142 |
+
} : {};
|
143 |
+
return new Configuration({
|
144 |
+
apiKey,
|
145 |
+
...azureOptions
|
146 |
+
});
|
147 |
+
}
|
148 |
+
function getOpenAIApiInstance(model, headers, body) {
|
149 |
+
const configuration = createOpenAIConfiguration(model, headers, body);
|
150 |
+
const axiosInstance = createAxiosInstance();
|
151 |
+
const useEnv = runtimeConfig.public.useEnv === "yes";
|
152 |
+
const apiType = useEnv ? runtimeConfig.public.apiType : headers["x-api-type"];
|
153 |
+
if (apiType === "azure") {
|
154 |
+
return new AzureOpenAIApi(configuration, void 0, axiosInstance);
|
155 |
+
} else {
|
156 |
+
return new OpenAIApi(configuration, void 0, axiosInstance);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
function setResStatus(event, code, message) {
|
161 |
+
event.node.res.statusCode = code;
|
162 |
+
event.node.res.statusMessage = message;
|
163 |
+
}
|
164 |
+
async function errorHandler(event, e) {
|
165 |
+
var _a;
|
166 |
+
if ((_a = e.response) == null ? void 0 : _a.data) {
|
167 |
+
setResStatus(event, e.response.status, e.response.data.statusText);
|
168 |
+
let isStreamNull = true;
|
169 |
+
for await (const data of e.response.data) {
|
170 |
+
isStreamNull = false;
|
171 |
+
const message = data.toString();
|
172 |
+
try {
|
173 |
+
const parsed = JSON.parse(message);
|
174 |
+
return parsed;
|
175 |
+
} catch (error) {
|
176 |
+
return message;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
if (isStreamNull) {
|
180 |
+
return e;
|
181 |
+
}
|
182 |
+
} else {
|
183 |
+
return e;
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
export { errorHandler as e, getOpenAIApiInstance as g, setResStatus as s };
|
188 |
+
//# sourceMappingURL=h3.mjs.map
|
chunks/h3.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"h3.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/utils/azure.ts","/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/utils/axios.ts","/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/utils/openai.ts","/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/utils/h3.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;AAGA,MAAM,eAAkB,GAAA,GAAA,CAAA;AAEjB,MAAM,uBAAuB,SAAU,CAAA;AAAA,EACrC,WAAA,CACL,oBACA,OACA,EAAA;AATJ,IAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAUI,IAAA,MAAM,oBACH,EAAK,GAAA,IAAA,CAAA,aAAA,KAAL,IAAoB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,KAAY,KAAK,QACtC,IAAA,4BAAA,CAAA;AAEF,IAAA,MAAM,kBAAyC,GAAA;AAAA,MAC7C,GAAG,OAAA;AAAA,MACH,GAAA,CAAG,EAAK,GAAA,IAAA,CAAA,aAAA,KAAL,IAAoB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,WAAA;AAAA,MACvB,YAAc,EAAA,MAAA;AAAA,KAChB,CAAA;AAEA,IAAO,OAAA,IAAA,CAAK,MACT,IAAK,CAAA,cAAA,EAAgB,oBAAoB,kBAAkB,CAAA,CAC3D,IAAK,CAAA,CAAC,QAAa,KAAA;AAClB,MAAM,MAAA,WAAA,GAAc,SAAS,IAAK,CAAA,EAAA,CAAA;AAClC,MAAO,OAAA,IAAA,CAAK,QAAS,CAAA,WAAA,EAAa,OAAO,CAAA,CAAA;AAAA,KAC1C,CAAA,CACA,KAAM,CA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { createRenderer } from 'vue-bundle-renderer/runtime';
|
2 |
+
import { eventHandler, setResponseStatus, getQuery, createError } from 'h3';
|
3 |
+
import { stringify, uneval } from 'devalue';
|
4 |
+
import { a as useNitroApp, u as useRuntimeConfig, g as getRouteRules } from '../nitro/node-server.mjs';
|
5 |
+
import { joinURL } from 'ufo';
|
6 |
+
import 'node-fetch-native/polyfill';
|
7 |
+
import 'node:http';
|
8 |
+
import 'node:https';
|
9 |
+
import 'destr';
|
10 |
+
import 'ofetch';
|
11 |
+
import 'unenv/runtime/fetch/index';
|
12 |
+
import 'hookable';
|
13 |
+
import 'scule';
|
14 |
+
import 'klona';
|
15 |
+
import 'defu';
|
16 |
+
import 'ohash';
|
17 |
+
import 'unstorage';
|
18 |
+
import 'unstorage/drivers/fs';
|
19 |
+
import 'radix3';
|
20 |
+
import 'node:fs';
|
21 |
+
import 'node:url';
|
22 |
+
import 'pathe';
|
23 |
+
import '@intlify/bundle-utils';
|
24 |
+
import 'http-graceful-shutdown';
|
25 |
+
|
26 |
+
function defineRenderHandler(handler) {
|
27 |
+
return eventHandler(async (event) => {
|
28 |
+
if (event.node.req.url.endsWith("/favicon.ico")) {
|
29 |
+
if (!event.handled) {
|
30 |
+
event.node.res.setHeader("Content-Type", "image/x-icon");
|
31 |
+
event.node.res.end(
|
32 |
+
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
|
33 |
+
);
|
34 |
+
}
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
const response = await handler(event);
|
38 |
+
if (!response) {
|
39 |
+
if (!event.handled) {
|
40 |
+
event.node.res.statusCode = event.node.res.statusCode === 200 ? 500 : event.node.res.statusCode;
|
41 |
+
event.node.res.end(
|
42 |
+
"No response returned from render handler: " + event.node.req.url
|
43 |
+
);
|
44 |
+
}
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
const nitroApp = useNitroApp();
|
48 |
+
await nitroApp.hooks.callHook("render:response", response, { event });
|
49 |
+
if (!event.node.res.headersSent && response.headers) {
|
50 |
+
for (const header in response.headers) {
|
51 |
+
event.node.res.setHeader(header, response.headers[header]);
|
52 |
+
}
|
53 |
+
setResponseStatus(event, response.statusCode, response.statusMessage);
|
54 |
+
}
|
55 |
+
return typeof response.body === "string" ? response.body : JSON.stringify(response.body);
|
56 |
+
});
|
57 |
+
}
|
58 |
+
|
59 |
+
function buildAssetsDir() {
|
60 |
+
return useRuntimeConfig().app.buildAssetsDir;
|
61 |
+
}
|
62 |
+
function buildAssetsURL(...path) {
|
63 |
+
return joinURL(publicAssetsURL(), buildAssetsDir(), ...path);
|
64 |
+
}
|
65 |
+
function publicAssetsURL(...path) {
|
66 |
+
const publicBase = useRuntimeConfig().app.cdnURL || useRuntimeConfig().app.baseURL;
|
67 |
+
return path.length ? joinURL(publicBase, ...path) : publicBase;
|
68 |
+
}
|
69 |
+
|
70 |
+
const appRootId = "__nuxt";
|
71 |
+
|
72 |
+
const appRootTag = "div";
|
73 |
+
|
74 |
+
globalThis.__buildAssetsURL = buildAssetsURL;
|
75 |
+
globalThis.__publicAssetsURL = publicAssetsURL;
|
76 |
+
const getClientManifest = () => import('../app/client.manifest.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
77 |
+
const getStaticRenderedHead = () => import('../rollup/_virtual_head-static.mjs').then((r) => r.default || r);
|
78 |
+
const getSSRStyles = lazyCachedFunction(() => import('../app/styles.mjs').then((r) => r.default || r));
|
79 |
+
const getSPARenderer = lazyCachedFunction(async () => {
|
80 |
+
const manifest = await getClientManifest();
|
81 |
+
const spaTemplate = await import('../rollup/_virtual_spa-template.mjs').then((r) => r.template).catch(() => "");
|
82 |
+
const options = {
|
83 |
+
manifest,
|
84 |
+
renderToString: () => `<${appRootTag} id="${appRootId}">${spaTemplate}</${appRootTag}>`,
|
85 |
+
buildAssetsURL
|
86 |
+
};
|
87 |
+
const renderer = createRenderer(() => () => {
|
88 |
+
}, options);
|
89 |
+
const result = await renderer.renderToString({});
|
90 |
+
const renderToString = (ssrContext) => {
|
91 |
+
const config = useRuntimeConfig();
|
92 |
+
ssrContext.payload = {
|
93 |
+
path: ssrContext.url,
|
94 |
+
_errors: {},
|
95 |
+
serverRendered: false,
|
96 |
+
data: {},
|
97 |
+
state: {}
|
98 |
+
};
|
99 |
+
ssrContext.config = {
|
100 |
+
public: config.public,
|
101 |
+
app: config.app
|
102 |
+
};
|
103 |
+
ssrContext.renderMeta = ssrContext.renderMeta ?? getStaticRenderedHead;
|
104 |
+
return Promise.resolve(result);
|
105 |
+
};
|
106 |
+
return {
|
107 |
+
rendererContext: renderer.rendererContext,
|
108 |
+
renderToString
|
109 |
+
};
|
110 |
+
});
|
111 |
+
const PAYLOAD_URL_RE = /\/_payload(\.[a-zA-Z0-9]+)?.json(\?.*)?$/ ;
|
112 |
+
const renderer = defineRenderHandler(async (event) => {
|
113 |
+
const nitroApp = useNitroApp();
|
114 |
+
const ssrError = event.node.req.url?.startsWith("/__nuxt_error") ? getQuery(event) : null;
|
115 |
+
if (ssrError && ssrError.statusCode) {
|
116 |
+
ssrError.statusCode = parseInt(ssrError.statusCode);
|
117 |
+
}
|
118 |
+
if (ssrError && event.node.req.socket.readyState !== "readOnly") {
|
119 |
+
throw createError({
|
120 |
+
statusCode: 404,
|
121 |
+
statusMessage: "Page Not Found: /__nuxt_error"
|
122 |
+
});
|
123 |
+
}
|
124 |
+
const islandContext = void 0;
|
125 |
+
let url = ssrError?.url || islandContext?.url || event.node.req.url;
|
126 |
+
const isRenderingPayload = PAYLOAD_URL_RE.test(url) && !islandContext;
|
127 |
+
if (isRenderingPayload) {
|
128 |
+
url = url.substring(0, url.lastIndexOf("/")) || "/";
|
129 |
+
event.node.req.url = url;
|
130 |
+
}
|
131 |
+
const routeOptions = getRouteRules(event);
|
132 |
+
const ssrContext = {
|
133 |
+
url,
|
134 |
+
event,
|
135 |
+
runtimeConfig: useRuntimeConfig(),
|
136 |
+
noSSR: !!true ,
|
137 |
+
error: !!ssrError,
|
138 |
+
nuxt: void 0,
|
139 |
+
/* NuxtApp */
|
140 |
+
payload: ssrError ? { error: ssrError } : {},
|
141 |
+
_payloadReducers: {},
|
142 |
+
islandContext
|
143 |
+
};
|
144 |
+
const renderer = await getSPARenderer() ;
|
145 |
+
const _rendered = await renderer.renderToString(ssrContext).catch(async (error) => {
|
146 |
+
if (ssrContext._renderResponse && error.message === "skipping render") {
|
147 |
+
return {};
|
148 |
+
}
|
149 |
+
const _err = !ssrError && ssrContext.payload?.error || error;
|
150 |
+
await ssrContext.nuxt?.hooks.callHook("app:error", _err);
|
151 |
+
throw _err;
|
152 |
+
});
|
153 |
+
await ssrContext.nuxt?.hooks.callHook("app:rendered", { ssrContext, renderResult: _rendered });
|
154 |
+
if (ssrContext._renderResponse) {
|
155 |
+
return ssrContext._renderResponse;
|
156 |
+
}
|
157 |
+
if (ssrContext.payload?.error && !ssrError) {
|
158 |
+
throw ssrContext.payload.error;
|
159 |
+
}
|
160 |
+
if (isRenderingPayload) {
|
161 |
+
const response2 = renderPayloadResponse(ssrContext);
|
162 |
+
return response2;
|
163 |
+
}
|
164 |
+
const renderedMeta = await ssrContext.renderMeta?.() ?? {};
|
165 |
+
const inlinedStyles = Boolean(islandContext) ? await renderInlineStyles(ssrContext.modules ?? ssrContext._registeredComponents ?? []) : "";
|
166 |
+
const NO_SCRIPTS = routeOptions.experimentalNoScripts;
|
167 |
+
const htmlContext = {
|
168 |
+
island: Boolean(islandContext),
|
169 |
+
htmlAttrs: normalizeChunks([renderedMeta.htmlAttrs]),
|
170 |
+
head: normalizeChunks([
|
171 |
+
renderedMeta.headTags,
|
172 |
+
null ,
|
173 |
+
NO_SCRIPTS ? null : _rendered.renderResourceHints(),
|
174 |
+
_rendered.renderStyles(),
|
175 |
+
inlinedStyles,
|
176 |
+
ssrContext.styles
|
177 |
+
]),
|
178 |
+
bodyAttrs: normalizeChunks([renderedMeta.bodyAttrs]),
|
179 |
+
bodyPrepend: normalizeChunks([
|
180 |
+
renderedMeta.bodyScriptsPrepend,
|
181 |
+
ssrContext.teleports?.body
|
182 |
+
]),
|
183 |
+
body: [_rendered.html],
|
184 |
+
bodyAppend: normalizeChunks([
|
185 |
+
NO_SCRIPTS ? void 0 : renderPayloadJsonScript({ id: "__NUXT_DATA__", ssrContext, data: ssrContext.payload }) ,
|
186 |
+
routeOptions.experimentalNoScripts ? void 0 : _rendered.renderScripts(),
|
187 |
+
// Note: bodyScripts may contain tags other than <script>
|
188 |
+
renderedMeta.bodyScripts
|
189 |
+
])
|
190 |
+
};
|
191 |
+
await nitroApp.hooks.callHook("render:html", htmlContext, { event });
|
192 |
+
const response = {
|
193 |
+
body: renderHTMLDocument(htmlContext),
|
194 |
+
statusCode: event.node.res.statusCode,
|
195 |
+
statusMessage: event.node.res.statusMessage,
|
196 |
+
headers: {
|
197 |
+
"content-type": "text/html;charset=utf-8",
|
198 |
+
"x-powered-by": "Nuxt"
|
199 |
+
}
|
200 |
+
};
|
201 |
+
return response;
|
202 |
+
});
|
203 |
+
function lazyCachedFunction(fn) {
|
204 |
+
let res = null;
|
205 |
+
return () => {
|
206 |
+
if (res === null) {
|
207 |
+
res = fn().catch((err) => {
|
208 |
+
res = null;
|
209 |
+
throw err;
|
210 |
+
});
|
211 |
+
}
|
212 |
+
return res;
|
213 |
+
};
|
214 |
+
}
|
215 |
+
function normalizeChunks(chunks) {
|
216 |
+
return chunks.filter(Boolean).map((i) => i.trim());
|
217 |
+
}
|
218 |
+
function joinTags(tags) {
|
219 |
+
return tags.join("");
|
220 |
+
}
|
221 |
+
function joinAttrs(chunks) {
|
222 |
+
return chunks.join(" ");
|
223 |
+
}
|
224 |
+
function renderHTMLDocument(html) {
|
225 |
+
return `<!DOCTYPE html>
|
226 |
+
<html ${joinAttrs(html.htmlAttrs)}>
|
227 |
+
<head>${joinTags(html.head)}</head>
|
228 |
+
<body ${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body>
|
229 |
+
</html>`;
|
230 |
+
}
|
231 |
+
async function renderInlineStyles(usedModules) {
|
232 |
+
const styleMap = await getSSRStyles();
|
233 |
+
const inlinedStyles = /* @__PURE__ */ new Set();
|
234 |
+
for (const mod of usedModules) {
|
235 |
+
if (mod in styleMap) {
|
236 |
+
for (const style of await styleMap[mod]()) {
|
237 |
+
inlinedStyles.add(`<style>${style}</style>`);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
return Array.from(inlinedStyles).join("");
|
242 |
+
}
|
243 |
+
function renderPayloadResponse(ssrContext) {
|
244 |
+
return {
|
245 |
+
body: stringify(splitPayload(ssrContext).payload, ssrContext._payloadReducers) ,
|
246 |
+
statusCode: ssrContext.event.node.res.statusCode,
|
247 |
+
statusMessage: ssrContext.event.node.res.statusMessage,
|
248 |
+
headers: {
|
249 |
+
"content-type": "application/json;charset=utf-8" ,
|
250 |
+
"x-powered-by": "Nuxt"
|
251 |
+
}
|
252 |
+
};
|
253 |
+
}
|
254 |
+
function renderPayloadJsonScript(opts) {
|
255 |
+
const attrs = [
|
256 |
+
'type="application/json"',
|
257 |
+
`id="${opts.id}"`,
|
258 |
+
`data-ssr="${!(true )}"`,
|
259 |
+
opts.src ? `data-src="${opts.src}"` : ""
|
260 |
+
].filter(Boolean);
|
261 |
+
const contents = opts.data ? stringify(opts.data, opts.ssrContext._payloadReducers) : "";
|
262 |
+
return `<script ${attrs.join(" ")}>${contents}<\/script><script>window.__NUXT__={};window.__NUXT__.config=${uneval(opts.ssrContext.config)}<\/script>`;
|
263 |
+
}
|
264 |
+
function splitPayload(ssrContext) {
|
265 |
+
const { data, prerenderedAt, ...initial } = ssrContext.payload;
|
266 |
+
return {
|
267 |
+
initial: { ...initial, prerenderedAt },
|
268 |
+
payload: { data, prerenderedAt }
|
269 |
+
};
|
270 |
+
}
|
271 |
+
|
272 |
+
export { renderer as default };
|
273 |
+
//# sourceMappingURL=renderer.mjs.map
|
chunks/handlers/renderer.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"renderer.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/node_modules/.pnpm/nitropack@2.5.2/node_modules/nitropack/dist/runtime/renderer.mjs","/Users/zwj/Downloads/chatgpt-nuxt-master 2/node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/core/runtime/nitro/paths.js","/Users/zwj/Downloads/chatgpt-nuxt-master 2/node_modules/.pnpm/nuxt@3.6.0_@types+node@18.0.0_typescript@5.1.6/node_modules/nuxt/dist/core/runtime/nitro/renderer.js"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEO,SAAS,mBAAmB,CAAC,OAAO,EAAE;AAC7C,EAAE,OAAO,YAAY,CAAC,OAAO,KAAK,KAAK;AACvC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;AACrD,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;AAC1B,QAAQ,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;AACjE,QAAQ,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;AAC1B,UAAU,gFAAgF;AAC1F,SAAS,CAAC;AACV,OAAO;AACP,MAAM,OAAO;AACb,KAAK;AACL,IAAI,MAAM,QAAQ,G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AAE,QAAQ,CAAC,4DAA4D,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;AACzJ,CAAC;AASD,SAAS,YAAY,CAAC,UAAU,EAAE;AAClC,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;AACjE,EAAE,OAAO;AACT,IAAI,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE;AAC1C,IAAI,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;AACpC,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0,1,2]}
|
chunks/models.get.mjs
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { defineEventHandler, getHeaders } from 'h3';
|
2 |
+
import { s as setResStatus, e as errorHandler, g as getOpenAIApiInstance } from './h3.mjs';
|
3 |
+
import { u as useRuntimeConfig } from './nitro/node-server.mjs';
|
4 |
+
import './crypto.post.mjs';
|
5 |
+
import 'crypto-js';
|
6 |
+
import 'openai';
|
7 |
+
import 'axios';
|
8 |
+
import 'node-fetch-native/polyfill';
|
9 |
+
import 'node:http';
|
10 |
+
import 'node:https';
|
11 |
+
import 'destr';
|
12 |
+
import 'ofetch';
|
13 |
+
import 'unenv/runtime/fetch/index';
|
14 |
+
import 'hookable';
|
15 |
+
import 'scule';
|
16 |
+
import 'klona';
|
17 |
+
import 'defu';
|
18 |
+
import 'ohash';
|
19 |
+
import 'ufo';
|
20 |
+
import 'unstorage';
|
21 |
+
import 'unstorage/drivers/fs';
|
22 |
+
import 'radix3';
|
23 |
+
import 'node:fs';
|
24 |
+
import 'node:url';
|
25 |
+
import 'pathe';
|
26 |
+
import '@intlify/bundle-utils';
|
27 |
+
import 'http-graceful-shutdown';
|
28 |
+
|
29 |
+
const runtimeConfig = useRuntimeConfig();
|
30 |
+
const models_get = defineEventHandler(async (event) => {
|
31 |
+
try {
|
32 |
+
const headers = getHeaders(event);
|
33 |
+
const response = await listModels(headers);
|
34 |
+
setResStatus(event, response.status, response.statusText);
|
35 |
+
return response.data;
|
36 |
+
} catch (e) {
|
37 |
+
return await errorHandler(event, e);
|
38 |
+
}
|
39 |
+
});
|
40 |
+
async function listModels(headers) {
|
41 |
+
const openai = getOpenAIApiInstance("models", headers);
|
42 |
+
const useEnv = runtimeConfig.public.useEnv === "yes";
|
43 |
+
const apiType = useEnv ? runtimeConfig.public.apiType : headers["x-api-type"];
|
44 |
+
const azureGpt4DeploymentId = useEnv ? runtimeConfig.azureGpt4DeploymentId : headers["x-azure-gpt4-deployment-id"];
|
45 |
+
switch (apiType) {
|
46 |
+
case "openai":
|
47 |
+
return openai.listModels();
|
48 |
+
case "azure":
|
49 |
+
const gpt35ModelData = {
|
50 |
+
id: "gpt-3.5-turbo",
|
51 |
+
object: "model",
|
52 |
+
owned_by: "",
|
53 |
+
permission: []
|
54 |
+
};
|
55 |
+
const gpt4ModelData = {
|
56 |
+
id: "gpt-4",
|
57 |
+
object: "model",
|
58 |
+
owned_by: "",
|
59 |
+
permission: []
|
60 |
+
};
|
61 |
+
const availableModels = [gpt35ModelData];
|
62 |
+
if (azureGpt4DeploymentId) {
|
63 |
+
availableModels.push(gpt4ModelData);
|
64 |
+
}
|
65 |
+
const responseData = {
|
66 |
+
data: availableModels,
|
67 |
+
object: "list"
|
68 |
+
};
|
69 |
+
return {
|
70 |
+
data: responseData,
|
71 |
+
status: 200,
|
72 |
+
statusText: "OK",
|
73 |
+
config: {},
|
74 |
+
request: {}
|
75 |
+
};
|
76 |
+
default:
|
77 |
+
return {
|
78 |
+
data: {},
|
79 |
+
status: 400,
|
80 |
+
statusText: "Bad Request",
|
81 |
+
config: {},
|
82 |
+
request: {}
|
83 |
+
};
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
export { models_get as default };
|
88 |
+
//# sourceMappingURL=models.get.mjs.map
|
chunks/models.get.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"models.get.mjs","sources":["/Users/zwj/Downloads/chatgpt-nuxt-master 2/server/api/models.get.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAA,gBAAA,gBAAA,EAAA,CAAA;AAEA,mBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,OAAA,GAAA,WAAA,KAAA,CAAA,CAAA;AACA,IAAA,MAAA,QAAA,GAAA,MAAA,UAAA,CAAA,OAAA,CAAA,CAAA;AAEA,IAAA,YAAA,CAAA,KAAA,EAAA,QAAA,CAAA,MAAA,EAAA,QAAA,CAAA,UAAA,CAAA,CAAA;AACA,IAAA,OAAA,QAAA,CAAA,IAAA,CAAA;AAAA,WACA,CAAA,EAAA;AACA,IAAA,OAAA,MAAA,YAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AAAA,GACA;AACA,CAAA,CAAA,CAAA;AAEA,eAAA,WAAA,OAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,oBAAA,CAAA,QAAA,EAAA,OAAA,CAAA,CAAA;AAEA,EAAA,MAAA,MAAA,GAAA,aAAA,CAAA,MAAA,CAAA,MAAA,KAAA,KAAA,CAAA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import 'node-fetch-native/polyfill';
|
2 |
+
import { Server as Server$1 } from 'node:http';
|
3 |
+
import { Server } from 'node:https';
|
4 |
+
import destr from 'destr';
|
5 |
+
import { defineEventHandler, handleCacheHeaders, createEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, getRequestHeader, setResponseStatus, setResponseHeader, getRequestHeaders, createError, getRequestURL, getMethod, readBody, createApp, createRouter as createRouter$1, toNodeListener, fetchWithEvent, lazyEventHandler } from 'h3';
|
6 |
+
import { createFetch as createFetch$1, Headers } from 'ofetch';
|
7 |
+
import { createCall, createFetch } from 'unenv/runtime/fetch/index';
|
8 |
+
import { createHooks } from 'hookable';
|
9 |
+
import { snakeCase } from 'scule';
|
10 |
+
import { klona } from 'klona';
|
11 |
+
import defu, { defuFn } from 'defu';
|
12 |
+
import { hash } from 'ohash';
|
13 |
+
import { parseURL, withoutBase, joinURL, getQuery, withQuery, withLeadingSlash, withoutTrailingSlash } from 'ufo';
|
14 |
+
import { createStorage, prefixStorage } from 'unstorage';
|
15 |
+
import unstorage_47drivers_47fs from 'unstorage/drivers/fs';
|
16 |
+
import { toRouteMatcher, createRouter } from 'radix3';
|
17 |
+
import { promises } from 'node:fs';
|
18 |
+
import { fileURLToPath } from 'node:url';
|
19 |
+
import { dirname, resolve, relative, join } from 'pathe';
|
20 |
+
import { generateJSON } from '@intlify/bundle-utils';
|
21 |
+
import gracefulShutdown from 'http-graceful-shutdown';
|
22 |
+
|
23 |
+
const inlineAppConfig = {};
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
const appConfig = defuFn(inlineAppConfig);
|
28 |
+
|
29 |
+
const _inlineRuntimeConfig = {
|
30 |
+
"app": {
|
31 |
+
"baseURL": "/",
|
32 |
+
"buildAssetsDir": "/_nuxt/",
|
33 |
+
"cdnURL": ""
|
34 |
+
},
|
35 |
+
"nitro": {
|
36 |
+
"envPrefix": "NUXT_",
|
37 |
+
"routeRules": {
|
38 |
+
"/__nuxt_error": {
|
39 |
+
"cache": false
|
40 |
+
},
|
41 |
+
"/_nuxt/**": {
|
42 |
+
"headers": {
|
43 |
+
"cache-control": "public, max-age=31536000, immutable"
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
},
|
48 |
+
"public": {
|
49 |
+
"useEnv": "no",
|
50 |
+
"apiType": "openai",
|
51 |
+
"defaultTemperature": "1",
|
52 |
+
"i18n": {
|
53 |
+
"experimental": {
|
54 |
+
"jsTsFormatResource": false
|
55 |
+
},
|
56 |
+
"baseUrl": ""
|
57 |
+
}
|
58 |
+
},
|
59 |
+
"apiKey": "",
|
60 |
+
"apiHost": "",
|
61 |
+
"azureApiVersion": "2023-06-01-preview",
|
62 |
+
"azureGpt35DeploymentId": "",
|
63 |
+
"azureGpt4DeploymentId": "",
|
64 |
+
"i18n": {
|
65 |
+
"precompile": {
|
66 |
+
"strictMessage": false,
|
67 |
+
"escapeHtml": false
|
68 |
+
}
|
69 |
+
}
|
70 |
+
};
|
71 |
+
const ENV_PREFIX = "NITRO_";
|
72 |
+
const ENV_PREFIX_ALT = _inlineRuntimeConfig.nitro.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_";
|
73 |
+
const _sharedRuntimeConfig = _deepFreeze(
|
74 |
+
_applyEnv(klona(_inlineRuntimeConfig))
|
75 |
+
);
|
76 |
+
function useRuntimeConfig(event) {
|
77 |
+
if (!event) {
|
78 |
+
return _sharedRuntimeConfig;
|
79 |
+
}
|
80 |
+
if (event.context.nitro.runtimeConfig) {
|
81 |
+
return event.context.nitro.runtimeConfig;
|
82 |
+
}
|
83 |
+
const runtimeConfig = klona(_inlineRuntimeConfig);
|
84 |
+
_applyEnv(runtimeConfig);
|
85 |
+
event.context.nitro.runtimeConfig = runtimeConfig;
|
86 |
+
return runtimeConfig;
|
87 |
+
}
|
88 |
+
_deepFreeze(klona(appConfig));
|
89 |
+
function _getEnv(key) {
|
90 |
+
const envKey = snakeCase(key).toUpperCase();
|
91 |
+
return destr(
|
92 |
+
process.env[ENV_PREFIX + envKey] ?? process.env[ENV_PREFIX_ALT + envKey]
|
93 |
+
);
|
94 |
+
}
|
95 |
+
function _isObject(input) {
|
96 |
+
return typeof input === "object" && !Array.isArray(input);
|
97 |
+
}
|
98 |
+
function _applyEnv(obj, parentKey = "") {
|
99 |
+
for (const key in obj) {
|
100 |
+
const subKey = parentKey ? `${parentKey}_${key}` : key;
|
101 |
+
const envValue = _getEnv(subKey);
|
102 |
+
if (_isObject(obj[key])) {
|
103 |
+
if (_isObject(envValue)) {
|
104 |
+
obj[key] = { ...obj[key], ...envValue };
|
105 |
+
}
|
106 |
+
_applyEnv(obj[key], subKey);
|
107 |
+
} else {
|
108 |
+
obj[key] = envValue ?? obj[key];
|
109 |
+
}
|
110 |
+
}
|
111 |
+
return obj;
|
112 |
+
}
|
113 |
+
function _deepFreeze(object) {
|
114 |
+
const propNames = Object.getOwnPropertyNames(object);
|
115 |
+
for (const name of propNames) {
|
116 |
+
const value = object[name];
|
117 |
+
if (value && typeof value === "object") {
|
118 |
+
_deepFreeze(value);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
return Object.freeze(object);
|
122 |
+
}
|
123 |
+
new Proxy(/* @__PURE__ */ Object.create(null), {
|
124 |
+
get: (_, prop) => {
|
125 |
+
console.warn(
|
126 |
+
"Please use `useRuntimeConfig()` instead of accessing config directly."
|
127 |
+
);
|
128 |
+
const runtimeConfig = useRuntimeConfig();
|
129 |
+
if (prop in runtimeConfig) {
|
130 |
+
return runtimeConfig[prop];
|
131 |
+
}
|
132 |
+
return void 0;
|
133 |
+
}
|
134 |
+
});
|
135 |
+
|
136 |
+
const _assets = {
|
137 |
+
|
138 |
+
};
|
139 |
+
|
140 |
+
function normalizeKey(key) {
|
141 |
+
if (!key) {
|
142 |
+
return "";
|
143 |
+
}
|
144 |
+
return key.split("?")[0].replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "");
|
145 |
+
}
|
146 |
+
|
147 |
+
const assets$1 = {
|
148 |
+
getKeys() {
|
149 |
+
return Promise.resolve(Object.keys(_assets))
|
150 |
+
},
|
151 |
+
hasItem (id) {
|
152 |
+
id = normalizeKey(id);
|
153 |
+
return Promise.resolve(id in _assets)
|
154 |
+
},
|
155 |
+
getItem (id) {
|
156 |
+
id = normalizeKey(id);
|
157 |
+
return Promise.resolve(_assets[id] ? _assets[id].import() : null)
|
158 |
+
},
|
159 |
+
getMeta (id) {
|
160 |
+
id = normalizeKey(id);
|
161 |
+
return Promise.resolve(_assets[id] ? _assets[id].meta : {})
|
162 |
+
}
|
163 |
+
};
|
164 |
+
|
165 |
+
const storage = createStorage({});
|
166 |
+
|
167 |
+
storage.mount('/assets', assets$1);
|
168 |
+
|
169 |
+
storage.mount('i18n', unstorage_47drivers_47fs({"driver":"fs","base":"/Users/zwj/Downloads/chatgpt-nuxt-master 2/.nuxt/i18n","ignore":["**/node_modules/**","**/.git/**"]}));
|
170 |
+
|
171 |
+
function useStorage(base = "") {
|
172 |
+
return base ? prefixStorage(storage, base) : storage;
|
173 |
+
}
|
174 |
+
|
175 |
+
const defaultCacheOptions = {
|
176 |
+
name: "_",
|
177 |
+
base: "/cache",
|
178 |
+
swr: true,
|
179 |
+
maxAge: 1
|
180 |
+
};
|
181 |
+
function defineCachedFunction(fn, opts = {}) {
|
182 |
+
opts = { ...defaultCacheOptions, ...opts };
|
183 |
+
const pending = {};
|
184 |
+
const group = opts.group || "nitro/functions";
|
185 |
+
const name = opts.name || fn.name || "_";
|
186 |
+
const integrity = hash([opts.integrity, fn, opts]);
|
187 |
+
const validate = opts.validate || (() => true);
|
188 |
+
async function get(key, resolver, shouldInvalidateCache) {
|
189 |
+
const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index");
|
190 |
+
const entry = await useStorage().getItem(cacheKey) || {};
|
191 |
+
const ttl = (opts.maxAge ?? opts.maxAge ?? 0) * 1e3;
|
192 |
+
if (ttl) {
|
193 |
+
entry.expires = Date.now() + ttl;
|
194 |
+
}
|
195 |
+
const expired = shouldInvalidateCache || entry.integrity !== integrity || ttl && Date.now() - (entry.mtime || 0) > ttl || !validate(entry);
|
196 |
+
const _resolve = async () => {
|
197 |
+
const isPending = pending[key];
|
198 |
+
if (!isPending) {
|
199 |
+
if (entry.value !== void 0 && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) {
|
200 |
+
entry.value = void 0;
|
201 |
+
entry.integrity = void 0;
|
202 |
+
entry.mtime = void 0;
|
203 |
+
entry.expires = void 0;
|
204 |
+
}
|
205 |
+
pending[key] = Promise.resolve(resolver());
|
206 |
+
}
|
207 |
+
try {
|
208 |
+
entry.value = await pending[key];
|
209 |
+
} catch (error) {
|
210 |
+
if (!isPending) {
|
211 |
+
delete pending[key];
|
212 |
+
}
|
213 |
+
throw error;
|
214 |
+
}
|
215 |
+
if (!isPending) {
|
216 |
+
entry.mtime = Date.now();
|
217 |
+
entry.integrity = integrity;
|
218 |
+
delete pending[key];
|
219 |
+
if (validate(entry)) {
|
220 |
+
useStorage().setItem(cacheKey, entry).catch((error) => console.error("[nitro] [cache]", error));
|
221 |
+
}
|
222 |
+
}
|
223 |
+
};
|
224 |
+
const _resolvePromise = expired ? _resolve() : Promise.resolve();
|
225 |
+
if (opts.swr && entry.value) {
|
226 |
+
_resolvePromise.catch(console.error);
|
227 |
+
return entry;
|
228 |
+
}
|
229 |
+
return _resolvePromise.then(() => entry);
|
230 |
+
}
|
231 |
+
return async (...args) => {
|
232 |
+
const shouldBypassCache = opts.shouldBypassCache?.(...args);
|
233 |
+
if (shouldBypassCache) {
|
234 |
+
return fn(...args);
|
235 |
+
}
|
236 |
+
const key = await (opts.getKey || getKey)(...args);
|
237 |
+
const shouldInvalidateCache = opts.shouldInvalidateCache?.(...args);
|
238 |
+
const entry = await get(key, () => fn(...args), shouldInvalidateCache);
|
239 |
+
let value = entry.value;
|
240 |
+
if (opts.transform) {
|
241 |
+
value = await opts.transform(entry, ...args) || value;
|
242 |
+
}
|
243 |
+
return value;
|
244 |
+
};
|
245 |
+
}
|
246 |
+
const cachedFunction = defineCachedFunction;
|
247 |
+
function getKey(...args) {
|
248 |
+
return args.length > 0 ? hash(args, {}) : "";
|
249 |
+
}
|
250 |
+
function escapeKey(key) {
|
251 |
+
return key.replace(/[^\dA-Za-z]/g, "");
|
252 |
+
}
|
253 |
+
function defineCachedEventHandler(handler, opts = defaultCacheOptions) {
|
254 |
+
const _opts = {
|
255 |
+
...opts,
|
256 |
+
getKey: async (event) => {
|
257 |
+
const key = await opts.getKey?.(event);
|
258 |
+
if (key) {
|
259 |
+
return escapeKey(key);
|
260 |
+
}
|
261 |
+
const url = event.node.req.originalUrl || event.node.req.url;
|
262 |
+
const friendlyName = escapeKey(decodeURI(parseURL(url).pathname)).slice(
|
263 |
+
0,
|
264 |
+
16
|
265 |
+
);
|
266 |
+
const urlHash = hash(url);
|
267 |
+
return `${friendlyName}.${urlHash}`;
|
268 |
+
},
|
269 |
+
validate: (entry) => {
|
270 |
+
if (entry.value.code >= 400) {
|
271 |
+
return false;
|
272 |
+
}
|
273 |
+
if (entry.value.body === void 0) {
|
274 |
+
return false;
|
275 |
+
}
|
276 |
+
return true;
|
277 |
+
},
|
278 |
+
group: opts.group || "nitro/handlers",
|
279 |
+
integrity: [opts.integrity, handler]
|
280 |
+
};
|
281 |
+
const _cachedHandler = cachedFunction(
|
282 |
+
async (incomingEvent) => {
|
283 |
+
const reqProxy = cloneWithProxy(incomingEvent.node.req, { headers: {} });
|
284 |
+
const resHeaders = {};
|
285 |
+
let _resSendBody;
|
286 |
+
const resProxy = cloneWithProxy(incomingEvent.node.res, {
|
287 |
+
statusCode: 200,
|
288 |
+
writableEnded: false,
|
289 |
+
writableFinished: false,
|
290 |
+
headersSent: false,
|
291 |
+
closed: false,
|
292 |
+
getHeader(name) {
|
293 |
+
return resHeaders[name];
|
294 |
+
},
|
295 |
+
setHeader(name, value) {
|
296 |
+
resHeaders[name] = value;
|
297 |
+
return this;
|
298 |
+
},
|
299 |
+
getHeaderNames() {
|
300 |
+
return Object.keys(resHeaders);
|
301 |
+
},
|
302 |
+
hasHeader(name) {
|
303 |
+
return name in resHeaders;
|
304 |
+
},
|
305 |
+
removeHeader(name) {
|
306 |
+
delete resHeaders[name];
|
307 |
+
},
|
308 |
+
getHeaders() {
|
309 |
+
return resHeaders;
|
310 |
+
},
|
311 |
+
end(chunk, arg2, arg3) {
|
312 |
+
if (typeof chunk === "string") {
|
313 |
+
_resSendBody = chunk;
|
314 |
+
}
|
315 |
+
if (typeof arg2 === "function") {
|
316 |
+
arg2();
|
317 |
+
}
|
318 |
+
if (typeof arg3 === "function") {
|
319 |
+
arg3();
|
320 |
+
}
|
321 |
+
return this;
|
322 |
+
},
|
323 |
+
write(chunk, arg2, arg3) {
|
324 |
+
if (typeof chunk === "string") {
|
325 |
+
_resSendBody = chunk;
|
326 |
+
}
|
327 |
+
if (typeof arg2 === "function") {
|
328 |
+
arg2();
|
329 |
+
}
|
330 |
+
if (typeof arg3 === "function") {
|
331 |
+
arg3();
|
332 |
+
}
|
333 |
+
return this;
|
334 |
+
},
|
335 |
+
writeHead(statusCode, headers2) {
|
336 |
+
this.statusCode = statusCode;
|
337 |
+
if (headers2) {
|
338 |
+
for (const header in headers2) {
|
339 |
+
this.setHeader(header, headers2[header]);
|
340 |
+
}
|
341 |
+
}
|
342 |
+
return this;
|
343 |
+
}
|
344 |
+
});
|
345 |
+
const event = createEvent(reqProxy, resProxy);
|
346 |
+
event.context = incomingEvent.context;
|
347 |
+
const body = await handler(event) || _resSendBody;
|
348 |
+
const headers = event.node.res.getHeaders();
|
349 |
+
headers.etag = headers.Etag || headers.etag || `W/"${hash(body)}"`;
|
350 |
+
headers["last-modified"] = headers["Last-Modified"] || headers["last-modified"] || (/* @__PURE__ */ new Date()).toUTCString();
|
351 |
+
const cacheControl = [];
|
352 |
+
if (opts.swr) {
|
353 |
+
if (opts.maxAge) {
|
354 |
+
cacheControl.push(`s-maxage=${opts.maxAge}`);
|
355 |
+
}
|
356 |
+
if (opts.staleMaxAge) {
|
357 |
+
cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`);
|
358 |
+
} else {
|
359 |
+
cacheControl.push("stale-while-revalidate");
|
360 |
+
}
|
361 |
+
} else if (opts.maxAge) {
|
362 |
+
cacheControl.push(`max-age=${opts.maxAge}`);
|
363 |
+
}
|
364 |
+
if (cacheControl.length > 0) {
|
365 |
+
headers["cache-control"] = cacheControl.join(", ");
|
366 |
+
}
|
367 |
+
const cacheEntry = {
|
368 |
+
code: event.node.res.statusCode,
|
369 |
+
headers,
|
370 |
+
body
|
371 |
+
};
|
372 |
+
return cacheEntry;
|
373 |
+
},
|
374 |
+
_opts
|
375 |
+
);
|
376 |
+
return defineEventHandler(async (event) => {
|
377 |
+
if (opts.headersOnly) {
|
378 |
+
if (handleCacheHeaders(event, { maxAge: opts.maxAge })) {
|
379 |
+
return;
|
380 |
+
}
|
381 |
+
return handler(event);
|
382 |
+
}
|
383 |
+
const response = await _cachedHandler(event);
|
384 |
+
if (event.node.res.headersSent || event.node.res.writableEnded) {
|
385 |
+
return response.body;
|
386 |
+
}
|
387 |
+
if (handleCacheHeaders(event, {
|
388 |
+
modifiedTime: new Date(response.headers["last-modified"]),
|
389 |
+
etag: response.headers.etag,
|
390 |
+
maxAge: opts.maxAge
|
391 |
+
})) {
|
392 |
+
return;
|
393 |
+
}
|
394 |
+
event.node.res.statusCode = response.code;
|
395 |
+
for (const name in response.headers) {
|
396 |
+
event.node.res.setHeader(name, response.headers[name]);
|
397 |
+
}
|
398 |
+
return response.body;
|
399 |
+
});
|
400 |
+
}
|
401 |
+
function cloneWithProxy(obj, overrides) {
|
402 |
+
return new Proxy(obj, {
|
403 |
+
get(target, property, receiver) {
|
404 |
+
if (property in overrides) {
|
405 |
+
return overrides[property];
|
406 |
+
}
|
407 |
+
return Reflect.get(target, property, receiver);
|
408 |
+
},
|
409 |
+
set(target, property, value, receiver) {
|
410 |
+
if (property in overrides) {
|
411 |
+
overrides[property] = value;
|
412 |
+
return true;
|
413 |
+
}
|
414 |
+
return Reflect.set(target, property, value, receiver);
|
415 |
+
}
|
416 |
+
});
|
417 |
+
}
|
418 |
+
const cachedEventHandler = defineCachedEventHandler;
|
419 |
+
|
420 |
+
const config = useRuntimeConfig();
|
421 |
+
const _routeRulesMatcher = toRouteMatcher(
|
422 |
+
createRouter({ routes: config.nitro.routeRules })
|
423 |
+
);
|
424 |
+
function createRouteRulesHandler() {
|
425 |
+
return eventHandler((event) => {
|
426 |
+
const routeRules = getRouteRules(event);
|
427 |
+
if (routeRules.headers) {
|
428 |
+
setHeaders(event, routeRules.headers);
|
429 |
+
}
|
430 |
+
if (routeRules.redirect) {
|
431 |
+
return sendRedirect(
|
432 |
+
event,
|
433 |
+
routeRules.redirect.to,
|
434 |
+
routeRules.redirect.statusCode
|
435 |
+
);
|
436 |
+
}
|
437 |
+
if (routeRules.proxy) {
|
438 |
+
let target = routeRules.proxy.to;
|
439 |
+
if (target.endsWith("/**")) {
|
440 |
+
let targetPath = event.path;
|
441 |
+
const strpBase = routeRules.proxy._proxyStripBase;
|
442 |
+
if (strpBase) {
|
443 |
+
targetPath = withoutBase(targetPath, strpBase);
|
444 |
+
}
|
445 |
+
target = joinURL(target.slice(0, -3), targetPath);
|
446 |
+
} else if (event.path.includes("?")) {
|
447 |
+
const query = getQuery(event.path);
|
448 |
+
target = withQuery(target, query);
|
449 |
+
}
|
450 |
+
return proxyRequest(event, target, {
|
451 |
+
fetch: $fetch.raw,
|
452 |
+
...routeRules.proxy
|
453 |
+
});
|
454 |
+
}
|
455 |
+
});
|
456 |
+
}
|
457 |
+
function getRouteRules(event) {
|
458 |
+
event.context._nitro = event.context._nitro || {};
|
459 |
+
if (!event.context._nitro.routeRules) {
|
460 |
+
const path = new URL(event.node.req.url, "http://localhost").pathname;
|
461 |
+
event.context._nitro.routeRules = getRouteRulesForPath(
|
462 |
+
withoutBase(path, useRuntimeConfig().app.baseURL)
|
463 |
+
);
|
464 |
+
}
|
465 |
+
return event.context._nitro.routeRules;
|
466 |
+
}
|
467 |
+
function getRouteRulesForPath(path) {
|
468 |
+
return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
|
469 |
+
}
|
470 |
+
|
471 |
+
const script = "\"use strict\";(()=>{const a=window,e=document.documentElement,m=[\"dark\",\"light\"],c=window.localStorage.getItem(\"nuxt-color-mode\")||\"system\";let n=c===\"system\"?f():c;const l=e.getAttribute(\"data-color-mode-forced\");l&&(n=l),i(n),a[\"__NUXT_COLOR_MODE__\"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=\"\"+o+\"\",s=\"\";e.classList?e.classList.add(t):e.className+=\" \"+t,s&&e.setAttribute(\"data-\"+s,o)}function d(o){const t=\"\"+o+\"\",s=\"\";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,\"g\"),\"\"),s&&e.removeAttribute(\"data-\"+s)}function r(o){return a.matchMedia(\"(prefers-color-scheme\"+o+\")\")}function f(){if(a.matchMedia&&r(\"\").media!==\"not all\"){for(const o of m)if(r(\":\"+o).matches)return o}return\"light\"}})();\n";
|
472 |
+
|
473 |
+
const _li8eCxO7Mb = (function(nitro) {
|
474 |
+
nitro.hooks.hook("render:html", (htmlContext) => {
|
475 |
+
htmlContext.head.push(`<script>${script}<\/script>`);
|
476 |
+
});
|
477 |
+
});
|
478 |
+
|
479 |
+
const plugins = [
|
480 |
+
_li8eCxO7Mb
|
481 |
+
];
|
482 |
+
|
483 |
+
function hasReqHeader(event, name, includes) {
|
484 |
+
const value = getRequestHeader(event, name);
|
485 |
+
return value && typeof value === "string" && value.toLowerCase().includes(includes);
|
486 |
+
}
|
487 |
+
function isJsonRequest(event) {
|
488 |
+
return hasReqHeader(event, "accept", "application/json") || hasReqHeader(event, "user-agent", "curl/") || hasReqHeader(event, "user-agent", "httpie/") || hasReqHeader(event, "sec-fetch-mode", "cors") || event.path.startsWith("/api/") || event.path.endsWith(".json");
|
489 |
+
}
|
490 |
+
function normalizeError(error) {
|
491 |
+
const cwd = typeof process.cwd === "function" ? process.cwd() : "/";
|
492 |
+
const stack = (error.stack || "").split("\n").splice(1).filter((line) => line.includes("at ")).map((line) => {
|
493 |
+
const text = line.replace(cwd + "/", "./").replace("webpack:/", "").replace("file://", "").trim();
|
494 |
+
return {
|
495 |
+
text,
|
496 |
+
internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise")
|
497 |
+
};
|
498 |
+
});
|
499 |
+
const statusCode = error.statusCode || 500;
|
500 |
+
const statusMessage = error.statusMessage ?? (statusCode === 404 ? "Not Found" : "");
|
501 |
+
const message = error.message || error.toString();
|
502 |
+
return {
|
503 |
+
stack,
|
504 |
+
statusCode,
|
505 |
+
statusMessage,
|
506 |
+
message
|
507 |
+
};
|
508 |
+
}
|
509 |
+
function trapUnhandledNodeErrors() {
|
510 |
+
{
|
511 |
+
process.on(
|
512 |
+
"unhandledRejection",
|
513 |
+
(err) => console.error("[nitro] [unhandledRejection] " + err)
|
514 |
+
);
|
515 |
+
process.on(
|
516 |
+
"uncaughtException",
|
517 |
+
(err) => console.error("[nitro] [uncaughtException] " + err)
|
518 |
+
);
|
519 |
+
}
|
520 |
+
}
|
521 |
+
|
522 |
+
const errorHandler = (async function errorhandler(error, event) {
|
523 |
+
const { stack, statusCode, statusMessage, message } = normalizeError(error);
|
524 |
+
const errorObject = {
|
525 |
+
url: event.node.req.url,
|
526 |
+
statusCode,
|
527 |
+
statusMessage,
|
528 |
+
message,
|
529 |
+
stack: "",
|
530 |
+
data: error.data
|
531 |
+
};
|
532 |
+
if (error.unhandled || error.fatal) {
|
533 |
+
const tags = [
|
534 |
+
"[nuxt]",
|
535 |
+
"[request error]",
|
536 |
+
error.unhandled && "[unhandled]",
|
537 |
+
error.fatal && "[fatal]",
|
538 |
+
Number(errorObject.statusCode) !== 200 && `[${errorObject.statusCode}]`
|
539 |
+
].filter(Boolean).join(" ");
|
540 |
+
console.error(tags, errorObject.message + "\n" + stack.map((l) => " " + l.text).join(" \n"));
|
541 |
+
}
|
542 |
+
if (event.handled) {
|
543 |
+
return;
|
544 |
+
}
|
545 |
+
setResponseStatus(event, errorObject.statusCode !== 200 && errorObject.statusCode || 500, errorObject.statusMessage);
|
546 |
+
if (isJsonRequest(event)) {
|
547 |
+
setResponseHeader(event, "Content-Type", "application/json");
|
548 |
+
event.node.res.end(JSON.stringify(errorObject));
|
549 |
+
return;
|
550 |
+
}
|
551 |
+
const isErrorPage = event.node.req.url?.startsWith("/__nuxt_error");
|
552 |
+
const res = !isErrorPage ? await useNitroApp().localFetch(withQuery(joinURL(useRuntimeConfig().app.baseURL, "/__nuxt_error"), errorObject), {
|
553 |
+
headers: getRequestHeaders(event),
|
554 |
+
redirect: "manual"
|
555 |
+
}).catch(() => null) : null;
|
556 |
+
if (!res) {
|
557 |
+
const { template } = await import('../error-500.mjs');
|
558 |
+
if (event.handled) {
|
559 |
+
return;
|
560 |
+
}
|
561 |
+
setResponseHeader(event, "Content-Type", "text/html;charset=UTF-8");
|
562 |
+
event.node.res.end(template(errorObject));
|
563 |
+
return;
|
564 |
+
}
|
565 |
+
const html = await res.text();
|
566 |
+
if (event.handled) {
|
567 |
+
return;
|
568 |
+
}
|
569 |
+
for (const [header, value] of res.headers.entries()) {
|
570 |
+
setResponseHeader(event, header, value);
|
571 |
+
}
|
572 |
+
setResponseStatus(event, res.status && res.status !== 200 ? res.status : void 0, res.statusText);
|
573 |
+
event.node.res.end(html);
|
574 |
+
});
|
575 |
+
|
576 |
+
const assets = {
|
577 |
+
"/assistant.webp": {
|
578 |
+
"type": "image/webp",
|
579 |
+
"etag": "\"358e-5gEeoaCBiFf8mUDHxvmzbfkQGGw\"",
|
580 |
+
"mtime": "2023-09-02T07:01:21.911Z",
|
581 |
+
"size": 13710,
|
582 |
+
"path": "../public/assistant.webp"
|
583 |
+
},
|
584 |
+
"/favicon.ico": {
|
585 |
+
"type": "image/vnd.microsoft.icon",
|
586 |
+
"etag": "\"10be-GZF9eol8r77vs9YYGQyYNDfAQmU\"",
|
587 |
+
"mtime": "2023-09-02T07:01:21.911Z",
|
588 |
+
"size": 4286,
|
589 |
+
"path": "../public/favicon.ico"
|
590 |
+
},
|
591 |
+
"/system.png": {
|
592 |
+
"type": "image/png",
|
593 |
+
"etag": "\"914-r2AtZhGz01H2rxbKG4USwTY0o7g\"",
|
594 |
+
"mtime": "2023-09-02T07:01:21.911Z",
|
595 |
+
"size": 2324,
|
596 |
+
"path": "../public/system.png"
|
597 |
+
},
|
598 |
+
"/_nuxt/Icon.3b076208.js": {
|
599 |
+
"type": "application/javascript",
|
600 |
+
"etag": "\"547f-/lK3eVGImSDs0XFoWfnFpR38mLE\"",
|
601 |
+
"mtime": "2023-09-02T07:01:21.910Z",
|
602 |
+
"size": 21631,
|
603 |
+
"path": "../public/_nuxt/Icon.3b076208.js"
|
604 |
+
},
|
605 |
+
"/_nuxt/Icon.7f9eef6a.css": {
|
606 |
+
"type": "text/css; charset=utf-8",
|
607 |
+
"etag": "\"43-7gyvDsg8y3KCxPC4QluSQiiOwKU\"",
|
608 |
+
"mtime": "2023-09-02T07:01:21.909Z",
|
609 |
+
"size": 67,
|
610 |
+
"path": "../public/_nuxt/Icon.7f9eef6a.css"
|
611 |
+
},
|
612 |
+
"/_nuxt/IconCSS.c81b379e.css": {
|
613 |
+
"type": "text/css; charset=utf-8",
|
614 |
+
"etag": "\"102-GbRGCUqjz0SoSjgZ8jhSYhGL8us\"",
|
615 |
+
"mtime": "2023-09-02T07:01:21.909Z",
|
616 |
+
"size": 258,
|
617 |
+
"path": "../public/_nuxt/IconCSS.c81b379e.css"
|
618 |
+
},
|
619 |
+
"/_nuxt/IconCSS.eb488b91.js": {
|
620 |
+
"type": "application/javascript",
|
621 |
+
"etag": "\"4d0-3uTdRRiGsKZp9cfMPoAC5jV2ZDc\"",
|
622 |
+
"mtime": "2023-09-02T07:01:21.908Z",
|
623 |
+
"size": 1232,
|
624 |
+
"path": "../public/_nuxt/IconCSS.eb488b91.js"
|
625 |
+
},
|
626 |
+
"/_nuxt/config.c258e904.js": {
|
627 |
+
"type": "application/javascript",
|
628 |
+
"etag": "\"a7-1M62aH8fpW38rsvezuFPHC8yK9Y\"",
|
629 |
+
"mtime": "2023-09-02T07:01:21.908Z",
|
630 |
+
"size": 167,
|
631 |
+
"path": "../public/_nuxt/config.c258e904.js"
|
632 |
+
},
|
633 |
+
"/_nuxt/entry.c3d50f7b.css": {
|
634 |
+
"type": "text/css; charset=utf-8",
|
635 |
+
"etag": "\"78c8-TrkfnNcgUr4T5zHLTDWNgBiDaAA\"",
|
636 |
+
"mtime": "2023-09-02T07:01:21.908Z",
|
637 |
+
"size": 30920,
|
638 |
+
"path": "../public/_nuxt/entry.c3d50f7b.css"
|
639 |
+
},
|
640 |
+
"/_nuxt/entry.f7d8c5bc.js": {
|
641 |
+
"type": "application/javascript",
|
642 |
+
"etag": "\"382c9-MtkE2QQ9kVjI59rwepR0GLf33q4\"",
|
643 |
+
"mtime": "2023-09-02T07:01:21.907Z",
|
644 |
+
"size": 230089,
|
645 |
+
"path": "../public/_nuxt/entry.f7d8c5bc.js"
|
646 |
+
},
|
647 |
+
"/_nuxt/error-404.717bb680.js": {
|
648 |
+
"type": "application/javascript",
|
649 |
+
"etag": "\"1983-TrvGC1D0DcmgD4ez6Y/rZM6+uQA\"",
|
650 |
+
"mtime": "2023-09-02T07:01:21.907Z",
|
651 |
+
"size": 6531,
|
652 |
+
"path": "../public/_nuxt/error-404.717bb680.js"
|
653 |
+
},
|
654 |
+
"/_nuxt/error-404.871584dc.css": {
|
655 |
+
"type": "text/css; charset=utf-8",
|
656 |
+
"etag": "\"e70-/i/RgmdoCkRRXzmcLKAwUns807c\"",
|
657 |
+
"mtime": "2023-09-02T07:01:21.906Z",
|
658 |
+
"size": 3696,
|
659 |
+
"path": "../public/_nuxt/error-404.871584dc.css"
|
660 |
+
},
|
661 |
+
"/_nuxt/error-500.0dcea73a.js": {
|
662 |
+
"type": "application/javascript",
|
663 |
+
"etag": "\"756-O+nAvKO1EAQ56rxCjwZYtevJbOg\"",
|
664 |
+
"mtime": "2023-09-02T07:01:21.906Z",
|
665 |
+
"size": 1878,
|
666 |
+
"path": "../public/_nuxt/error-500.0dcea73a.js"
|
667 |
+
},
|
668 |
+
"/_nuxt/error-500.5504fd74.css": {
|
669 |
+
"type": "text/css; charset=utf-8",
|
670 |
+
"etag": "\"7e0-1qS2/UnuTXlOTLpmd6jF7wkaoFU\"",
|
671 |
+
"mtime": "2023-09-02T07:01:21.904Z",
|
672 |
+
"size": 2016,
|
673 |
+
"path": "../public/_nuxt/error-500.5504fd74.css"
|
674 |
+
},
|
675 |
+
"/_nuxt/index.8ccdfb9b.css": {
|
676 |
+
"type": "text/css; charset=utf-8",
|
677 |
+
"etag": "\"1e4a-Yn0lQdE9ZOJPIkKHtJyMJ6BDksk\"",
|
678 |
+
"mtime": "2023-09-02T07:01:21.903Z",
|
679 |
+
"size": 7754,
|
680 |
+
"path": "../public/_nuxt/index.8ccdfb9b.css"
|
681 |
+
},
|
682 |
+
"/_nuxt/index.9ca75938.js": {
|
683 |
+
"type": "application/javascript",
|
684 |
+
"etag": "\"121946-qUsTvFlfZlcEbs2v+z3WEMPBxng\"",
|
685 |
+
"mtime": "2023-09-02T07:01:21.902Z",
|
686 |
+
"size": 1186118,
|
687 |
+
"path": "../public/_nuxt/index.9ca75938.js"
|
688 |
+
}
|
689 |
+
};
|
690 |
+
|
691 |
+
function readAsset (id) {
|
692 |
+
const serverDir = dirname(fileURLToPath(globalThis._importMeta_.url));
|
693 |
+
return promises.readFile(resolve(serverDir, assets[id].path))
|
694 |
+
}
|
695 |
+
|
696 |
+
const publicAssetBases = {"/_nuxt":{"maxAge":31536000}};
|
697 |
+
|
698 |
+
function isPublicAssetURL(id = '') {
|
699 |
+
if (assets[id]) {
|
700 |
+
return true
|
701 |
+
}
|
702 |
+
for (const base in publicAssetBases) {
|
703 |
+
if (id.startsWith(base)) { return true }
|
704 |
+
}
|
705 |
+
return false
|
706 |
+
}
|
707 |
+
|
708 |
+
function getAsset (id) {
|
709 |
+
return assets[id]
|
710 |
+
}
|
711 |
+
|
712 |
+
const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]);
|
713 |
+
const EncodingMap = { gzip: ".gz", br: ".br" };
|
714 |
+
const _f4b49z = eventHandler((event) => {
|
715 |
+
if (event.node.req.method && !METHODS.has(event.node.req.method)) {
|
716 |
+
return;
|
717 |
+
}
|
718 |
+
let id = decodeURIComponent(
|
719 |
+
withLeadingSlash(
|
720 |
+
withoutTrailingSlash(parseURL(event.node.req.url).pathname)
|
721 |
+
)
|
722 |
+
);
|
723 |
+
let asset;
|
724 |
+
const encodingHeader = String(
|
725 |
+
event.node.req.headers["accept-encoding"] || ""
|
726 |
+
);
|
727 |
+
const encodings = [
|
728 |
+
...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(),
|
729 |
+
""
|
730 |
+
];
|
731 |
+
if (encodings.length > 1) {
|
732 |
+
event.node.res.setHeader("Vary", "Accept-Encoding");
|
733 |
+
}
|
734 |
+
for (const encoding of encodings) {
|
735 |
+
for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
|
736 |
+
const _asset = getAsset(_id);
|
737 |
+
if (_asset) {
|
738 |
+
asset = _asset;
|
739 |
+
id = _id;
|
740 |
+
break;
|
741 |
+
}
|
742 |
+
}
|
743 |
+
}
|
744 |
+
if (!asset) {
|
745 |
+
if (isPublicAssetURL(id)) {
|
746 |
+
event.node.res.removeHeader("cache-control");
|
747 |
+
throw createError({
|
748 |
+
statusMessage: "Cannot find static asset " + id,
|
749 |
+
statusCode: 404
|
750 |
+
});
|
751 |
+
}
|
752 |
+
return;
|
753 |
+
}
|
754 |
+
const ifNotMatch = event.node.req.headers["if-none-match"] === asset.etag;
|
755 |
+
if (ifNotMatch) {
|
756 |
+
if (!event.handled) {
|
757 |
+
event.node.res.statusCode = 304;
|
758 |
+
event.node.res.end();
|
759 |
+
}
|
760 |
+
return;
|
761 |
+
}
|
762 |
+
const ifModifiedSinceH = event.node.req.headers["if-modified-since"];
|
763 |
+
const mtimeDate = new Date(asset.mtime);
|
764 |
+
if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
|
765 |
+
if (!event.handled) {
|
766 |
+
event.node.res.statusCode = 304;
|
767 |
+
event.node.res.end();
|
768 |
+
}
|
769 |
+
return;
|
770 |
+
}
|
771 |
+
if (asset.type && !event.node.res.getHeader("Content-Type")) {
|
772 |
+
event.node.res.setHeader("Content-Type", asset.type);
|
773 |
+
}
|
774 |
+
if (asset.etag && !event.node.res.getHeader("ETag")) {
|
775 |
+
event.node.res.setHeader("ETag", asset.etag);
|
776 |
+
}
|
777 |
+
if (asset.mtime && !event.node.res.getHeader("Last-Modified")) {
|
778 |
+
event.node.res.setHeader("Last-Modified", mtimeDate.toUTCString());
|
779 |
+
}
|
780 |
+
if (asset.encoding && !event.node.res.getHeader("Content-Encoding")) {
|
781 |
+
event.node.res.setHeader("Content-Encoding", asset.encoding);
|
782 |
+
}
|
783 |
+
if (asset.size > 0 && !event.node.res.getHeader("Content-Length")) {
|
784 |
+
event.node.res.setHeader("Content-Length", asset.size);
|
785 |
+
}
|
786 |
+
return readAsset(id);
|
787 |
+
});
|
788 |
+
|
789 |
+
function logger(...message) {
|
790 |
+
console.log(`${( new Date()).toISOString()}`, ...message);
|
791 |
+
}
|
792 |
+
|
793 |
+
const _8wOD0E = defineEventHandler((event) => {
|
794 |
+
logger(`[${getMethod(event)}]`, getRequestURL(event).href);
|
795 |
+
});
|
796 |
+
|
797 |
+
const BASE_KEY = "i18n";
|
798 |
+
const CONFIG_KEY = "config";
|
799 |
+
const configStorage = prefixStorage(useStorage(), BASE_KEY);
|
800 |
+
const PRECOMPILED_LOCALE_KEY = "i18n:locales";
|
801 |
+
const localeStorage = prefixStorage(useStorage(), PRECOMPILED_LOCALE_KEY);
|
802 |
+
const resolveKey = (key) => `${key}.js`;
|
803 |
+
const localeKey = (locale, hash) => `${locale}-${hash}`;
|
804 |
+
const configKey = (hash) => `${CONFIG_KEY}-${hash}`;
|
805 |
+
const _PiSkHp = defineEventHandler(async (event) => {
|
806 |
+
const body = await readBody(event);
|
807 |
+
validate(body);
|
808 |
+
const cacheCode = await getCacheCode(body);
|
809 |
+
if (cacheCode) {
|
810 |
+
await setResponseHeader(event, "content-type", "text/javascript");
|
811 |
+
return cacheCode.toString();
|
812 |
+
}
|
813 |
+
const [code, errors] = generateCode(body);
|
814 |
+
if (errors.length > 0) {
|
815 |
+
throw createError({ statusMessage: errors.join("|"), statusCode: 400 });
|
816 |
+
}
|
817 |
+
await setCacheCode(code, body);
|
818 |
+
await setResponseHeader(event, "content-type", "text/javascript");
|
819 |
+
return code;
|
820 |
+
});
|
821 |
+
function validate(body) {
|
822 |
+
if (!body.type) {
|
823 |
+
throw createError({ statusMessage: `require the 'type'`, statusCode: 400 });
|
824 |
+
}
|
825 |
+
if (body.type === "locale") {
|
826 |
+
if (!body.locale) {
|
827 |
+
throw createError({ statusMessage: `require the 'locale'`, statusCode: 400 });
|
828 |
+
}
|
829 |
+
}
|
830 |
+
if (!body.hash) {
|
831 |
+
throw createError({ statusMessage: `require the 'hash'`, statusCode: 400 });
|
832 |
+
}
|
833 |
+
if (!body.resource) {
|
834 |
+
throw createError({ statusMessage: `require the 'resource'`, statusCode: 400 });
|
835 |
+
}
|
836 |
+
}
|
837 |
+
async function getCacheCode({ type, locale, hash }) {
|
838 |
+
if (type === "locale") {
|
839 |
+
return await localeStorage.getItem(resolveKey(localeKey(locale, hash)));
|
840 |
+
} else if (type === "config") {
|
841 |
+
return await configStorage.getItem(resolveKey(configKey(hash)));
|
842 |
+
} else {
|
843 |
+
return null;
|
844 |
+
}
|
845 |
+
}
|
846 |
+
function generateCode(body) {
|
847 |
+
const errors = [];
|
848 |
+
const {
|
849 |
+
i18n: {
|
850 |
+
precompile: { strictMessage, escapeHtml }
|
851 |
+
}
|
852 |
+
} = useRuntimeConfig();
|
853 |
+
const env = "production";
|
854 |
+
let gen = "";
|
855 |
+
if (body.type === "locale") {
|
856 |
+
const { code } = generateJSON(JSON.stringify(body.resource), {
|
857 |
+
env,
|
858 |
+
strictMessage,
|
859 |
+
escapeHtml,
|
860 |
+
onError: (error) => {
|
861 |
+
errors.push(error);
|
862 |
+
}
|
863 |
+
});
|
864 |
+
gen = code;
|
865 |
+
} else if (body.type === "config") {
|
866 |
+
gen += `export default {
|
867 |
+
`;
|
868 |
+
const codes = [];
|
869 |
+
Object.keys(body.resource).reduce((codes2, key) => {
|
870 |
+
const { code } = generateJSON(JSON.stringify(body.resource[key]), {
|
871 |
+
type: "bare",
|
872 |
+
env,
|
873 |
+
strictMessage,
|
874 |
+
escapeHtml,
|
875 |
+
onError: (error) => {
|
876 |
+
errors.push(error);
|
877 |
+
}
|
878 |
+
});
|
879 |
+
codes2.push(` ${JSON.stringify(key)}: ${code},
|
880 |
+
`);
|
881 |
+
return codes2;
|
882 |
+
}, codes);
|
883 |
+
gen += codes.join("");
|
884 |
+
gen += `}
|
885 |
+
`;
|
886 |
+
}
|
887 |
+
return [gen, errors];
|
888 |
+
}
|
889 |
+
async function setCacheCode(code, { type, locale, hash }) {
|
890 |
+
if (type === "locale") {
|
891 |
+
await localeStorage.setItem(resolveKey(localeKey(locale, hash)), code);
|
892 |
+
} else if (type === "config") {
|
893 |
+
await configStorage.setItem(resolveKey(configKey(hash)), code);
|
894 |
+
}
|
895 |
+
}
|
896 |
+
|
897 |
+
/*!
|
898 |
+
* shared v9.3.0-beta.17
|
899 |
+
* (c) 2023 kazuya kawaguchi
|
900 |
+
* Released under the MIT License.
|
901 |
+
*/
|
902 |
+
/**
|
903 |
+
* Original Utilities
|
904 |
+
* written by kazuya kawaguchi
|
905 |
+
*/
|
906 |
+
const isFunction = (val) => typeof val === 'function';
|
907 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
908 |
+
const isObject = (val) => val !== null && typeof val === 'object';
|
909 |
+
|
910 |
+
const _4YozrI = defineEventHandler(async (event) => {
|
911 |
+
const hash = event.context.params?.hash;
|
912 |
+
if (hash == null) {
|
913 |
+
throw createError({ statusMessage: `require the 'hash'`, statusCode: 400 });
|
914 |
+
}
|
915 |
+
const i18nMeta = await getI18nMeta();
|
916 |
+
const [filename] = hash.split(".");
|
917 |
+
const target = i18nMeta[filename];
|
918 |
+
const loadPath = await resolveModule(target.path);
|
919 |
+
const loader = await import(loadPath).then((m) => m.default || m);
|
920 |
+
if (target.type === "locale") {
|
921 |
+
if (target.locale == null) {
|
922 |
+
throw createError({ statusMessage: `not found locale`, statusCode: 500 });
|
923 |
+
}
|
924 |
+
const resource = await loader(target.locale);
|
925 |
+
const code = await precompileLocale(target.locale, filename, resource);
|
926 |
+
await setResponseHeader(event, "content-type", "text/javascript");
|
927 |
+
return code;
|
928 |
+
} else if (target.type === "config") {
|
929 |
+
const config = isFunction(loader) ? await loader() : isObject(loader) ? loader : {};
|
930 |
+
const messages = config.messages || {};
|
931 |
+
const code = await precompileConfig(filename, messages);
|
932 |
+
await setResponseHeader(event, "content-type", "text/javascript");
|
933 |
+
return code;
|
934 |
+
} else {
|
935 |
+
throw new Error("Invalid type");
|
936 |
+
}
|
937 |
+
});
|
938 |
+
async function getI18nMeta() {
|
939 |
+
return await useStorage().getItem("build:dist:server:i18n-meta.json");
|
940 |
+
}
|
941 |
+
async function resolveModule(path) {
|
942 |
+
const storage = await useStorage();
|
943 |
+
const rootMount = await storage.getMount("root");
|
944 |
+
const root = rootMount.driver.options.base;
|
945 |
+
const rootRelative = relative(new URL(globalThis._importMeta_.url).pathname, root);
|
946 |
+
return join(rootRelative, "dist/server", path);
|
947 |
+
}
|
948 |
+
async function precompileLocale(locale, filename, messages) {
|
949 |
+
return await $fetch("/__i18n__/precompile", {
|
950 |
+
method: "POST",
|
951 |
+
body: {
|
952 |
+
locale,
|
953 |
+
type: "locale",
|
954 |
+
hash: filename,
|
955 |
+
resource: messages
|
956 |
+
}
|
957 |
+
});
|
958 |
+
}
|
959 |
+
async function precompileConfig(filename, messages) {
|
960 |
+
return await $fetch("/__i18n__/precompile", {
|
961 |
+
method: "POST",
|
962 |
+
body: {
|
963 |
+
type: "config",
|
964 |
+
hash: filename,
|
965 |
+
resource: getNeedPrecompileMessages(messages)
|
966 |
+
}
|
967 |
+
});
|
968 |
+
}
|
969 |
+
function deepCopy(src, des, predicate) {
|
970 |
+
for (const key in src) {
|
971 |
+
if (isObject(src[key])) {
|
972 |
+
if (!isObject(des[key]))
|
973 |
+
des[key] = {};
|
974 |
+
deepCopy(src[key], des[key], predicate);
|
975 |
+
} else {
|
976 |
+
if (predicate) {
|
977 |
+
if (predicate(src[key], des[key])) {
|
978 |
+
des[key] = src[key];
|
979 |
+
}
|
980 |
+
} else {
|
981 |
+
des[key] = src[key];
|
982 |
+
}
|
983 |
+
}
|
984 |
+
}
|
985 |
+
}
|
986 |
+
function getNeedPrecompileMessages(messages) {
|
987 |
+
const needPrecompileMessages = {};
|
988 |
+
const predicate = (src) => !isFunction(src);
|
989 |
+
for (const [locale, message] of Object.entries(messages)) {
|
990 |
+
const dest = needPrecompileMessages[locale] = {};
|
991 |
+
deepCopy(message, dest, predicate);
|
992 |
+
}
|
993 |
+
return needPrecompileMessages;
|
994 |
+
}
|
995 |
+
|
996 |
+
const _lazy_HESyZv = () => import('../completions.post.mjs');
|
997 |
+
const _lazy_B8tQ3M = () => import('../completions.post2.mjs');
|
998 |
+
const _lazy_oAvAPh = () => import('../crypto.post.mjs');
|
999 |
+
const _lazy_kMIR2T = () => import('../generations.post.mjs');
|
1000 |
+
const _lazy_WIxXO1 = () => import('../models.get.mjs');
|
1001 |
+
const _lazy_tWV8vP = () => import('../handlers/renderer.mjs');
|
1002 |
+
|
1003 |
+
const handlers = [
|
1004 |
+
{ route: '', handler: _f4b49z, lazy: false, middleware: true, method: undefined },
|
1005 |
+
{ route: '', handler: _8wOD0E, lazy: false, middleware: true, method: undefined },
|
1006 |
+
{ route: '/api/chat/completions', handler: _lazy_HESyZv, lazy: true, middleware: false, method: "post" },
|
1007 |
+
{ route: '/api/completions', handler: _lazy_B8tQ3M, lazy: true, middleware: false, method: "post" },
|
1008 |
+
{ route: '/api/crypto', handler: _lazy_oAvAPh, lazy: true, middleware: false, method: "post" },
|
1009 |
+
{ route: '/api/images/generations', handler: _lazy_kMIR2T, lazy: true, middleware: false, method: "post" },
|
1010 |
+
{ route: '/api/models', handler: _lazy_WIxXO1, lazy: true, middleware: false, method: "get" },
|
1011 |
+
{ route: '/__nuxt_error', handler: _lazy_tWV8vP, lazy: true, middleware: false, method: undefined },
|
1012 |
+
{ route: '/__i18n__/precompile', handler: _PiSkHp, lazy: false, middleware: false, method: "post" },
|
1013 |
+
{ route: '/__i18n__/prerender/:hash', handler: _4YozrI, lazy: false, middleware: false, method: "get" },
|
1014 |
+
{ route: '/**', handler: _lazy_tWV8vP, lazy: true, middleware: false, method: undefined }
|
1015 |
+
];
|
1016 |
+
|
1017 |
+
function createNitroApp() {
|
1018 |
+
const config = useRuntimeConfig();
|
1019 |
+
const hooks = createHooks();
|
1020 |
+
const h3App = createApp({
|
1021 |
+
debug: destr(false),
|
1022 |
+
onError: errorHandler
|
1023 |
+
});
|
1024 |
+
const router = createRouter$1();
|
1025 |
+
h3App.use(createRouteRulesHandler());
|
1026 |
+
const localCall = createCall(toNodeListener(h3App));
|
1027 |
+
const localFetch = createFetch(localCall, globalThis.fetch);
|
1028 |
+
const $fetch = createFetch$1({
|
1029 |
+
fetch: localFetch,
|
1030 |
+
Headers,
|
1031 |
+
defaults: { baseURL: config.app.baseURL }
|
1032 |
+
});
|
1033 |
+
globalThis.$fetch = $fetch;
|
1034 |
+
h3App.use(
|
1035 |
+
eventHandler((event) => {
|
1036 |
+
event.context.nitro = event.context.nitro || {};
|
1037 |
+
const envContext = event.node.req.__unenv__;
|
1038 |
+
if (envContext) {
|
1039 |
+
Object.assign(event.context, envContext);
|
1040 |
+
}
|
1041 |
+
event.fetch = (req, init) => fetchWithEvent(event, req, init, { fetch: localFetch });
|
1042 |
+
event.$fetch = (req, init) => fetchWithEvent(event, req, init, {
|
1043 |
+
fetch: $fetch
|
1044 |
+
});
|
1045 |
+
})
|
1046 |
+
);
|
1047 |
+
for (const h of handlers) {
|
1048 |
+
let handler = h.lazy ? lazyEventHandler(h.handler) : h.handler;
|
1049 |
+
if (h.middleware || !h.route) {
|
1050 |
+
const middlewareBase = (config.app.baseURL + (h.route || "/")).replace(
|
1051 |
+
/\/+/g,
|
1052 |
+
"/"
|
1053 |
+
);
|
1054 |
+
h3App.use(middlewareBase, handler);
|
1055 |
+
} else {
|
1056 |
+
const routeRules = getRouteRulesForPath(
|
1057 |
+
h.route.replace(/:\w+|\*\*/g, "_")
|
1058 |
+
);
|
1059 |
+
if (routeRules.cache) {
|
1060 |
+
handler = cachedEventHandler(handler, {
|
1061 |
+
group: "nitro/routes",
|
1062 |
+
...routeRules.cache
|
1063 |
+
});
|
1064 |
+
}
|
1065 |
+
router.use(h.route, handler, h.method);
|
1066 |
+
}
|
1067 |
+
}
|
1068 |
+
h3App.use(config.app.baseURL, router.handler);
|
1069 |
+
const app = {
|
1070 |
+
hooks,
|
1071 |
+
h3App,
|
1072 |
+
router,
|
1073 |
+
localCall,
|
1074 |
+
localFetch
|
1075 |
+
};
|
1076 |
+
for (const plugin of plugins) {
|
1077 |
+
plugin(app);
|
1078 |
+
}
|
1079 |
+
return app;
|
1080 |
+
}
|
1081 |
+
const nitroApp = createNitroApp();
|
1082 |
+
const useNitroApp = () => nitroApp;
|
1083 |
+
|
1084 |
+
function getGracefulShutdownConfig() {
|
1085 |
+
return {
|
1086 |
+
disabled: !!process.env.NITRO_SHUTDOWN_DISABLED,
|
1087 |
+
signals: (process.env.NITRO_SHUTDOWN_SIGNALS || "SIGTERM SIGINT").split(" ").map((s) => s.trim()),
|
1088 |
+
timeout: Number.parseInt(process.env.NITRO_SHUTDOWN_TIMEOUT, 10) || 3e4,
|
1089 |
+
forceExit: !process.env.NITRO_SHUTDOWN_NO_FORCE_EXIT
|
1090 |
+
};
|
1091 |
+
}
|
1092 |
+
function setupGracefulShutdown(listener, nitroApp) {
|
1093 |
+
const shutdownConfig = getGracefulShutdownConfig();
|
1094 |
+
if (shutdownConfig.disabled) {
|
1095 |
+
return;
|
1096 |
+
}
|
1097 |
+
gracefulShutdown(listener, {
|
1098 |
+
signals: shutdownConfig.signals.join(" "),
|
1099 |
+
timeout: shutdownConfig.timeout,
|
1100 |
+
forceExit: shutdownConfig.forceExit,
|
1101 |
+
onShutdown: async () => {
|
1102 |
+
await new Promise((resolve) => {
|
1103 |
+
const timeout = setTimeout(() => {
|
1104 |
+
console.warn("Graceful shutdown timeout, force exiting...");
|
1105 |
+
resolve();
|
1106 |
+
}, shutdownConfig.timeout);
|
1107 |
+
nitroApp.hooks.callHook("close").catch((err) => {
|
1108 |
+
console.error(err);
|
1109 |
+
}).finally(() => {
|
1110 |
+
clearTimeout(timeout);
|
1111 |
+
resolve();
|
1112 |
+
});
|
1113 |
+
});
|
1114 |
+
}
|
1115 |
+
});
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
const cert = process.env.NITRO_SSL_CERT;
|
1119 |
+
const key = process.env.NITRO_SSL_KEY;
|
1120 |
+
const server = cert && key ? new Server({ key, cert }, toNodeListener(nitroApp.h3App)) : new Server$1(toNodeListener(nitroApp.h3App));
|
1121 |
+
const port = destr(process.env.NITRO_PORT || process.env.PORT) || 3e3;
|
1122 |
+
const host = process.env.NITRO_HOST || process.env.HOST;
|
1123 |
+
const listener = server.listen(port, host, (err) => {
|
1124 |
+
if (err) {
|
1125 |
+
console.error(err);
|
1126 |
+
process.exit(1);
|
1127 |
+
}
|
1128 |
+
const protocol = cert && key ? "https" : "http";
|
1129 |
+
const addressInfo = listener.address();
|
1130 |
+
const baseURL = (useRuntimeConfig().app.baseURL || "").replace(/\/$/, "");
|
1131 |
+
const url = `${protocol}://${addressInfo.family === "IPv6" ? `[${addressInfo.address}]` : addressInfo.address}:${addressInfo.port}${baseURL}`;
|
1132 |
+
console.log(`Listening ${url}`);
|
1133 |
+
});
|
1134 |
+
trapUnhandledNodeErrors();
|
1135 |
+
setupGracefulShutdown(listener, nitroApp);
|
1136 |
+
const nodeServer = {};
|
1137 |
+
|
1138 |
+
export { useNitroApp as a, getRouteRules as g, logger as l, nodeServer as n, useRuntimeConfig as u };
|
1139 |
+
//# sourceMappingURL=node-server.mjs.map
|
chunks/nitro/node-server.mjs.map
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chunks/rollup/_virtual_head-static.mjs
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const _virtual__headStatic = {"headTags":"<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">","bodyTags":"","bodyTagsOpen":"","htmlAttrs":"","bodyAttrs":""};
|
2 |
+
|
3 |
+
export { _virtual__headStatic as default };
|
4 |
+
//# sourceMappingURL=_virtual_head-static.mjs.map
|
chunks/rollup/_virtual_head-static.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"_virtual_head-static.mjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;"}
|
chunks/rollup/_virtual_spa-template.mjs
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const template = "<svg class=\"nuxt-spa-loading\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 37 25\" fill=\"none\" width=\"80\"><path d=\"M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567\"/></svg><style>.nuxt-spa-loading {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.nuxt-spa-loading>path {\n fill: none;\n stroke: #00DC82;\n stroke-width: 4px;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 128;\n stroke-dashoffset: 128;\n animation: nuxt-spa-loading-move 3s linear infinite;\n}\n@keyframes nuxt-spa-loading-move {\n 100% {\n stroke-dashoffset: -128;\n }\n}</style>";
|
2 |
+
|
3 |
+
export { template };
|
4 |
+
//# sourceMappingURL=_virtual_spa-template.mjs.map
|
chunks/rollup/_virtual_spa-template.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"_virtual_spa-template.mjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;"}
|
index.mjs
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
globalThis._importMeta_={url:import.meta.url,env:process.env};import 'node-fetch-native/polyfill';
|
2 |
+
import 'node:http';
|
3 |
+
import 'node:https';
|
4 |
+
import 'destr';
|
5 |
+
import 'h3';
|
6 |
+
export { n as default } from './chunks/nitro/node-server.mjs';
|
7 |
+
import 'ofetch';
|
8 |
+
import 'unenv/runtime/fetch/index';
|
9 |
+
import 'hookable';
|
10 |
+
import 'scule';
|
11 |
+
import 'klona';
|
12 |
+
import 'defu';
|
13 |
+
import 'ohash';
|
14 |
+
import 'ufo';
|
15 |
+
import 'unstorage';
|
16 |
+
import 'unstorage/drivers/fs';
|
17 |
+
import 'radix3';
|
18 |
+
import 'node:fs';
|
19 |
+
import 'node:url';
|
20 |
+
import 'pathe';
|
21 |
+
import '@intlify/bundle-utils';
|
22 |
+
import 'http-graceful-shutdown';
|
23 |
+
//# sourceMappingURL=index.mjs.map
|
index.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
package.json
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "nitro-output",
|
3 |
+
"version": "0.0.0",
|
4 |
+
"private": true,
|
5 |
+
"bundledDependencies": {
|
6 |
+
"@babel/parser": "7.22.10",
|
7 |
+
"@intlify/bundle-utils": "5.5.0",
|
8 |
+
"@intlify/core-base": "9.3.0-beta.17",
|
9 |
+
"@intlify/devtools-if": "9.3.0-beta.17",
|
10 |
+
"@intlify/message-compiler": "9.3.0-beta.17",
|
11 |
+
"@intlify/shared": "9.3.0-beta.17",
|
12 |
+
"@jridgewell/sourcemap-codec": "1.4.15",
|
13 |
+
"@vue/compiler-core": "3.3.4",
|
14 |
+
"@vue/compiler-dom": "3.3.4",
|
15 |
+
"@vue/compiler-ssr": "3.3.4",
|
16 |
+
"@vue/reactivity": "3.3.4",
|
17 |
+
"@vue/runtime-core": "3.3.4",
|
18 |
+
"@vue/runtime-dom": "3.3.4",
|
19 |
+
"@vue/server-renderer": "3.3.4",
|
20 |
+
"@vue/shared": "3.3.4",
|
21 |
+
"acorn": "8.10.0 || 7.4.1",
|
22 |
+
"acorn-jsx": "5.3.2",
|
23 |
+
"anymatch": "3.1.3",
|
24 |
+
"asynckit": "0.4.0",
|
25 |
+
"axios": "0.26.1",
|
26 |
+
"binary-extensions": "2.2.0",
|
27 |
+
"braces": "3.0.2",
|
28 |
+
"buffer-from": "1.1.2",
|
29 |
+
"chokidar": "3.5.3",
|
30 |
+
"combined-stream": "1.0.8",
|
31 |
+
"cookie-es": "1.0.0",
|
32 |
+
"crypto-js": "4.1.1",
|
33 |
+
"debug": "4.3.4",
|
34 |
+
"defu": "6.1.2",
|
35 |
+
"delayed-stream": "1.0.0",
|
36 |
+
"destr": "2.0.1",
|
37 |
+
"devalue": "4.3.2",
|
38 |
+
"escodegen": "2.1.0",
|
39 |
+
"eslint-utils": "2.1.0",
|
40 |
+
"eslint-visitor-keys": "1.3.0",
|
41 |
+
"espree": "6.2.1",
|
42 |
+
"estraverse": "5.3.0",
|
43 |
+
"estree-walker": "2.0.2",
|
44 |
+
"esutils": "2.0.3",
|
45 |
+
"fill-range": "7.0.1",
|
46 |
+
"follow-redirects": "1.15.2",
|
47 |
+
"form-data": "4.0.0",
|
48 |
+
"fsevents": "2.3.2",
|
49 |
+
"glob-parent": "5.1.2",
|
50 |
+
"h3": "1.8.0",
|
51 |
+
"hookable": "5.5.3",
|
52 |
+
"http-graceful-shutdown": "3.1.13",
|
53 |
+
"iron-webcrypto": "0.8.0",
|
54 |
+
"is-binary-path": "2.1.0",
|
55 |
+
"is-extglob": "2.1.1",
|
56 |
+
"is-glob": "4.0.3",
|
57 |
+
"is-number": "7.0.0",
|
58 |
+
"jsonc-eslint-parser": "1.4.1",
|
59 |
+
"klona": "2.0.6",
|
60 |
+
"lodash": "4.17.21",
|
61 |
+
"magic-string": "0.30.2",
|
62 |
+
"mime-db": "1.52.0",
|
63 |
+
"mime-types": "2.1.35",
|
64 |
+
"ms": "2.1.2",
|
65 |
+
"node-fetch-native": "1.2.0",
|
66 |
+
"normalize-path": "3.0.0",
|
67 |
+
"ofetch": "1.1.1",
|
68 |
+
"ohash": "1.1.3",
|
69 |
+
"openai": "3.3.0",
|
70 |
+
"pathe": "1.1.1",
|
71 |
+
"picomatch": "2.3.1",
|
72 |
+
"radix3": "1.1.0",
|
73 |
+
"readdirp": "3.6.0",
|
74 |
+
"scule": "1.0.0",
|
75 |
+
"semver": "6.3.1",
|
76 |
+
"source-map": "0.6.1",
|
77 |
+
"source-map-js": "1.0.2",
|
78 |
+
"source-map-support": "0.5.21",
|
79 |
+
"supports-color": "9.4.0",
|
80 |
+
"to-regex-range": "5.0.1",
|
81 |
+
"ufo": "1.2.0",
|
82 |
+
"uncrypto": "0.1.3",
|
83 |
+
"unenv": "1.7.1",
|
84 |
+
"unstorage": "1.9.0",
|
85 |
+
"vue": "3.3.4",
|
86 |
+
"vue-bundle-renderer": "1.0.3",
|
87 |
+
"vue-i18n": "9.3.0-beta.17",
|
88 |
+
"yaml": "1.10.2",
|
89 |
+
"yaml-eslint-parser": "0.3.2"
|
90 |
+
}
|
91 |
+
}
|